This patch enables main window full screen mode by menu toggle or pressing
F11.
From 238622061f1ba826fb63f0a2d56e464dae45d6b7 Mon Sep 17 00:00:00 2001
From: Boris Barbulovski <[email protected]>
Date: Tue, 14 Jan 2014 18:28:11 +0100
Subject: [PATCH] Add main window full screen feature.

Signed-off-by: Boris Barbulovski <[email protected]>
---
 qt-ui/mainwindow.cpp | 10 ++++++++++
 qt-ui/mainwindow.h   |  1 +
 qt-ui/mainwindow.ui  | 15 +++++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index acbd130..b367048 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -469,6 +469,16 @@ void MainWindow::on_actionNextDC_triggered()
 	redrawProfile();
 }
 
+void MainWindow::on_actionFullScreen_triggered(bool checked)
+{
+    if (checked) {
+        setWindowState(windowState() | Qt::WindowFullScreen);
+    }
+    else {
+        setWindowState(windowState() & ~Qt::WindowFullScreen);
+    }
+}
+
 void MainWindow::on_actionSelectEvents_triggered()
 {
 	qDebug("actionSelectEvents");
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 7d14fc7..7ef5626 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -87,6 +87,7 @@ private slots:
 	void on_actionViewAll_triggered();
 	void on_actionPreviousDC_triggered();
 	void on_actionNextDC_triggered();
+    void on_actionFullScreen_triggered(bool checked);
 
 	/* other menu actions */
 	void on_actionSelectEvents_triggered();
diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index 3748f59..854c9cd 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -178,6 +178,7 @@
     <addaction name="actionPreviousDC"/>
     <addaction name="actionNextDC"/>
     <addaction name="separator"/>
+    <addaction name="actionFullScreen"/>
    </widget>
    <widget class="QMenu" name="menuFilter">
     <property name="title">
@@ -465,6 +466,20 @@
     <string>Import from Divelogs.de</string>
    </property>
   </action>
+  <action name="actionFullScreen">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>&amp;Full Screen</string>
+   </property>
+   <property name="toolTip">
+    <string>Toggle Full Screen</string>
+   </property>
+   <property name="shortcut">
+    <string>F11</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
-- 
1.8.3.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to