introduce fullscreen mode, fixes #803
authorJohannes Huber <johu@gmx.de>
Wed, 4 Aug 2010 23:11:46 +0000 (01:11 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 10 Aug 2010 18:18:16 +0000 (20:18 +0200)
icons/oxygen_kde.qrc
icons/oxygen_kde/16x16/actions/window_fullscreen.png [new file with mode: 0644]
icons/oxygen_kde/16x16/actions/window_nofullscreen.png [new file with mode: 0644]
icons/oxygen_kde/scalable/actions/window_fullscreen.svgz [new file with mode: 0644]
icons/oxygen_kde/scalable/actions/window_nofullscreen.svgz [new file with mode: 0644]
src/qtui/mainwin.cpp
src/qtui/mainwin.h

index 56174c3..724f6e6 100644 (file)
@@ -77,5 +77,7 @@
     <file alias="oxygen/16x16/actions/im-user-offline.png">oxygen_kde/16x16/actions/im-user-offline.png</file>
     <file alias="oxygen/16x16/actions/format-text-underline.png">oxygen_kde/16x16/actions/format-text-underline.png</file>
     <file alias="oxygen/16x16/actions/view-refresh.png">oxygen_kde/16x16/actions/view-refresh.png</file>
     <file alias="oxygen/16x16/actions/im-user-offline.png">oxygen_kde/16x16/actions/im-user-offline.png</file>
     <file alias="oxygen/16x16/actions/format-text-underline.png">oxygen_kde/16x16/actions/format-text-underline.png</file>
     <file alias="oxygen/16x16/actions/view-refresh.png">oxygen_kde/16x16/actions/view-refresh.png</file>
+    <file alias="oxygen/16x16/actions/window_fullscreen.png">oxygen_kde/16x16/actions/window_fullscreen.png</file>
+    <file alias="oxygen/16x16/actions/window_nofullscreen.png">oxygen_kde/16x16/actions/window_nofullscreen.png</file>
   </qresource>
 </RCC>
   </qresource>
 </RCC>
diff --git a/icons/oxygen_kde/16x16/actions/window_fullscreen.png b/icons/oxygen_kde/16x16/actions/window_fullscreen.png
new file mode 100644 (file)
index 0000000..5fa3aa0
Binary files /dev/null and b/icons/oxygen_kde/16x16/actions/window_fullscreen.png differ
diff --git a/icons/oxygen_kde/16x16/actions/window_nofullscreen.png b/icons/oxygen_kde/16x16/actions/window_nofullscreen.png
new file mode 100644 (file)
index 0000000..67a1255
Binary files /dev/null and b/icons/oxygen_kde/16x16/actions/window_nofullscreen.png differ
diff --git a/icons/oxygen_kde/scalable/actions/window_fullscreen.svgz b/icons/oxygen_kde/scalable/actions/window_fullscreen.svgz
new file mode 100644 (file)
index 0000000..3d9784d
Binary files /dev/null and b/icons/oxygen_kde/scalable/actions/window_fullscreen.svgz differ
diff --git a/icons/oxygen_kde/scalable/actions/window_nofullscreen.svgz b/icons/oxygen_kde/scalable/actions/window_nofullscreen.svgz
new file mode 100644 (file)
index 0000000..633685f
Binary files /dev/null and b/icons/oxygen_kde/scalable/actions/window_nofullscreen.svgz differ
index e264c6c..398f0a8 100644 (file)
@@ -184,6 +184,7 @@ void MainWin::init() {
   setupNickWidget();
   setupInputWidget();
   setupChatMonitor();
   setupNickWidget();
   setupInputWidget();
   setupChatMonitor();
+  setupViewMenuTail();
   setupStatusBar();
   setupToolBars();
   setupSystray();
   setupStatusBar();
   setupToolBars();
   setupSystray();
@@ -339,6 +340,8 @@ void MainWin::setupActions() {
 
   coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
                                                 0, 0))->setCheckable(true);
 
   coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
                                                 0, 0))->setCheckable(true);
+  coll->addAction("ToggleFullscreen", new Action(SmallIcon("window_fullscreen"), tr("&Fullscreen mode"), coll,
+                                                  this, SLOT(toggleFullscreen()), QKeySequence(Qt::Key_F11)));
 
   // Settings
   coll->addAction("ConfigureShortcuts", new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
 
   // Settings
   coll->addAction("ConfigureShortcuts", new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
@@ -790,6 +793,11 @@ void MainWin::setupTopicWidget() {
   dock->toggleViewAction()->setText(tr("Show Topic Line"));
 }
 
   dock->toggleViewAction()->setText(tr("Show Topic Line"));
 }
 
+void MainWin::setupViewMenuTail() {
+  _viewMenu->addSeparator();
+  _viewMenu->addAction(QtUi::actionCollection("General")->action("ToggleFullscreen"));
+}
+
 void MainWin::setupTitleSetter() {
   _titleSetter.setModel(Client::bufferModel());
   _titleSetter.setSelectionModel(Client::bufferModel()->standardSelectionModel());
 void MainWin::setupTitleSetter() {
   _titleSetter.setModel(Client::bufferModel());
   _titleSetter.setSelectionModel(Client::bufferModel()->standardSelectionModel());
@@ -1158,6 +1166,21 @@ void MainWin::showShortcutsDlg() {
 #endif
 }
 
 #endif
 }
 
+void MainWin::toggleFullscreen() {
+  QAction *action = QtUi::actionCollection("General")->action("ToggleFullscreen");
+
+  if(isFullScreen()) {
+    showNormal();
+    action->setIcon(SmallIcon("window_fullscreen"));
+    action->setText(tr("&Fullscreen mode"));
+  }
+  else {
+    showFullScreen();
+    action->setIcon(SmallIcon("window_nofullscreen"));
+    action->setText(tr("&Normal mode"));
+  }
+}
+
 /********************************************************************************************************/
 
 bool MainWin::event(QEvent *event) {
 /********************************************************************************************************/
 
 bool MainWin::event(QEvent *event) {
index 1737709..a1fa444 100644 (file)
@@ -120,6 +120,7 @@ class MainWin
     void showNotificationsDlg();
     void showIgnoreList(QString newRule = QString());
     void showShortcutsDlg();
     void showNotificationsDlg();
     void showIgnoreList(QString newRule = QString());
     void showShortcutsDlg();
+    void toggleFullscreen();
 
     void handleCoreConnectionError(const QString &errorMsg);
     void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
 
     void handleCoreConnectionError(const QString &errorMsg);
     void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
@@ -180,6 +181,7 @@ class MainWin
     void setupChatMonitor();
     void setupInputWidget();
     void setupTopicWidget();
     void setupChatMonitor();
     void setupInputWidget();
     void setupTopicWidget();
+    void setupViewMenuTail();
     void setupStatusBar();
     void setupSystray();
     void setupTitleSetter();
     void setupStatusBar();
     void setupSystray();
     void setupTitleSetter();