summaryrefslogtreecommitdiff
path: root/ui/qt/main_window_slots.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_slots.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_slots.cpp')
-rw-r--r--ui/qt/main_window_slots.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 8b0b31df95..388ab77ab4 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1394,6 +1394,9 @@ void MainWindow::applyGlobalCommandLineOptions()
}
}
}
+ if (global_commandline_info.full_screen) {
+ this->showFullScreen();
+ }
}
void MainWindow::redissectPackets()
@@ -3829,6 +3832,21 @@ void MainWindow::on_actionContextFilterFieldReference_triggered()
QDesktopServices::openUrl(dfref_url);
}
+void MainWindow::on_actionViewFullScreen_triggered(bool checked)
+{
+ if (checked) {
+ // Save the state for future restore
+ was_maximized_ = this->isMaximized();
+ this->showFullScreen();
+ } else {
+ // Restore the previous state
+ if (was_maximized_)
+ this->showMaximized();
+ else
+ this->showNormal();
+ }
+}
+
#ifdef _MSC_VER
#pragma warning(pop)
#endif