mirror of
https://github.com/jellyfin/jellyfin-media-player.git
synced 2025-02-19 21:41:19 +00:00
Changes to how we switch modes.
We now have layout option that can be auto, tv or desktop. This locks the mode to that. Auto behaves as 1.2.0 did.
This commit is contained in:
parent
f157ded1f8
commit
a42bd77273
@ -28,6 +28,16 @@
|
||||
[ "tv", "tv" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": "layout",
|
||||
"default": "auto",
|
||||
"hidden": false,
|
||||
"possible_values": [
|
||||
[ "auto", "auto" ],
|
||||
[ "tv", "tv" ],
|
||||
[ "desktop", "desktop" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": "remoteInspector",
|
||||
"default": false,
|
||||
|
@ -98,6 +98,7 @@ int main(int argc, char *argv[])
|
||||
{{"a", "from-auto-update"}, "When invoked from auto-update"},
|
||||
{"desktop", "Start in desktop mode"},
|
||||
{"tv", "Start in TV mode"},
|
||||
{"auto-layout", "Use auto-layout mode"},
|
||||
{"windowed", "Start in windowed mode"},
|
||||
{"fullscreen", "Start in fullscreen"},
|
||||
{"terminal", "Log to terminal"}});
|
||||
|
@ -15,14 +15,14 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void detectOpenGLEarly()
|
||||
{
|
||||
// Request OpenGL 4.1 if possible on OSX, otherwise it defaults to 2.0
|
||||
// This needs to be done before we create the QGuiApplication
|
||||
//
|
||||
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(2);
|
||||
format.setProfile(QSurfaceFormat::CoreProfile);
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
// Request OpenGL 4.1 if possible on OSX, otherwise it defaults to 2.0
|
||||
// This needs to be done before we create the QGuiApplication
|
||||
//
|
||||
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(2);
|
||||
format.setProfile(QSurfaceFormat::CoreProfile);
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -754,9 +754,15 @@ void SettingsComponent::setCommandLineValues(const QStringList& values)
|
||||
else if (value == "windowed")
|
||||
setValue(SETTINGS_SECTION_MAIN, "fullscreen", false);
|
||||
else if (value == "desktop")
|
||||
setValue(SETTINGS_SECTION_MAIN, "webMode", "desktop");
|
||||
setValue(SETTINGS_SECTION_MAIN, "layout", "desktop");
|
||||
else if (value == "tv")
|
||||
setValue(SETTINGS_SECTION_MAIN, "webMode", "tv");
|
||||
setValue(SETTINGS_SECTION_MAIN, "layout", "tv");
|
||||
else if (value == "auto-layout")
|
||||
setValue(SETTINGS_SECTION_MAIN, "layout", "auto");
|
||||
}
|
||||
|
||||
auto layout = value(SETTINGS_SECTION_MAIN, "layout").toString();
|
||||
if (layout != "auto")
|
||||
setValue(SETTINGS_SECTION_MAIN, "webMode", layout);
|
||||
}
|
||||
|
||||
|
@ -316,26 +316,37 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
|
||||
bool oldDesktopMode = m_webDesktopMode;
|
||||
bool newDesktopMode = (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "webMode").toString() == "desktop");
|
||||
|
||||
bool fullscreen = SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool();
|
||||
|
||||
if (oldDesktopMode && !newDesktopMode)
|
||||
fullscreen = true;
|
||||
else if (!oldDesktopMode && newDesktopMode)
|
||||
fullscreen = false;
|
||||
|
||||
PlayerComponent::Get().stop();
|
||||
|
||||
SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fullscreen);
|
||||
QTimer::singleShot(0, [=]
|
||||
if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "layout").toString() != "auto")
|
||||
{
|
||||
m_webDesktopMode = newDesktopMode;
|
||||
emit webDesktopModeChanged();
|
||||
emit webUrlChanged();
|
||||
|
||||
SystemComponent::Get().setCursorVisibility(true);
|
||||
updateWindowState();
|
||||
notifyScale(size());
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bool fullscreen = SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool();
|
||||
|
||||
if (oldDesktopMode && !newDesktopMode)
|
||||
fullscreen = true;
|
||||
else if (!oldDesktopMode && newDesktopMode)
|
||||
fullscreen = false;
|
||||
|
||||
PlayerComponent::Get().stop();
|
||||
|
||||
SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fullscreen);
|
||||
QTimer::singleShot(0, [=]
|
||||
{
|
||||
m_webDesktopMode = newDesktopMode;
|
||||
emit webDesktopModeChanged();
|
||||
emit webUrlChanged();
|
||||
|
||||
SystemComponent::Get().setCursorVisibility(true);
|
||||
updateWindowState();
|
||||
notifyScale(size());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (values.contains("startupurl"))
|
||||
|
@ -73,7 +73,8 @@ public:
|
||||
|
||||
Q_SLOT void toggleFullscreen()
|
||||
{
|
||||
if (!m_webDesktopMode && isFullScreen())
|
||||
if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "layout").toString() == "auto" &&
|
||||
m_webDesktopMode && isFullScreen())
|
||||
SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "webMode", "desktop");
|
||||
else
|
||||
setFullScreen(!isFullScreen());
|
||||
|
@ -26,7 +26,7 @@ KonvergoWindow
|
||||
if (components.system.isMacos) return "Ctrl+Shift+F";
|
||||
return "Shift+F11";
|
||||
}
|
||||
onTriggered: components.settings.setValue("main", "webMode", "tv")
|
||||
onTriggered: mainWindow.toggleFullscreen()
|
||||
}
|
||||
|
||||
Action
|
||||
|
Loading…
x
Reference in New Issue
Block a user