From: Manuel Nickschas Date: Mon, 16 Aug 2010 08:38:09 +0000 (+0200) Subject: Fix up fullscreen action X-Git-Tag: 0.7-rc1~10 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=bb895e3a84ef8b2f3866d688b51c2de43e975dfb;ds=sidebyside Fix up fullscreen action * Use the appropriate KStandardAction for KDEified Quassel * Use proper icon naming ("view-fullscreen") * Make it a toggle action --- 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")); - } } /********************************************************************************************************/