diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/usermanual.cpp | 26 | ||||
-rw-r--r-- | qt-ui/usermanual.h | 9 |
2 files changed, 34 insertions, 1 deletions
diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp index 4b509196e..6bbfb79e5 100644 --- a/qt-ui/usermanual.cpp +++ b/qt-ui/usermanual.cpp @@ -3,7 +3,7 @@ #include <QFile> #include "usermanual.h" - +#include "mainwindow.h" #include "helpers.h" SearchBar::SearchBar(QWidget *parent): QWidget(parent) @@ -122,3 +122,27 @@ void UserManual::linkClickedSlot(const QUrl& url) { QDesktopServices::openUrl(url); } + +#ifdef Q_OS_MAC +void UserManual::showEvent(QShowEvent *e) { + filterAction = NULL; + closeAction = NULL; + MainWindow *m = MainWindow::instance(); + Q_FOREACH (QObject *o, m->children()) { + if (o->objectName() == "actionFilterTags") { + filterAction = qobject_cast<QAction*>(o); + filterAction->setShortcut(QKeySequence()); + } else if (o->objectName() == "actionClose") { + closeAction = qobject_cast<QAction*>(o); + closeAction->setShortcut(QKeySequence()); + } + } +} +void UserManual::hideEvent(QHideEvent *e) { + if (closeAction != NULL) + closeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); + if (filterAction != NULL) + filterAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F)); + closeAction = filterAction = NULL; +} +#endif diff --git a/qt-ui/usermanual.h b/qt-ui/usermanual.h index c36226027..5101a3c3b 100644 --- a/qt-ui/usermanual.h +++ b/qt-ui/usermanual.h @@ -26,6 +26,15 @@ class UserManual : public QWidget { public: explicit UserManual(QWidget *parent = 0); + +#ifdef Q_OS_MAC +protected: + void showEvent(QShowEvent *e); + void hideEvent(QHideEvent *e); + QAction *closeAction; + QAction *filterAction; +#endif + private slots: void searchTextChanged(const QString& s); |