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

@ -422,9 +422,12 @@ void Dialog::drawDialog()
// Draw outlines for focused widgets
// Don't change focus, since this will trigger lost and received
// focus events
if(_focusedWidget)
if (_focusedWidget)
{
_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)
tmp->receivedFocus();
else
else {
tmp->_hasFocus = true;
tmp->setFlags(Widget::FLAG_HILITED);
}
if (onTop)
s.frameRect(x, y, w, h, kWidFrameColor, FrameStyle::Dashed);