summaryrefslogtreecommitdiff
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2016-10-19 20:53:40 +0200
committerRoland Knall <rknall@gmail.com>2016-10-23 23:25:49 +0000
commitaf7fc8b7e4979e77d2d072789e98d58a0b175908 (patch)
treedca66e206f77f555e48220578f0ae65959821763 /ui/qt/main_window.cpp
parent3156980aa559186a10e3b8566d41e4a50477d967 (diff)
downloadwireshark-af7fc8b7e4979e77d2d072789e98d58a0b175908.tar.gz
Qt: add fullscreen feature.
The feature activates/deactivates fullscreen mode of Qt UI. A new menu item has been added as well as a shortcut (F11 or Ctrl+Cmd+F) according to browsers common shortcut. Change-Id: I01906b494d0a13ce70d27c00ebbe03e6ec87cbd7 Reviewed-on: https://code.wireshark.org/review/18332 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index fe06ef9e9f..17fed1914e 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -287,6 +287,7 @@ MainWindow::MainWindow(QWidget *parent) :
time_precision_actions_(NULL),
funnel_statistics_(NULL),
freeze_focus_(NULL),
+ was_maximized_(false),
capture_stopping_(false),
capture_filter_valid_(false)
#ifdef HAVE_LIBPCAP
@@ -421,6 +422,13 @@ MainWindow::MainWindow(QWidget *parent) :
main_ui_->menuCapture->setEnabled(false);
#endif
+ // Set OS specific shortcuts for fullscreen mode
+#if defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ main_ui_->actionViewFullScreen->setShortcut(QKeySequence::FullScreen);
+#else
+ main_ui_->actionViewFullScreen->setShortcut(QKeySequence(Qt::Key_F11));
+#endif
+
#if defined(Q_OS_MAC)
#if defined(QT_MACEXTRAS_LIB) && QT_VERSION < QT_VERSION_CHECK(5, 2, 1)
QMacNativeToolBar *ntb = QtMacExtras::setNativeToolBar(main_ui_->mainToolBar);
@@ -2183,6 +2191,11 @@ void MainWindow::changeEvent(QEvent* event)
wsApp->loadLanguage(locale);
}
break;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ case QEvent::WindowStateChange:
+ main_ui_->actionViewFullScreen->setChecked(this->isFullScreen());
+ break;
+#endif
default:
break;
}