diff options
author | Tobias Markmann <tm@ayena.de> | 2015-11-25 09:16:02 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-11-25 16:15:44 (GMT) |
commit | 8616d5f0c2a66c237cecbe1904f64e953be7bd14 (patch) | |
tree | 75e47f29a7dd51bd50f9a0180b8ef3395933aeb9 /Swift/QtUI | |
parent | fcf6a898de9c4f89db5de686aa203b3a52c18029 (diff) | |
download | swift-8616d5f0c2a66c237cecbe1904f64e953be7bd14.zip swift-8616d5f0c2a66c237cecbe1904f64e953be7bd14.tar.bz2 |
Fix Ctrl + Tab shortcut when MUC contact list is selected
This also fixes the issue of Ctrl + Backtab moving two tabs
back on Windows.
Test-Information:
Tested on Debian 8.2 with Gnome 3 and Qt 5.3.2, OS X 10.10.5
with Qt 5.4.2 and Windows 8 with Qt 5.4.2.
Verified that Ctrl + Tab works correctly.
Verified that Ctrl + Tab works correctly when the chat room
contact list is selected.
Verified that Ctrl + Backtab works correctly.
Change-Id: I9e461d741a399aed59142505e29c03cebe26097e
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtTabbable.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Swift/QtUI/QtTabbable.cpp b/Swift/QtUI/QtTabbable.cpp index feab35e..2a0bbc2 100644 --- a/Swift/QtUI/QtTabbable.cpp +++ b/Swift/QtUI/QtTabbable.cpp @@ -40,7 +40,9 @@ bool QtTabbable::event(QEvent* event) { if (keyEvent) { // According to Qt's focus documentation, one can only override CTRL+TAB via reimplementing QWidget::event(). if (keyEvent->modifiers().testFlag(QtUtilities::ctrlHardwareKeyModifier) && keyEvent->key() == Qt::Key_Tab) { - if (keyEvent->type() != QEvent::ShortcutOverride) { + // Only handle KeyRelease event as Linux also generate KeyPress event in case of CTRL+TAB being pressed + // in the roster of a MUC. + if (keyEvent->type() == QEvent::KeyRelease) { emit requestNextTab(); } return true; @@ -50,7 +52,12 @@ bool QtTabbable::event(QEvent* event) { #else else if (keyEvent->modifiers().testFlag(QtUtilities::ctrlHardwareKeyModifier) && keyEvent->key() == Qt::Key_Backtab) { #endif +#ifdef SWIFTEN_PLATFORM_WINDOWS + // Windows emits both the KeyPress and KeyRelease events. + if (keyEvent->type() == QEvent::KeyPress) { +#else if (keyEvent->type() != QEvent::ShortcutOverride) { +#endif emit requestPreviousTab(); } return true; |