Forráskód Böngészése

KonvergoWindow: move toggleFullscreen() method to .cpp file

Let's avoid non-trivial functions in header files if possible.
Vincent Lang 8 éve
szülő
commit
c26f3bf583
2 módosított fájl, 14 hozzáadás és 11 törlés
  1. 13 0
      src/ui/KonvergoWindow.cpp
  2. 1 11
      src/ui/KonvergoWindow.h

+ 13 - 0
src/ui/KonvergoWindow.cpp

@@ -295,6 +295,19 @@ void KonvergoWindow::setFullScreen(bool enable)
   SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", enable);
 }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+void KonvergoWindow::toggleFullscreen(bool noSwitchMode)
+{
+  bool switchMode = (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "layout").toString() == "auto" && !noSwitchMode);
+
+  if (switchMode && !m_webDesktopMode && isFullScreen())
+    SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "webMode", "desktop");
+  else if (switchMode && m_webDesktopMode && !isFullScreen())
+    SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "webMode", "tv");
+  else
+    setFullScreen(!isFullScreen());
+}
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void KonvergoWindow::setAlwaysOnTop(bool enable)
 {

+ 1 - 11
src/ui/KonvergoWindow.h

@@ -71,17 +71,7 @@ public:
 
   Q_SLOT void toggleDebug();
 
-  Q_SLOT void toggleFullscreen(bool noSwitchMode = false)
-  {
-    bool switchMode = (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "layout").toString() == "auto" && !noSwitchMode);
-
-    if (switchMode && !m_webDesktopMode && isFullScreen())
-      SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "webMode", "desktop");
-    else if (switchMode && m_webDesktopMode && !isFullScreen())
-      SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "webMode", "tv");
-    else
-      setFullScreen(!isFullScreen());
-  }
+  Q_SLOT void toggleFullscreen(bool noSwitchMode = false);
 
   Q_SLOT void toggleFullscreenNoSwitch() { toggleFullscreen(true); }