diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-22 22:15:55 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-11 09:00:25 +0000 |
commit | dcf7ae894e5d6db7f0856f556a7c1983ba1ad7e9 (patch) | |
tree | 5f37239161d62e3c88354b6cc5615751df92b891 /src/imports | |
parent | 7172c212faf73b6f4ab80b025e4cd45ecc7d6a86 (diff) |
Add Control::activeKeyFocus
This is a convenience property that combines Item::activeFocus and
Control::focusReason. This allows us to solve QTBUG-51796 in an elegant
way - we can simply set Qt::StrongFocus policy on most of the interactive
controls, such as buttons. The only thing we need to make sure is to use
activeKeyFocus instead of activeFocus in the styles. This ensures that key
focus is only visualized when actually interacting with keys - not when
interacting via touch or mouse. This is a generalized version of the
solution that was already used in the Universal style ApplicationWindow.
Change-Id: Ifbf78e3e412f3791c8f7c369bb2de53af9ac6b0f
Task-number: QTBUG-51796
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/controls/universal/ApplicationWindow.qml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index 3113e748..3acc70db 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -52,7 +52,6 @@ T.ApplicationWindow { parent: window.activeFocusControl width: parent ? parent.width : 0 height: parent ? parent.height : 0 - visible: parent && !!parent.useSystemFocusVisuals - && (parent.focusReason === Qt.TabFocusReason || parent.focusReason === Qt.BacktabFocusReason) + visible: parent && !!parent.useSystemFocusVisuals && !!parent.activeKeyFocus } } |