diff view/ViewManager.cpp @ 588:707d43018f59 toggle

Add a new feature to allow users to toggle between minimal and full modes. This is done by hiding/showing the pane stack, menu actions, and toolbars. Changes in ViewManager (header and source) to emit an activity signal when the view mode is toggled.
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Tue, 21 Jun 2011 22:11:00 +0100
parents 4806715f7a19
children 5fa210337bee
line wrap: on
line diff
--- a/view/ViewManager.cpp	Tue Jun 14 15:27:05 2011 +0100
+++ b/view/ViewManager.cpp	Tue Jun 21 22:11:00 2011 +0100
@@ -48,7 +48,8 @@
     m_illuminateLocalFeatures(true),
     m_showWorkTitle(false),
     m_lightPalette(QApplication::palette()),
-    m_darkPalette(QApplication::palette())
+    m_darkPalette(QApplication::palette()),
+    m_minimalModeEnabled(0)
 {
     QSettings settings;
     settings.beginGroup("MainWindow");
@@ -637,3 +638,19 @@
     return dark;
 }
 
+void
+ViewManager::setMinimalModeEnabled(bool enabled)
+{
+    if (m_minimalModeEnabled != enabled) {
+        m_minimalModeEnabled = enabled;
+        emit minimalModeEnabledChanged();
+        if (enabled) emit activity("Activates minimal mode");
+        else emit activity("Activates full mode");
+    }
+
+    QSettings settings;
+    settings.beginGroup("MainWindow");
+    settings.setValue("minimal-mode-enabled", m_minimalModeEnabled);
+    settings.endGroup();
+}
+