diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-11-10 15:56:22 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2013-11-10 15:56:22 (GMT) |
commit | 0e29a6c750f30a089923b6f16d303b9640e0f589 (patch) | |
tree | 6516ecf5323ac693da8d98e3cfd4e5d95ca7bd04 /Swift/QtUI/QtTabbable.cpp | |
parent | 238ee0861cc2f9b0143bce986abbd15ce638c561 (diff) | |
download | swift-0e29a6c750f30a089923b6f16d303b9640e0f589.zip swift-0e29a6c750f30a089923b6f16d303b9640e0f589.tar.bz2 |
Make Ctrl-K to delete to end of the line in chat input.
Change-Id: I04f34018fd99c687a41724d7a32d2b640757359f
Diffstat (limited to 'Swift/QtUI/QtTabbable.cpp')
-rw-r--r-- | Swift/QtUI/QtTabbable.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Swift/QtUI/QtTabbable.cpp b/Swift/QtUI/QtTabbable.cpp index 5659157..124d1b4 100644 --- a/Swift/QtUI/QtTabbable.cpp +++ b/Swift/QtUI/QtTabbable.cpp @@ -13,17 +13,10 @@ #include <Swiften/Base/Platform.h> #include <Swift/QtUI/QtChatTabs.h> +#include <Swift/QtUI/QtUtilities.h> namespace Swift { -namespace { -#ifdef SWIFTEN_PLATFORM_MACOSX -const Qt::KeyboardModifier ctrlHardwareKeyModifier = Qt::MetaModifier; -#else -const Qt::KeyboardModifier ctrlHardwareKeyModifier = Qt::ControlModifier; -#endif -} - QtTabbable::QtTabbable() : QWidget() { shortcuts << new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), window(), SLOT(close())); shortcuts << new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_PageUp), window(), SIGNAL(requestPreviousTab())); @@ -52,9 +45,9 @@ bool QtTabbable::event(QEvent* event) { if (keyEvent) { // According to Qt's focus documentation, one can only override CTRL+TAB via reimplementing QWidget::event(). #ifdef SWIFTEN_PLATFORM_LINUX - if (keyEvent->modifiers() == ctrlHardwareKeyModifier && keyEvent->key() == Qt::Key_Tab && event->type() != QEvent::KeyRelease) { + if (keyEvent->modifiers() == QtUtilities::ctrlHardwareKeyModifier && keyEvent->key() == Qt::Key_Tab && event->type() != QEvent::KeyRelease) { #else - if (keyEvent->modifiers() == ctrlHardwareKeyModifier && keyEvent->key() == Qt::Key_Tab) { + if (keyEvent->modifiers() == QtUtilities::ctrlHardwareKeyModifier && keyEvent->key() == Qt::Key_Tab) { #endif emit requestNextTab(); return true; |