Browse Source

qml: rename VLCStyle.theme in VLCStyle.palette

pull/144/head
Pierre Lamot 3 years ago
committed by Steve Lhomme
parent
commit
218e0bb559
  1. 2
      modules/gui/qt/maininterface/qml/BannerSources.qml
  2. 4
      modules/gui/qt/player/qml/TopBar.qml
  3. 16
      modules/gui/qt/style/VLCStyle.qml
  4. 2
      modules/gui/qt/widgets/qml/CSDThemeButton.qml
  5. 6
      modules/gui/qt/widgets/qml/CSDThemeButtonSet.qml

2
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"
}

4
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 {

16
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

2
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

6
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

Loading…
Cancel
Save