highlight focused widget initially

This commit is contained in:
thrust26 2019-05-19 12:33:12 +02:00
parent 50088b08a5
commit cdcbf4b079
2 changed files with 8 additions and 3 deletions

View File

@ -423,8 +423,11 @@ void Dialog::drawDialog()
// Don't change focus, since this will trigger lost and received // Don't change focus, since this will trigger lost and received
// focus events // focus events
if (_focusedWidget) if (_focusedWidget)
{
_focusedWidget = Widget::setFocusForChain(this, getFocusList(), _focusedWidget = Widget::setFocusForChain(this, getFocusList(),
_focusedWidget, 0, false); _focusedWidget, 0, false);
_focusedWidget->draw(); // make sure the highlight color is drawn initially
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -284,8 +284,10 @@ Widget* Widget::setFocusForChain(GuiObject* boss, WidgetArray& arr,
if(emitFocusEvents) if(emitFocusEvents)
tmp->receivedFocus(); tmp->receivedFocus();
else else {
tmp->_hasFocus = true; tmp->_hasFocus = true;
tmp->setFlags(Widget::FLAG_HILITED);
}
if (onTop) if (onTop)
s.frameRect(x, y, w, h, kWidFrameColor, FrameStyle::Dashed); s.frameRect(x, y, w, h, kWidFrameColor, FrameStyle::Dashed);