Browse Source

Tweaks to layout setting

This tweaks the layout setting into only have two values: auto and tv.
This effectively means that you can now lock the layout into be TV only.
Tobias Hieta 8 years ago
parent
commit
b8b55dbf0b

+ 2 - 1
resources/inputmaps/keyboard.json

@@ -52,9 +52,10 @@
 
     // application shortcuts
     "Ctrl\\+Shift\\+F": "host:fullscreen",
-    "Meta\\+Ctrl\\+F": "host:fullscreen",
+    "Meta\\+Ctrl\\+F": "host:fullscreenCurrentMode",
     "Meta\\+Enter": "host:fullscreen",
     "F11": "host:fullscreen",
+    "Shift+F11": "host:fullscreenCurrentMode",
     "Ctrl\\+Q": "host:close",
     "Ctrl\\+Shift\\+R": "host:reload",
     "Ctrl\\+Shift\\+D": "host:toggleDebug",

+ 1 - 2
resources/settings/settings_description.json

@@ -34,8 +34,7 @@
         "hidden": false,
         "possible_values": [
           [ "auto", "auto" ],
-          [ "tv", "tv" ],
-          [ "desktop", "desktop" ]
+          [ "tv", "tv" ]
         ]
       },
       {

+ 1 - 1
src/settings/SettingsComponent.cpp

@@ -754,7 +754,7 @@ void SettingsComponent::setCommandLineValues(const QStringList& values)
     else if (value == "windowed")
       setValue(SETTINGS_SECTION_MAIN, "fullscreen", false);
     else if (value == "desktop")
-      setValue(SETTINGS_SECTION_MAIN, "layout", "desktop");
+      setValue(SETTINGS_SECTION_MAIN, "layout", "auto");
     else if (value == "tv")
       setValue(SETTINGS_SECTION_MAIN, "layout", "tv");
     else if (value == "auto-layout")

+ 1 - 0
src/ui/KonvergoWindow.cpp

@@ -46,6 +46,7 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) :
   InputComponent::Get().registerHostCommand("reload", this, "reloadWeb");
   InputComponent::Get().registerHostCommand("fullscreen", this, "toggleFullscreen");
   InputComponent::Get().registerHostCommand("minimize", this, "minimizeWindow");
+  InputComponent::Get().registerHostCommand("fullscreenCurrentMode", this, "toggleFullscreenNoSwitch");
 
 #ifdef TARGET_RPI
   // On RPI, we use dispmanx layering - the video is on a layer below Konvergo,

+ 8 - 3
src/ui/KonvergoWindow.h

@@ -71,15 +71,20 @@ public:
 
   Q_SLOT void toggleDebug();
 
-  Q_SLOT void toggleFullscreen()
+  Q_SLOT void toggleFullscreen(bool noSwitchMode = false)
   {
-    if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "layout").toString() == "auto" &&
-        m_webDesktopMode && isFullScreen())
+    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 toggleFullscreenNoSwitch() { toggleFullscreen(true); }
+
   Q_SLOT void toggleAlwaysOnTop()
   {
     setAlwaysOnTop(!isAlwaysOnTop());

+ 1 - 1
src/ui/webview.qml

@@ -81,7 +81,7 @@ KonvergoWindow
         return "Ctrl+Meta+F"
       return "F11"
     }
-    onTriggered: mainWindow.toggleFullscreen()
+    onTriggered: mainWindow.toggleFullscreenNoSwitch()
   }
 
   Action