From cdcbf4b079308be761e34c25e45b4a1d2821273f Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sun, 19 May 2019 12:33:12 +0200 Subject: [PATCH] highlight focused widget initially --- src/gui/Dialog.cxx | 7 +++++-- src/gui/Widget.cxx | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index c1b9dbb8a..296ce9d73 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -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 + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index ebc86a2c1..5cef6eb93 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -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);