mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 15:10:03 +00:00
fixed focussed button in mode tool panel when panel is opened
This commit is contained in:
parent
17fc570e38
commit
0430558c3c
2 changed files with 5 additions and 3 deletions
|
@ -21,7 +21,7 @@ void CSVWidget::SceneToolMode::adjustToolTip (const PushButton *activeMode)
|
||||||
|
|
||||||
CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip)
|
CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip)
|
||||||
: SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()),
|
: SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()),
|
||||||
mToolTip (toolTip)
|
mToolTip (toolTip), mFirst (0)
|
||||||
{
|
{
|
||||||
mPanel = new QFrame (this, Qt::Popup);
|
mPanel = new QFrame (this, Qt::Popup);
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ void CSVWidget::SceneToolMode::showPanel (const QPoint& position)
|
||||||
mPanel->move (position);
|
mPanel->move (position);
|
||||||
mPanel->show();
|
mPanel->show();
|
||||||
|
|
||||||
if (!mButtons.empty())
|
if (mFirst)
|
||||||
mButtons.begin()->first->setFocus (Qt::OtherFocusReason);
|
mFirst->setFocus (Qt::OtherFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::string& id,
|
void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::string& id,
|
||||||
|
@ -58,6 +58,7 @@ void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::st
|
||||||
|
|
||||||
if (mButtons.size()==1)
|
if (mButtons.size()==1)
|
||||||
{
|
{
|
||||||
|
mFirst = button;
|
||||||
setIcon (button->icon());
|
setIcon (button->icon());
|
||||||
button->setChecked (true);
|
button->setChecked (true);
|
||||||
adjustToolTip (button);
|
adjustToolTip (button);
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace CSVWidget
|
||||||
int mButtonSize;
|
int mButtonSize;
|
||||||
int mIconSize;
|
int mIconSize;
|
||||||
QString mToolTip;
|
QString mToolTip;
|
||||||
|
PushButton *mFirst;
|
||||||
|
|
||||||
void adjustToolTip (const PushButton *activeMode);
|
void adjustToolTip (const PushButton *activeMode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue