mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 21:53:53 +00:00
Add version checks
This commit is contained in:
parent
bdcbb412a5
commit
1f1755ae48
1 changed files with 8 additions and 2 deletions
|
@ -93,6 +93,7 @@ void KeyboardNavigation::_unlinkWidget(MyGUI::Widget *widget)
|
|||
mCurrentFocus = nullptr;
|
||||
}
|
||||
|
||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||
void styleFocusedButton(MyGUI::Widget* w)
|
||||
{
|
||||
if (w)
|
||||
|
@ -103,6 +104,7 @@ void styleFocusedButton(MyGUI::Widget* w)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool isRootParent(MyGUI::Widget* widget, MyGUI::Widget* root)
|
||||
{
|
||||
|
@ -126,7 +128,9 @@ void KeyboardNavigation::onFrame()
|
|||
|
||||
if (focus == mCurrentFocus)
|
||||
{
|
||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||
styleFocusedButton(mCurrentFocus);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -137,19 +141,21 @@ void KeyboardNavigation::onFrame()
|
|||
focus = mCurrentFocus;
|
||||
}
|
||||
|
||||
// style highlighted button (won't be needed for MyGUI 3.2.3)
|
||||
if (focus != mCurrentFocus)
|
||||
{
|
||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||
if (mCurrentFocus)
|
||||
{
|
||||
if (MyGUI::Button* b = mCurrentFocus->castType<MyGUI::Button>(false))
|
||||
b->_setWidgetState("normal");
|
||||
}
|
||||
|
||||
#endif
|
||||
mCurrentFocus = focus;
|
||||
}
|
||||
|
||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||
styleFocusedButton(mCurrentFocus);
|
||||
#endif
|
||||
}
|
||||
|
||||
void KeyboardNavigation::setDefaultFocus(MyGUI::Widget *window, MyGUI::Widget *defaultFocus)
|
||||
|
|
Loading…
Reference in a new issue