summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorNoah Davis <noahadvs@gmail.com>2022-02-16 08:50:08 -0500
committerNoah Davis <noahadvs@gmail.com>2022-02-16 18:46:06 -0500
commit43caaca740dd217c13764658d4c286c0d83381e4 (patch)
tree13bbdb1c1f5379f477fd3114c53a9fb2ff132c92 /src/gui
parent760815599bc518f5a0f2d33398466867f07991b9 (diff)
QGnomeTheme: Allow Space, Return, Enter and Select to press buttons
GTK buttons can be pressed with Space, Return and Enter, so this should be considered native behavior for GTK based desktop environments. Qt::Key_Select is also included here because QAbstractButton has been pressable with Qt::Key_Select for a long time. Change-Id: I2c279ad05d1a10e5968a18996b8b40a83d2251fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/platform/unix/qgenericunixthemes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/platform/unix/qgenericunixthemes.cpp b/src/gui/platform/unix/qgenericunixthemes.cpp
index 86f2a266ea..1a564a5360 100644
--- a/src/gui/platform/unix/qgenericunixthemes.cpp
+++ b/src/gui/platform/unix/qgenericunixthemes.cpp
@@ -733,6 +733,7 @@ QGnomeTheme::QGnomeTheme()
QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
{
+ Q_D(const QGnomeTheme);
switch (hint) {
case QPlatformTheme::DialogButtonBoxButtonsHaveIcons:
return QVariant(true);
@@ -757,6 +758,9 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
return QVariant(QChar(0x2022));
case QPlatformTheme::UiEffects:
return QVariant(int(HoverEffect));
+ case QPlatformTheme::ButtonPressKeys:
+ return QVariant::fromValue(
+ QList<Qt::Key>({ Qt::Key_Space, Qt::Key_Return, Qt::Key_Enter, Qt::Key_Select }));
default:
break;
}