diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-02-14 17:20:49 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-02-20 06:11:05 +0000 |
commit | b845ba1900387b8ea44a27a1f7d045ca0091adf2 (patch) | |
tree | 2b5983340baa68dbee09abcdf3b923b4819cd68d /vcl/qt5 | |
parent | d5ace6bf0f1e48ee02e5eb22ce0f9f8953517f60 (diff) |
tdf#153614 qt: Set keyboard focus state when focused, too
For example the Breeze theme only draws a light blue
focus rectangle for list boxes when the
`QStyle::State_KeyboardFocusChange` state is set in addition
to `QStyle::State_HasFocus`.
Therefore, set that state in addition to ensure that the focused
control actually gets a focus indicator when moving there
using the keyboard.
Change-Id: Ib4b85f9140629e6b69c80b85e85913392a6c000f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147019
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/QtGraphics_Controls.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/qt5/QtGraphics_Controls.cxx b/vcl/qt5/QtGraphics_Controls.cxx index 0c5b85d28a11..4bb4df1e6e66 100644 --- a/vcl/qt5/QtGraphics_Controls.cxx +++ b/vcl/qt5/QtGraphics_Controls.cxx @@ -40,7 +40,9 @@ static QStyle::State vclStateValue2StateFlag(ControlState nControlState, { QStyle::State nState = ((nControlState & ControlState::ENABLED) ? QStyle::State_Enabled : QStyle::State_None) - | ((nControlState & ControlState::FOCUSED) ? QStyle::State_HasFocus : QStyle::State_None) + | ((nControlState & ControlState::FOCUSED) + ? QStyle::State_HasFocus | QStyle::State_KeyboardFocusChange + : QStyle::State_None) | ((nControlState & ControlState::PRESSED) ? QStyle::State_Sunken : QStyle::State_None) | ((nControlState & ControlState::SELECTED) ? QStyle::State_Selected : QStyle::State_None) | ((nControlState & ControlState::ROLLOVER) ? QStyle::State_MouseOver |