From b845ba1900387b8ea44a27a1f7d045ca0091adf2 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 14 Feb 2023 17:20:49 +0100 Subject: 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 --- vcl/qt5/QtGraphics_Controls.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vcl') 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 -- cgit