Browse Source

qml: use system palette exposed from C++

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
pull/103/head
Pierre Lamot 7 years ago
committed by Jean-Baptiste Kempf
parent
commit
489b38e60c
  1. 2
      modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
  2. 2
      modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
  3. 2
      modules/gui/qt/player/qml/MiniPlayer.qml
  4. 67
      modules/gui/qt/style/VLCColors.qml
  5. 7
      modules/gui/qt/widgets/qml/GridItem.qml
  6. 2
      modules/gui/qt/widgets/qml/IconToolButton.qml
  7. 2
      modules/gui/qt/widgets/qml/KeyNavigableListView.qml
  8. 4
      modules/gui/qt/widgets/qml/ListItem.qml
  9. 6
      modules/gui/qt/widgets/qml/MenuItemExt.qml

2
modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml

@ -71,7 +71,7 @@ Widgets.KeyNavigableTableView {
text: !rowModel ? "" : (rowModel[model.criteria] || "")
elide: Text.ElideRight
font.pixelSize: VLCStyle.fontSize_normal
color: (model.isPrimary)? VLCStyle.colors.text : VLCStyle.colors.textInactive
color: (model.isPrimary)? VLCStyle.colors.text : VLCStyle.colors.textDisabled
anchors {
fill: parent

2
modules/gui/qt/medialibrary/qml/VideoListDisplay.qml

@ -118,7 +118,7 @@ Widgets.KeyNavigableTableView {
text: !rowModel ? "" : rowModel[model.criteria] || ""
elide: Text.ElideRight
font.pixelSize: VLCStyle.fontSize_normal
color: (model.isPrimary)? VLCStyle.colors.text : VLCStyle.colors.textInactive
color: (model.isPrimary)? VLCStyle.colors.text : VLCStyle.colors.textDisabled
anchors {
fill: parent

2
modules/gui/qt/player/qml/MiniPlayer.qml

@ -118,7 +118,7 @@ Widgets.NavigableFocusScope {
id: artistLabel
text: mainPlaylistController.currentItem.artist
font.pixelSize: VLCStyle.fontSize_normal
color: VLCStyle.colors.lightText
color: VLCStyle.colors.textInactive
}
}
}

67
modules/gui/qt/style/VLCColors.qml

@ -20,10 +20,6 @@ import QtQuick 2.11
Item {
id: colors_id
SystemPalette { id: activePalette; colorGroup: SystemPalette.Active }
SystemPalette { id: inactivePalette; colorGroup: SystemPalette.Inactive }
SystemPalette { id: disabledPalette; colorGroup: SystemPalette.Disabled }
function blendColors( a, b, blend ) {
return Qt.rgba( a.r * blend + b.r * (1. - blend),
a.g * blend + b.g * (1. - blend),
@ -48,35 +44,34 @@ Item {
return "transparent"
}
property color text: activePalette.text;
property color textInactive: disabledPalette.text;
property color text: systemPalette.text;
property color textInactive: systemPalette.textInactive;
property color textDisabled: systemPalette.textDisabled;
property color bg: activePalette.base;
property color bgInactive: inactivePalette.base;
property color bg: systemPalette.base;
property color bgInactive: systemPalette.baseInactive;
//for alternate rows
property color bgAlt: activePalette.alternateBase;
property color bgAltInactive: inactivePalette.alternateBase;
property color bgAlt: systemPalette.alternateBase;
property color bgAltInactive: systemPalette.alternateBaseInactive;
property color bgHover: activePalette.highlight;
property color bgHoverInactive: inactivePalette.highlight;
property color bgHover: systemPalette.highlight;
property color bgHoverInactive: systemPalette.highlightInactive;
property color button: activePalette.button;
property color buttonText: activePalette.buttonText;
property color buttonBorder: blendColors(activePalette.button, activePalette.buttonText, 0.8);
property color button: systemPalette.button;
property color buttonText: systemPalette.buttonText;
property color buttonBorder: blendColors(systemPalette.button, systemPalette.buttonText, 0.8);
property color textActiveSource: "red";
property color banner: activePalette.window;
property color bannerHover: activePalette.highlight;
property color banner: systemPalette.window;
property color bannerHover: systemPalette.highlight;
property color volsliderbg: "#bdbebf"
property color volbelowmid: "#99d299"
property color volabovemid: "#14d214"
property color volhigh: "#ffc70f"
property color volmax: "#f5271d"
property color videosGridInfoLeft: "grey"
property color playerFg: "white"
property color playerFgInactive: "#888888"
property color playerBg: "black"
@ -87,8 +82,6 @@ Item {
property color alert: "red";
property color lightText: "#747474";
property color buffer: "#696969";
property color seekpoint: "red";
@ -117,7 +110,7 @@ Item {
button: "#eff0f1";
buttonText: "#232627";
buttonBorder: blendColors(activePalette.button, activePalette.buttonText, 0.8);
buttonBorder: blendColors(button, buttonText, 0.8);
textActiveSource: "#ff950d";
@ -126,8 +119,6 @@ Item {
accent: "#ff950d";
alert: "#ff0000";
lightText: "#747474";
}
},
State {
@ -136,7 +127,7 @@ Item {
target: colors_id
text: "#eff0f1"
textInactive: "#626c76"
textInactive: "#bdc3c7"
bg: "#232629"
bgInactive: "#232629"
bgAlt: "#31363b"
@ -151,7 +142,6 @@ Item {
bannerHover: "#3daee9"
accent: "#ff950d"
alert: "#ff0000"
lightText: "#8b8b8b";
}
},
State {
@ -159,25 +149,26 @@ Item {
PropertyChanges {
target: colors_id
bg: activePalette.base
bgInactive: inactivePalette.base
bg: systemPalette.base
bgInactive: systemPalette.baseInactive
bgAlt: activePalette.alternateBase
bgAltInactive: inactivePalette.alternateBase
bgAlt: systemPalette.alternateBase
bgAltInactive: systemPalette.alternateBaseInactive
bgHover: activePalette.highlight
bgHoverInactive: inactivePalette.highlight
bgHover: systemPalette.highlight
bgHoverInactive: systemPalette.highlightInactive
text: activePalette.text
textInactive: disabledPalette.text
text: systemPalette.text
textDisabled: systemPalette.textDisabled
textInactive: systemPalette.textInactive
button: activePalette.button
buttonText: activePalette.buttonText
button: systemPalette.button
buttonText: systemPalette.buttonText
buttonBorder: blendColors(button, buttonText, 0.8)
textActiveSource: accent
banner: activePalette.window
bannerHover: activePalette.highlight
banner: systemPalette.window
bannerHover: systemPalette.highlight
}
}
]

7
modules/gui/qt/widgets/qml/GridItem.qml

@ -207,7 +207,8 @@ Item {
font.weight: Font.Light
elide: Text.ElideRight
font.pixelSize: VLCStyle.fontSize_small
color: VLCStyle.colors.lightText
color: VLCStyle.colors.textInactive
}
RowLayout {
@ -221,14 +222,14 @@ Item {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
font.pixelSize: VLCStyle.fontSize_small
color: VLCStyle.colors.videosGridInfoLeft
color: VLCStyle.colors.textInactive
text: infoLeft
}
Text {
visible: root.isNew
Layout.alignment: Qt.AlignRight
font.pixelSize: VLCStyle.fontSize_small
color: root.activeFocus ? VLCStyle.colors.lightText : VLCStyle.colors.accent
color: root.activeFocus ? VLCStyle.colors.text : VLCStyle.colors.accent
text: "NEW"
font.bold: true
}

2
modules/gui/qt/widgets/qml/IconToolButton.qml

@ -30,7 +30,7 @@ ToolButton {
property string iconText: ""
property color color: VLCStyle.colors.buttonText
property color colorDisabled: VLCStyle.colors.lightText
property color colorDisabled: VLCStyle.colors.textInactive
property color colorOverlay: "transparent"
property string textOverlay: ""
property bool borderEnabled: false

2
modules/gui/qt/widgets/qml/KeyNavigableListView.qml

@ -88,7 +88,7 @@ NavigableFocusScope {
Rectangle {
width: parent.width
height: 1
color: VLCStyle.colors.textInactive
color: VLCStyle.colors.textDisabled
}
}
}

4
modules/gui/qt/widgets/qml/ListItem.qml

@ -126,7 +126,7 @@ NavigableFocusScope {
Text {
id: cover_text
anchors.centerIn: parent
color: VLCStyle.colors.lightText
color: VLCStyle.colors.textInactive
font.pixelSize: VLCStyle.fontSize_xsmall
}
}
@ -156,7 +156,7 @@ NavigableFocusScope {
id: line2_text
width: parent.width
elide: Text.ElideRight
color: VLCStyle.colors.lightText
color: VLCStyle.colors.textInactive
font.pixelSize: VLCStyle.fontSize_small
visible: text !== ""
enabled: text !== ""

6
modules/gui/qt/widgets/qml/MenuItemExt.qml

@ -57,7 +57,7 @@ T.MenuItem {
icon: control.icon
text: control.text
font: control.font
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textDisabled
}
indicator: ColorImage {
@ -66,7 +66,7 @@ T.MenuItem {
visible: control.checked
source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" : ""
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textDisabled
defaultColor: "#353637"
}
@ -77,7 +77,7 @@ T.MenuItem {
visible: control.subMenu
mirror: control.mirrored
source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/arrow-indicator.png" : ""
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textDisabled
defaultColor: "#353637"
}

Loading…
Cancel
Save