From bb895e3a84ef8b2f3866d688b51c2de43e975dfb Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Mon, 16 Aug 2010 10:38:09 +0200 Subject: [PATCH] Fix up fullscreen action * Use the appropriate KStandardAction for KDEified Quassel * Use proper icon naming ("view-fullscreen") * Make it a toggle action --- src/qtui/mainwin.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 3e978351..00407efa 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -26,6 +26,7 @@ # include # include # include +# include # include # include #endif @@ -340,8 +341,15 @@ void MainWin::setupActions() { 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))); + +#ifdef HAVE_KDE + QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(toggleFullscreen()), this, coll); +#else + QAction *fullScreenAct = new Action(SmallIcon("view-fullscreen"), tr("&Full Screen Mode"), coll, + this, SLOT(toggleFullscreen()), QKeySequence(Qt::Key_F11)); + fullScreenAct->setCheckable(true); +#endif + coll->addAction("ToggleFullscreen", fullScreenAct); // Settings coll->addAction("ConfigureShortcuts", new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll, @@ -1177,18 +1185,10 @@ void MainWin::showShortcutsDlg() { } void MainWin::toggleFullscreen() { - QAction *action = QtUi::actionCollection("General")->action("ToggleFullscreen"); - - if(isFullScreen()) { + if(isFullScreen()) showNormal(); - action->setIcon(SmallIcon("window_fullscreen")); - action->setText(tr("&Fullscreen mode")); - } - else { + else showFullScreen(); - action->setIcon(SmallIcon("window_nofullscreen")); - action->setText(tr("&Normal mode")); - } } /********************************************************************************************************/ -- 2.20.1