diff --git a/modules/gui/qt/maininterface/qml/BannerSources.qml b/modules/gui/qt/maininterface/qml/BannerSources.qml index 4161d73646..29122f887d 100644 --- a/modules/gui/qt/maininterface/qml/BannerSources.qml +++ b/modules/gui/qt/maininterface/qml/BannerSources.qml @@ -206,7 +206,7 @@ FocusScope { } height: VLCStyle.globalToolbar_height active: root._showCSD - source: VLCStyle.theme.hasCSDImage + source: VLCStyle.palette.hasCSDImage ? "qrc:///widgets/CSDThemeButtonSet.qml" : "qrc:///widgets/CSDWindowButtonSet.qml" } diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml index 9c5b644c19..c31fd1be9d 100644 --- a/modules/gui/qt/player/qml/TopBar.qml +++ b/modules/gui/qt/player/qml/TopBar.qml @@ -356,11 +356,11 @@ FocusScope{ active: root.showCSD enabled: root.showCSD visible: root.showCSD - source: VLCStyle.theme.hasCSDImage + source: VLCStyle.palette.hasCSDImage ? "qrc:///widgets/CSDThemeButtonSet.qml" : "qrc:///widgets/CSDWindowButtonSet.qml" onLoaded: { - if (VLCStyle.theme.hasCSDImage) { + if (VLCStyle.palette.hasCSDImage) { if (item.hasOwnProperty("color")) item.color = Qt.binding(function() { return VLCStyle.colors.topBanner }) } else { diff --git a/modules/gui/qt/style/VLCStyle.qml b/modules/gui/qt/style/VLCStyle.qml index e714b82630..895fcfcf8c 100644 --- a/modules/gui/qt/style/VLCStyle.qml +++ b/modules/gui/qt/style/VLCStyle.qml @@ -35,22 +35,26 @@ QtObject { property alias self: vlc_style - readonly property SystemPalette theme: SystemPalette { + readonly property SystemPalette palette: SystemPalette { + objectName: "themePalette" source: MainCtx.colorScheme.scheme ctx: MainCtx } + readonly property SystemPalette darkPalette: SystemPalette { + objectName: "darkPalette" + source: ColorSchemeModel.Night + ctx: MainCtx + } + readonly property VLCColors colors: VLCColors { - palette: vlc_style.theme + palette: vlc_style.palette } // When trying to force night/dark theme colors for items, // this can be used: readonly property VLCColors nightColors: VLCColors { - palette: SystemPalette { - source: ColorSchemeModel.Night - ctx: MainCtx - } + palette: vlc_style.darkPalette } // Sizes diff --git a/modules/gui/qt/widgets/qml/CSDThemeButton.qml b/modules/gui/qt/widgets/qml/CSDThemeButton.qml index 6dafc935bb..503f112624 100644 --- a/modules/gui/qt/widgets/qml/CSDThemeButton.qml +++ b/modules/gui/qt/widgets/qml/CSDThemeButton.qml @@ -45,7 +45,7 @@ T.AbstractButton { bannerHeight: control.bannerHeight - theme: VLCStyle.theme + theme: VLCStyle.palette windowMaximized: MainCtx.intfMainWindow.visibility === Window.Maximized windowActive: MainCtx.intfMainWindow.active diff --git a/modules/gui/qt/widgets/qml/CSDThemeButtonSet.qml b/modules/gui/qt/widgets/qml/CSDThemeButtonSet.qml index ed060713d9..9faeeb07ef 100644 --- a/modules/gui/qt/widgets/qml/CSDThemeButtonSet.qml +++ b/modules/gui/qt/widgets/qml/CSDThemeButtonSet.qml @@ -28,9 +28,9 @@ Rectangle { readonly property bool hovered: minimizeButton.hovered || maximizeButton.hovered || closeButton.hovered - readonly property int _frameMarginLeft: VLCStyle.theme.csdMetrics ? VLCStyle.theme.csdMetrics.csdFrameMarginLeft : 0 - readonly property int _frameMarginRight: VLCStyle.theme.csdMetrics ? VLCStyle.theme.csdMetrics.csdFrameMarginRight : 0 - readonly property int _interNavButtonSpacing: VLCStyle.theme.csdMetrics ? VLCStyle.theme.csdMetrics.interNavButtonSpacing : 0 + readonly property int _frameMarginLeft: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.csdFrameMarginLeft : 0 + readonly property int _frameMarginRight: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.csdFrameMarginRight : 0 + readonly property int _interNavButtonSpacing: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.interNavButtonSpacing : 0 implicitWidth: layout.implicitWidth + _frameMarginLeft + _frameMarginRight implicitHeight: layout.implicitHeight