mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 18:39:42 +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)
|
||||
: SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()),
|
||||
mToolTip (toolTip)
|
||||
mToolTip (toolTip), mFirst (0)
|
||||
{
|
||||
mPanel = new QFrame (this, Qt::Popup);
|
||||
|
||||
|
@ -37,8 +37,8 @@ void CSVWidget::SceneToolMode::showPanel (const QPoint& position)
|
|||
mPanel->move (position);
|
||||
mPanel->show();
|
||||
|
||||
if (!mButtons.empty())
|
||||
mButtons.begin()->first->setFocus (Qt::OtherFocusReason);
|
||||
if (mFirst)
|
||||
mFirst->setFocus (Qt::OtherFocusReason);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
mFirst = button;
|
||||
setIcon (button->icon());
|
||||
button->setChecked (true);
|
||||
adjustToolTip (button);
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace CSVWidget
|
|||
int mButtonSize;
|
||||
int mIconSize;
|
||||
QString mToolTip;
|
||||
PushButton *mFirst;
|
||||
|
||||
void adjustToolTip (const PushButton *activeMode);
|
||||
|
||||
|
|
Loading…
Reference in a new issue