diff --git a/modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml b/modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml index 03dc77c8d470cd7c299c0aaac2183ece2bbd3e92..2bc9e4df9341e8a0b19417240529f2afa196556e 100644 --- a/modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml +++ b/modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml @@ -67,7 +67,7 @@ ModalDialog { contentItem: Text { focus: false font.pixelSize: VLCStyle.fontSize_normal - color: VLCStyle.colors.text + color: root.colorContext.fg.primary wrapMode: Text.WordWrap text: root.text } @@ -77,8 +77,14 @@ ModalDialog { id: questionButtons implicitHeight: VLCStyle.icon_normal + readonly property ColorContext colorContext: ColorContext { + id: footerTheme + palette: root.colorContext.palette + colorSet: ColorContext.Window + } + Rectangle { - color: VLCStyle.colors.topBanner + color: footerTheme.bg.primary anchors.fill: parent anchors.leftMargin: VLCStyle.margin_xxsmall anchors.rightMargin: VLCStyle.margin_xxsmall diff --git a/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml b/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml index 70dbaeae8facab9df50abb390494959d7fa1c658..bbb97b614fc68879e0f2a1c7096a344e0addc1e8 100644 --- a/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml +++ b/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml @@ -152,8 +152,14 @@ Item { height: contentItem.height z: 10 + ColorContext { + id: errorMsgTheme + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + component: Rectangle { - color: VLCStyle.colors.alert + color: errorMsgTheme.bg.negative height: messageText.implicitHeight + VLCStyle.margin_normal radius: VLCStyle.fontHeight_normal / 2 @@ -163,12 +169,13 @@ Item { RowLayout { id: layout - spacing: VLCStyle.margin_xxsmall + spacing: VLCStyle.margin_xsmall anchors.top: parent.top anchors.bottom: parent.bottom Widgets.IconLabel { text: VLCIcons.info + color: errorMsgTheme.fg.negative Layout.leftMargin: VLCStyle.margin_xxsmall } @@ -185,7 +192,7 @@ Item { wrapMode: Text.WrapAnywhere font.pixelSize: VLCStyle.fontSize_normal font.bold: true - color: "white" + color: errorMsgTheme.fg.negative } Widgets.TextToolButton { @@ -193,20 +200,14 @@ Item { text: I18n.qtr("Show Details") + colorContext.colorSet: ColorContext.ButtonAccent + onClicked: { hideErrorPopupTimer.stop() errorPopup.state = "hidden" DialogErrorModel.resetRepeatedMessageCount() DialogsProvider.messagesDialog(1) } - - background: Widgets.AnimatedBackground { - active: visualFocus - - radius: VLCStyle.dp(4, VLCStyle.scale) - backgroundColor: detailsBtn.hovered ? VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0.5) - : VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0.3) - } } Widgets.IconToolButton { @@ -216,19 +217,14 @@ Item { text: I18n.qtr("Dismiss") Layout.rightMargin: VLCStyle.margin_xxsmall + color: closeBtn.colorContext.fg.negative + backgroundColor: closeBtn.colorContext.bg.negative + onClicked: { hideErrorPopupTimer.stop() errorPopup.state = "hidden" DialogErrorModel.resetRepeatedMessageCount() } - - background: Widgets.AnimatedBackground { - active: visualFocus - - radius: VLCStyle.dp(4, VLCStyle.scale) - backgroundColor: closeBtn.hovered ? VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0.5) - : VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0.0) - } } } } @@ -259,9 +255,15 @@ Item { contentItem: GridLayout { columns: 2 + readonly property ColorContext colorContext: ColorContext { + id: loginContentTheme + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + Text { text: I18n.qtr("User") - color: VLCStyle.colors.text + color: loginContentTheme.fg.primary font.pixelSize: VLCStyle.fontSize_normal } @@ -280,7 +282,7 @@ Item { Text { text: I18n.qtr("Password") - color: VLCStyle.colors.text + color: loginContentTheme.fg.primary font.pixelSize: VLCStyle.fontSize_normal } @@ -299,7 +301,7 @@ Item { Text { text: I18n.qtr("Save password") - color: VLCStyle.colors.text + color: loginContentTheme.fg.primary font.pixelSize: VLCStyle.fontSize_normal } CheckBox { @@ -316,8 +318,14 @@ Item { id: loginButtons implicitHeight: VLCStyle.icon_normal + readonly property ColorContext colorContext: ColorContext { + id: loginFooterTheme + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + Rectangle { - color: VLCStyle.colors.topBanner + color: loginFooterTheme.bg.primary anchors.fill: parent RowLayout { @@ -393,7 +401,7 @@ Item { id: content focus: false font.pixelSize: VLCStyle.fontSize_normal - color: VLCStyle.colors.text + color: questionDialog.colorContext.fg.primary wrapMode: Text.WordWrap } @@ -402,8 +410,13 @@ Item { id: questionButtons implicitHeight: VLCStyle.icon_normal + readonly property ColorContext colorContext: ColorContext { + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + Rectangle { - color: VLCStyle.colors.topBanner + color: questionDialog.colorContext.bg.primary anchors.fill: parent anchors.leftMargin: VLCStyle.margin_xxsmall anchors.rightMargin: VLCStyle.margin_xxsmall diff --git a/modules/gui/qt/dialogs/dialogs/qml/ModalDialog.qml b/modules/gui/qt/dialogs/dialogs/qml/ModalDialog.qml index dab2c842072c45b82df4e8d8c9e91fc58db295a4..25b0c3dd9f4358294fca8c915c4c929bb18984b8 100644 --- a/modules/gui/qt/dialogs/dialogs/qml/ModalDialog.qml +++ b/modules/gui/qt/dialogs/dialogs/qml/ModalDialog.qml @@ -21,6 +21,8 @@ import QtQuick.Templates 2.4 as T import QtQuick.Layouts 1.11 import QtGraphicalEffects 1.0 +import org.videolan.vlc 0.1 + import "qrc:///widgets/" as Widgets import "qrc:///style/" @@ -42,6 +44,12 @@ Dialog { + (footer && footer.visible ? footer.implicitHeight + spacing : 0) + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) + readonly property ColorContext colorContext: ColorContext { + id: theme + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + Overlay.modal: GaussianBlur { source: ShaderEffectSource { sourceItem: control.rootWindow @@ -52,7 +60,7 @@ Dialog { } background: Rectangle { - color: VLCStyle.colors.topBanner + color: theme.bg.primary } //FIXME use the right xxxLabel class @@ -61,13 +69,13 @@ Dialog { visible: control.title elide: Label.ElideRight font.bold: true - color: VLCStyle.colors.text + color: theme.fg.primary padding: 6 background: Rectangle { x: 1; y: 1 width: parent.width - 2 height: parent.height - 1 - color: VLCStyle.colors.topBanner + color: theme.bg.primary } } diff --git a/modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml b/modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml index d061fe6625babfa6d4d38d5eca06d11e5ae1a436..62612fb5eb4a030e24852fcfb3e5d221ff300a81 100644 --- a/modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml +++ b/modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml @@ -21,6 +21,7 @@ import QtQuick.Window 2.11 import QtQuick.Layouts 1.11 import QtQuick.Controls 2.4 +import org.videolan.vlc 0.1 import "qrc:///widgets/" as Widgets import "qrc:///style/" @@ -35,7 +36,7 @@ Window { width: VLCStyle.appWidth * 0.75 height: VLCStyle.appHeight * 0.85 - color: VLCStyle.colors.bg + color: theme.bg.primary property alias contentComponent: loader.sourceComponent property alias standardButtons: buttonBox.standardButtons @@ -64,6 +65,12 @@ Window { anchors.fill: parent anchors.margins: VLCStyle.margin_small + + readonly property ColorContext colorContext: ColorContext { + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + Loader { id: loader Layout.fillHeight: true @@ -92,18 +99,20 @@ Window { onDiscarded: root.discarded() onReset: root.reset() + delegate: Widgets.TextToolButton { id: button + colorContext.palette: VLCStyle.palette + // NOTE: We specify a dedicated background with borders to improve clarity. background: Widgets.AnimatedBackground { - backgroundColor: (button.hovered) ? VLCStyle.colors.buttonHover - : VLCStyle.colors.bgAlt - + animate: button.colorContext.initialized + backgroundColor: button.colorContext.bg.primary + activeBorderColor: button.colorContext.visualFocus border.width: VLCStyle.border - border.color: (button.visualFocus) ? activeBorderColor - : VLCStyle.colors.buttonBorder + border.color: button.colorContext.border } } } diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml index f102654120aa70e67f8d7df952db8b0b78d0f348..a6099fb507475826fcfa0a40136bc2de6013f637 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml @@ -43,6 +43,11 @@ Control { ListView.delayRemove: dragActive + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + } + MouseArea { id: mouseArea @@ -126,7 +131,7 @@ Control { implicitHeight: VLCStyle.icon_medium visible: dropArea.containsDrag - color: VLCStyle.colors.accent + color: theme.accent } background: Rectangle { @@ -135,7 +140,7 @@ Control { color: "transparent" border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: containsMouse && !pressed ? VLCStyle.colors.buttonBorder + border.color: containsMouse && !pressed ? theme.border : "transparent" } diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml index bd377e94383d11f27ef323f0bdbb29b8ccd4578a..2c296346a93317cadac22e14f8ad45fc8ebfd1f1 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml @@ -92,6 +92,11 @@ ListView { drag.source.dndView.model.remove(drag.source.DelegateModel.itemsIndex) } } + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } MouseEventFilter { target: playerBtnDND @@ -133,7 +138,7 @@ ListView { implicitWidth: VLCStyle.dp(2, VLCStyle.scale) visible: dropVisible - color: VLCStyle.colors.accent + color: theme.accent } DropArea { diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDummyButton.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDummyButton.qml index 70349f5b94dc63c7e0c5b107687c3933e53a75a8..68fa306059c2430debaf779fc527f02b816d33d9 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/EditorDummyButton.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDummyButton.qml @@ -23,8 +23,6 @@ import org.videolan.vlc 0.1 import "qrc:///style/" Label { - color: VLCStyle.colors.buttonText - font.pixelSize: VLCStyle.icon_medium font.family: VLCIcons.fontFamily diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml index b7349cffa59a17d3f96d8bb780e667cb47e358f1..9377ae416afb7d668aa397eb00b391fa62e08d2f 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml @@ -26,9 +26,8 @@ import "qrc:///style/" import "qrc:///widgets/" as Widgets import "qrc:///util/" as Util -Rectangle{ +Item { id: root - color: VLCStyle.colors.bg property bool dragActive: !!_viewThatContainsDrag || buttonDragItem.Drag.active @@ -39,6 +38,11 @@ Rectangle{ signal dragStarted(int controlId) signal dragStopped(int controlId) + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + ColumnLayout{ anchors.fill: parent spacing: 0 @@ -47,7 +51,9 @@ Rectangle{ id: bar z: 1 - background: null + background: Rectangle { + color: theme.bg.primary + } readonly property int currentIdentifier: currentItem.identifier @@ -84,10 +90,10 @@ Rectangle{ Layout.preferredHeight: VLCStyle.maxControlbarControlHeight * 1.5 Layout.fillWidth: true - color: "transparent" + color: theme.bg.primary - border.color: VLCStyle.colors.accent - border.width: VLCStyle.dp(1, VLCStyle.scale) + border.color: theme.border + border.width: VLCStyle.border TextMetrics { id: leftMetric @@ -192,9 +198,7 @@ Rectangle{ readonly property int count: !!item ? item.count : 0 - sourceComponent: Rectangle { - color: VLCStyle.colors.bgAlt - + sourceComponent: Item { property alias count: dndView.count Connections { @@ -239,7 +243,7 @@ Rectangle{ text: repeater.getMetric(index).text verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.fontSize_xxlarge - color: VLCStyle.colors.menuCaption + color: theme.fg.secondary horizontalAlignment: Text.AlignHCenter visible: (count === 0) } @@ -256,7 +260,9 @@ Rectangle{ Layout.fillWidth: true Layout.topMargin: VLCStyle.margin_xxsmall - color: VLCStyle.colors.bgAlt + color: buttonList.colorContext.bg.primary + border.color: theme.border + border.width: VLCStyle.border ColumnLayout { anchors.fill: parent @@ -264,6 +270,7 @@ Rectangle{ Widgets.MenuCaption { Layout.margins: VLCStyle.margin_xxsmall text: I18n.qtr("Drag items below to add them above: ") + color: buttonList.colorContext.fg.primary } ToolbarEditorButtonList { @@ -286,7 +293,7 @@ Rectangle{ id: buttonDragItem visible: Drag.active - color: VLCStyle.colors.buttonText + color: theme.fg.primary opacity: 0.75 x: -1 diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml index 4a0e5c284821b5662eafd27db7bb4a30b8dc18ea..670b6d10f16bdebcec7c1c3d82c78fa2372529af 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml @@ -46,6 +46,12 @@ GridView { signal dragStarted(int id) signal dragStopped(int id) + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + MouseEventFilter { target: root } @@ -81,9 +87,9 @@ GridView { visible: false opacity: 0.8 - color: VLCStyle.colors.bg + color: theme.bg.primary - border.color: VLCStyle.colors.menuCaption + border.color: theme.border border.width: VLCStyle.dp(2, VLCStyle.scale) Text { @@ -96,7 +102,7 @@ GridView { font.pointSize: VLCStyle.fontHeight_xxxlarge font.family: VLCIcons.fontFamily - color: VLCStyle.colors.menuCaption + color: theme.fg.secondary } MouseArea { @@ -167,7 +173,7 @@ GridView { color: "transparent" border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: containsMouse && !buttonDragItem.Drag.active ? VLCStyle.colors.buttonBorder + border.color: containsMouse && !buttonDragItem.Drag.active ? theme.border : "transparent" ColumnLayout { @@ -179,6 +185,7 @@ GridView { Layout.preferredHeight: VLCStyle.icon_medium Layout.alignment: Qt.AlignHCenter + color: theme.fg.primary text: PlayerControlbarControls.controlList[model.index].label } @@ -186,6 +193,7 @@ GridView { Layout.fillWidth: true Layout.fillHeight: true + color: theme.fg.secondary elide: Text.ElideNone text: PlayerControlbarControls.controlList[model.index].text wrapMode: Text.WordWrap diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml index 2486f2610752a0b87d12ffae394a2cf4106b3bac..60ed32ee57fc269d02f4c8ad1b9997a0a0180424 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml @@ -72,7 +72,7 @@ WindowDialog { RowLayout { Widgets.MenuLabel { Layout.fillWidth: true - + color: root.colorContext.fg.primary text: I18n.qtr("Select profile:") } diff --git a/modules/gui/qt/maininterface/qml/BannerSources.qml b/modules/gui/qt/maininterface/qml/BannerSources.qml index 29122f887dfccc5b2deec78a7c8197b8ed612137..0dc01ce269951745a15a0047f1ce1a51bb3eea84 100644 --- a/modules/gui/qt/maininterface/qml/BannerSources.qml +++ b/modules/gui/qt/maininterface/qml/BannerSources.qml @@ -65,6 +65,11 @@ FocusScope { searchBox.state = "expanded" } + ColorContext { + id: theme + colorSet: ColorContext.Window + } + BindingCompat { property: "searchPattern" value: searchBox.searchPattern @@ -80,7 +85,8 @@ FocusScope { } Widgets.AcrylicBackground { - alternativeColor: VLCStyle.colors.topBanner + tintColor: theme.bg.primary + alternativeColor: theme.bg.secondary anchors.fill: parent } @@ -153,7 +159,6 @@ FocusScope { text: I18n.qtr("Previous") height: VLCStyle.bannerButton_height width: VLCStyle.bannerButton_width - colorDisabled: VLCStyle.colors.textDisabled onClicked: History.previous() enabled: !History.previousEmpty @@ -163,7 +168,7 @@ FocusScope { } Widgets.BannerCone { - + color: theme.accent } } @@ -187,7 +192,6 @@ FocusScope { delegate: Widgets.BannerTabButton { iconTxt: model.icon - color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0) showText: globalToolbar.colapseTabButtons selected: model.index === root.selectedIndex onClicked: root.itemClicked(model.index) @@ -235,7 +239,7 @@ FocusScope { background: Rectangle { id: localToolbarBg - color: VLCStyle.colors.lowerBanner + color: theme.bg.secondary Rectangle { anchors.left : parent.left anchors.right: parent.right @@ -243,7 +247,7 @@ FocusScope { height: VLCStyle.border - color: VLCStyle.colors.border + color: theme.border } } diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml index e3245dd8d557d403c8cb4110f7362483e54f6da9..ce1f382aabb52c879fd530f378c50acc514c7ba2 100644 --- a/modules/gui/qt/maininterface/qml/MainDisplay.qml +++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml @@ -213,6 +213,12 @@ FocusScope { onContentModelChanged: modelSortSettingHandler.set(sourcesBanner.contentModel, History.viewPath) } + ColorContext { + id: theme + palette: VLCStyle.palette + colorSet: ColorContext.View + } + FocusScope { focus: true id: medialibId @@ -224,14 +230,20 @@ FocusScope { id: parentRectangle anchors.fill: parent - color: VLCStyle.colors.bg + color: theme.bg.primary layer.enabled: (((GraphicsInfo.shaderType === GraphicsInfo.GLSL)) && ((GraphicsInfo.shaderSourceType & GraphicsInfo.ShaderSourceString))) && (miniPlayer.visible || (loaderProgress.active && loaderProgress.item.visible)) layer.effect: Widgets.FrostedGlassEffect { - tint: VLCStyle.colors.lowerBanner + ColorContext { + id: frostedTheme + palette: VLCStyle.palette + colorSet: ColorContext.Window + } + + tint: frostedTheme.bg.secondary effectRect: { var _height = 0 @@ -379,7 +391,7 @@ FocusScope { anchors.left: parent.left width: VLCStyle.border - color: VLCStyle.colors.border + color: theme.separator } PL.PlaylistListView { diff --git a/modules/gui/qt/maininterface/qml/MainInterface.qml b/modules/gui/qt/maininterface/qml/MainInterface.qml index 03209724e7a9384167f3d88b52c2f35b75831886..dbe5a0ad22b3d4f478430570d17403ea56c6cc2d 100644 --- a/modules/gui/qt/maininterface/qml/MainInterface.qml +++ b/modules/gui/qt/maininterface/qml/MainInterface.qml @@ -51,17 +51,23 @@ Item { Window.onWindowChanged: { if (Window.window && !Qt.colorEqual(Window.window.color, "transparent")) { - Window.window.color = Qt.binding(function() { return VLCStyle.colors.bg }) + Window.window.color = Qt.binding(function() { return theme.bg.primary }) } } + ColorContext { + id: theme + palette: VLCStyle.palette + colorSet: ColorContext.View + } + Widgets.ToolTipExt { id: attachedToolTip parent: null z: 99 - colors: parent && parent.colors ? parent.colors - : VLCStyle.colors + colorContext.palette: parent && parent.colorContext ? parent.colorContext.palette + : VLCStyle.palette Component.onCompleted: { MainCtx.setAttachedToolTip(this) diff --git a/modules/gui/qt/maininterface/qml/MainTableView.qml b/modules/gui/qt/maininterface/qml/MainTableView.qml index 43ff81d62c44ac09a9694b4d802f5d92bc22f580..3a254a30c7f21bd320a6faf9dafc5ddb6e379761 100644 --- a/modules/gui/qt/maininterface/qml/MainTableView.qml +++ b/modules/gui/qt/maininterface/qml/MainTableView.qml @@ -26,7 +26,5 @@ Widgets.KeyNavigableTableView { displayMarginEnd: g_mainDisplay.displayMargin - backgroundColor: VLCStyle.colors.bg - enableEndFade: (g_mainDisplay.hasMiniPlayer === false) } diff --git a/modules/gui/qt/maininterface/qml/NoMedialibHome.qml b/modules/gui/qt/maininterface/qml/NoMedialibHome.qml index 96e5a4d41ed4cdc73e16898445a6fa0b27b3457b..f0d3b37f4381d86002600b61780e9a9daefa877b 100644 --- a/modules/gui/qt/maininterface/qml/NoMedialibHome.qml +++ b/modules/gui/qt/maininterface/qml/NoMedialibHome.qml @@ -24,6 +24,11 @@ import "qrc:///widgets/" as Widgets FocusScope { + ColorContext { + id: theme + colorSet: ColorContext.View + } + Column { anchors.centerIn: parent @@ -31,7 +36,7 @@ FocusScope { Widgets.IconLabel { text: VLCIcons.dropzone - color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.text, 0.2) + color: theme.fg.secondary anchors.horizontalCenter: parent.horizontalCenter font.pixelSize: VLCStyle.dp(100, VLCStyle.scale) } @@ -39,6 +44,7 @@ FocusScope { Widgets.MenuLabel { anchors .horizontalCenter: parent.horizontalCenter text: I18n.qtr("Drop some content here") + color: theme.fg.secondary } Widgets.ActionButtonPrimary { @@ -49,5 +55,4 @@ FocusScope { onClicked: DialogsProvider.simpleOpenDialog() } } - } diff --git a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml index c90b23a16f9344ca2c1b9937c29c25079a2478d8..eeef80d0d31d4f77a00cec12bd08a5c092fc32d8 100644 --- a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml +++ b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml @@ -42,6 +42,13 @@ FocusScope { playActionBtn.forceActiveFocus(reason); } + readonly property ColorContext colorContext: ColorContext { + id: theme + ////force the dark theme in the header + palette: VLCStyle.darkPalette + colorSet: ColorContext.View + } + Image { id: background @@ -109,7 +116,7 @@ FocusScope { radius: VLCStyle.cover_normal color: "transparent" border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: VLCStyle.colors.roundPlayCoverBorder + border.color: theme.border } } @@ -127,7 +134,9 @@ FocusScope { Layout.fillWidth: true text: artist.name || I18n.qtr("No artist") - color: "white" + color: theme.fg.primary + + Layout.maximumWidth: parent.width } Widgets.MenuCaption { @@ -136,8 +145,7 @@ FocusScope { Layout.topMargin: VLCStyle.margin_xxxsmall text: I18n.qtr("%1 Songs").arg(artist.nb_tracks) - color: "white" - opacity: .6 + color: theme.fg.secondary } Widgets.NavigableRow { @@ -156,8 +164,10 @@ FocusScope { iconTxt: VLCIcons.play_outline text: I18n.qtr("Play all") focus: true - // NOTE: In overlay, the focus rectangle is always white. - colorFocus: VLCStyle.colors.white + + //we probably want to keep this button like the other action buttons + colorContext.palette: VLCStyle.palette + onClicked: MediaLib.addAndPlay( artist.id ) } diff --git a/modules/gui/qt/medialibrary/qml/EmptyLabel.qml b/modules/gui/qt/medialibrary/qml/EmptyLabel.qml index bfeb62fb42a5e44f6887fdbee31f100d19b3a24d..5fb5b2d1086ea971d73a1f0284e06b57bc33fcb6 100644 --- a/modules/gui/qt/medialibrary/qml/EmptyLabel.qml +++ b/modules/gui/qt/medialibrary/qml/EmptyLabel.qml @@ -43,6 +43,11 @@ FocusScope { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + Column { id: column @@ -95,7 +100,7 @@ FocusScope { wrapMode: Text.WordWrap - color: VLCStyle.colors.text + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_xxlarge font.weight: Font.DemiBold diff --git a/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml b/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml index 293f82b19ee39ec121e24c739d4d9f4b15390614..95e89b979a9dd6e08e6bb26e2ad954d1230bd275 100644 --- a/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml @@ -60,5 +60,6 @@ VideoAll { bottomPadding: VLCStyle.margin_normal text: root.title + color: root.colorContext.fg.primary } } diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml index 54c34564787b7b96d448900d497d61df9ba21e12..576a24b4ed1772fd4db31dc880b6bb640d75d319 100644 --- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml +++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml @@ -271,7 +271,6 @@ FocusScope { model: albumModelId selectionDelegateModel: selectionModel - headerColor: VLCStyle.colors.bg onActionForSelection: _actionAtIndex(selection[0]); Navigation.parentItem: root section.property: "title_first_symbol" diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml index 5b14e49a47f435d861ca6c94a4aedf6b798c7f54..4f04296b735648f4446958b1ac67d4a82449924b 100644 --- a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml +++ b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml @@ -71,9 +71,14 @@ FocusScope { return I18n.qtr("%1 tracks").arg(count); } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + Rectangle { anchors.fill: parent - color: VLCStyle.colors.expandDelegate + color: theme.bg.secondary Rectangle { anchors { @@ -81,7 +86,7 @@ FocusScope { left: parent.left right: parent.right } - color: VLCStyle.colors.border + color: theme.border height: VLCStyle.expandDelegate_border } @@ -91,7 +96,7 @@ FocusScope { left: parent.left right: parent.right } - color: VLCStyle.colors.border + color: theme.border height: VLCStyle.expandDelegate_border } } @@ -346,7 +351,7 @@ FocusScope { MusicTrackListDisplay { id: tracks - backgroundColor: VLCStyle.colors.expandDelegate + headerColor: theme.bg.secondary readonly property int _nbCols: VLCStyle.gridColumnsForWidth(tracks.availableRowWidth) @@ -357,7 +362,7 @@ FocusScope { Widgets.ListLabel { text: !!rowModel && !!rowModel.track_number ? rowModel.track_number : "" - color: foregroundColor + color: theme.fg.primary font.weight: Font.Normal Layout.fillHeight: true @@ -367,7 +372,7 @@ FocusScope { Widgets.ListLabel { text: !!rowModel && !!rowModel.title ? rowModel.title : "" - color: foregroundColor + color: theme.fg.primary Layout.fillHeight: true Layout.fillWidth: true @@ -379,10 +384,12 @@ FocusScope { Widgets.CaptionLabel { text: "#" width: VLCStyle.margin_large + color: theme.fg.secondary } Widgets.CaptionLabel { text: I18n.qtr("Title") + color: theme.fg.secondary } } @@ -403,7 +410,6 @@ FocusScope { Layout.fillHeight: true rowHeight: VLCStyle.tableRow_height - headerColor: VLCStyle.colors.expandDelegate parentId: Helpers.get(root.model, "id") onParentIdChanged: { diff --git a/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml b/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml index 4e38cbb08d709410b2b5ff66d7b3999e24a85609..e662bef31bff1199072f04432afaa2a2effa00c4 100644 --- a/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml +++ b/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml @@ -218,7 +218,6 @@ FocusScope { selectionDelegateModel: selectionModel model: artistModel focus: true - headerColor: VLCStyle.colors.bg dragItem: artistsDragItem rowHeight: VLCStyle.tableCoverRow_height headerTopPadding: VLCStyle.margin_normal diff --git a/modules/gui/qt/medialibrary/qml/MusicArtist.qml b/modules/gui/qt/medialibrary/qml/MusicArtist.qml index 1fc080254089428df129975fe60032051c1e313e..cec0dbcae021540310be9d84b0c8c63967a4c0f2 100644 --- a/modules/gui/qt/medialibrary/qml/MusicArtist.qml +++ b/modules/gui/qt/medialibrary/qml/MusicArtist.qml @@ -110,6 +110,7 @@ FocusScope { id: albumsText text: I18n.qtr("Albums") + color: theme.fg.primary leftPadding: VLCStyle.margin_xlarge topPadding: VLCStyle.margin_normal bottomPadding: VLCStyle.margin_xsmall @@ -130,8 +131,6 @@ FocusScope { orientation: ListView.Horizontal spacing: VLCStyle.column_spacing - backgroundColor: VLCStyle.colors.bg - Navigation.parentItem: root Navigation.upAction: function() { @@ -187,6 +186,7 @@ FocusScope { id: tracksText text: I18n.qtr("Tracks") + color: theme.fg.primary leftPadding: VLCStyle.margin_xlarge topPadding: VLCStyle.margin_large } @@ -254,6 +254,11 @@ FocusScope { tableView_id.currentIndex = 0; } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + MLAlbumModel { id: albumModel @@ -399,7 +404,6 @@ FocusScope { clip: true // content may overflow if not enough space is provided model: trackModel selectionDelegateModel: trackSelectionModel - headerColor: VLCStyle.colors.bg onActionForSelection: { MediaLib.addAndPlay( model.getIdsForIndexes( selection ) ) } diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml index eb09b4abd2a11da0cd974429469797352f53fd7e..3b96ded766b7a16e9a4605f0be9c40a1874ff78f 100644 --- a/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml +++ b/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml @@ -55,17 +55,21 @@ T.Control { // Childs + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + + focused: root.activeFocus + hovered: contentItem.containsMouse + enabled: root.enabled + } + background: Widgets.AnimatedBackground { active: visualFocus - backgroundColor: { - if (isCurrent) - return VLCStyle.colors.gridSelect; - else if (_isHover) - return VLCStyle.colors.listHover; - else - return VLCStyle.colors.setColorAlpha(VLCStyle.colors.listHover, 0); - } + animate: theme.initialized + backgroundColor: root.isCurrent ? theme.bg.highlight : theme.bg.primary + activeBorderColor: theme.visualFocus } contentItem: MouseArea { @@ -147,8 +151,8 @@ T.Control { border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: (isCurrent || _isHover) ? VLCStyle.colors.accent - : VLCStyle.colors.roundPlayCoverBorder + border.color: (isCurrent || _isHover) ? theme.accent + : theme.border } } @@ -171,7 +175,7 @@ T.Control { text: (model.name) ? model.name : I18n.qtr("Unknown artist") - color: root.background.foregroundColor + color: theme.fg.primary } } diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml index cfbcc8e95fedbf06277e1f4a7075a8ac4460f129..bac1b7d42310fd21095139ef703c86a00a49b8dd 100644 --- a/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml +++ b/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml @@ -126,7 +126,9 @@ FocusScope { visible: artistModel.count > 0 width: artistList.width height: artistList.height - alternativeColor: VLCStyle.colors.bgAlt + + tintColor: artistList.colorContext.bg.secondary + focus: false } @@ -176,6 +178,7 @@ FocusScope { header: Widgets.SubtitleLabel { text: I18n.qtr("Artists") font.pixelSize: VLCStyle.fontSize_large + color: artistList.colorContext.fg.primary leftPadding: VLCStyle.margin_normal bottomPadding: VLCStyle.margin_small topPadding: VLCStyle.margin_xlarge @@ -213,7 +216,7 @@ FocusScope { anchors.right: parent.right width: VLCStyle.border - color: VLCStyle.colors.border + color: artistList.colorContext.separator } diff --git a/modules/gui/qt/medialibrary/qml/MusicGenres.qml b/modules/gui/qt/medialibrary/qml/MusicGenres.qml index f01cbc339e03b1175544512b7b21957f31e45fbd..90c0848ed924688a7f5cd2423d5a5197006ae6ba 100644 --- a/modules/gui/qt/medialibrary/qml/MusicGenres.qml +++ b/modules/gui/qt/medialibrary/qml/MusicGenres.qml @@ -286,7 +286,6 @@ FocusScope { : _modelMedium selectionDelegateModel: selectionModel - headerColor: VLCStyle.colors.bg focus: true onActionForSelection: _actionAtIndex(selection) Navigation.parentItem: root diff --git a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml index 24d18114a86587f47e416902b842751fce956524..ab01790e57bda50b427720e7012faf5536de7e58 100644 --- a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml @@ -175,8 +175,6 @@ Widgets.KeyNavigableTableView { section.property: "title_first_symbol" - headerColor: VLCStyle.colors.bg - model: rootmodel selectionDelegateModel: selectionModel rowHeight: VLCStyle.tableCoverRow_height diff --git a/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml index e5757c00086e420335543315887a763ef47e829c..9ef5b88b24305254fa72b50ed3ea9c19f9750c43 100644 --- a/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml @@ -70,8 +70,6 @@ FocusScope { // To get blur effect while scrolling in mainview displayMarginEnd: g_mainDisplay.displayMargin - - backgroundColor: VLCStyle.colors.bg } EmptyLabelButton { diff --git a/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml b/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml index 4500d1393e5bb001b30e86b622298354135d50d3..210425b523e650df65fb7ff36558dfed06b9e6ec 100644 --- a/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml +++ b/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml @@ -99,8 +99,6 @@ MainInterface.MainTableView { rowHeight: VLCStyle.tableCoverRow_height - headerColor: VLCStyle.colors.bg - acceptDrop: true sortModel: (availableRowWidth < VLCStyle.colWidth(4)) ? _modelSmall @@ -242,6 +240,6 @@ MainInterface.MainTableView { visible: root._item !== null - color: VLCStyle.colors.accent + color: root.colorContext.accent } } diff --git a/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml b/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml index 83e72a70d585f0c80ae64750c1f542634cfa568b..095d2eccb8c04d2e1e5e0df829bd8b2a88586dee 100644 --- a/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml @@ -165,6 +165,7 @@ FocusScope { bottomPadding: VLCStyle.margin_xsmall text: root.name + color: view.colorContext.fg.primary } diff --git a/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml b/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml index f0325d9c125f0293e12a33a828857eae06938f49..c23826f726584c4bde5358c2bd27ac7daae9ff6e 100644 --- a/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml +++ b/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml @@ -387,8 +387,6 @@ FocusScope { dragItem: dragItemPlaylist - headerColor: VLCStyle.colors.bg - Navigation.parentItem: root Navigation.cancelAction: root._onNavigationCancel diff --git a/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml b/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml index adfcb9410149ea79c9b3eae29d0f425f574867e0..aa22d19ed844b45eef2a0ec240442c1f585461f3 100644 --- a/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml @@ -38,7 +38,7 @@ Widgets.KeyNavigableTableView { verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.icon_tableHeader text: VLCIcons.history - color: VLCStyle.colors.caption + color: listView_id.colorContext.fg.secondary } visible: urlModel.count > 0 @@ -71,7 +71,6 @@ Widgets.KeyNavigableTableView { }] rowHeight: VLCStyle.listAlbumCover_height + VLCStyle.margin_xxsmall * 2 - headerColor: VLCStyle.colors.bg onActionForSelection: MediaLib.addAndPlay(model.getIdsForIndexes( selection)) diff --git a/modules/gui/qt/medialibrary/qml/VideoAll.qml b/modules/gui/qt/medialibrary/qml/VideoAll.qml index 5e1108d47891a10dd632d18c753a230939ae04d8..581c30c0289233bce3674eaa80bd73760ef9865b 100644 --- a/modules/gui/qt/medialibrary/qml/VideoAll.qml +++ b/modules/gui/qt/medialibrary/qml/VideoAll.qml @@ -170,6 +170,11 @@ FocusScope { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + Widgets.StackViewExt { id: view diff --git a/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml b/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml index fbaae4db3947d36f7c4d55e6160e69e57de6dbf9..848d8ada97bc738cfae7a70beba23f484446459a 100644 --- a/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml +++ b/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml @@ -62,6 +62,11 @@ FocusScope { showPlayAsAudioAction: true } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + Column { id: recentVideosColumn @@ -75,6 +80,7 @@ FocusScope { // NOTE: Setting this to listView.visible seems to causes unnecessary implicitHeight // calculations in the Column parent. visible: listView.count > 0 + color: theme.fg.primary } Widgets.KeyNavigableListView { @@ -98,8 +104,6 @@ FocusScope { // NOTE: We want a gentle fade at the beginning / end of the history. enableFade: true - backgroundColor: VLCStyle.colors.bg - Navigation.parentItem: root visible: listView.count > 0 @@ -167,6 +171,7 @@ FocusScope { id: subtitleLabel visible: text !== "" + color: theme.fg.primary } } } diff --git a/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml b/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml index b91e3c75f616f3678b0afd96bfc7f04679b92690..a2563e0f936bac9e11586f6107bca45e6266b5a8 100644 --- a/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml +++ b/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml @@ -47,12 +47,18 @@ FocusScope { playActionBtn.forceActiveFocus(reason); } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + + Rectangle{ id: contentRect anchors.fill: parent implicitHeight: contentLayout.implicitHeight + ( VLCStyle.margin_normal * 2 ) - color: VLCStyle.colors.expandDelegate + color: theme.bg.secondary Rectangle { anchors { @@ -60,7 +66,7 @@ FocusScope { left: parent.left right: parent.right } - color: VLCStyle.colors.border + color: theme.border height: VLCStyle.expandDelegate_border } @@ -70,7 +76,7 @@ FocusScope { left: parent.left right: parent.right } - color: VLCStyle.colors.border + color: theme.border height: VLCStyle.expandDelegate_border } @@ -160,6 +166,7 @@ FocusScope { Widgets.SubtitleLabel { text: model.title || I18n.qtr("Unknown title") + color: theme.fg.primary Layout.fillWidth: true } @@ -178,7 +185,7 @@ FocusScope { Widgets.CaptionLabel { text: (model && model.duration) ? model.duration.formatHMS() : "" - color: VLCStyle.colors.text + color: theme.fg.primary width: parent.width } @@ -186,11 +193,13 @@ FocusScope { topPadding: VLCStyle.margin_normal text: "<b>" + I18n.qtr("File Name:") + "</b> " + root.model.fileName width: parent.width + color: theme.fg.secondary textFormat: Text.StyledText } Widgets.MenuCaption { text: "<b>" + I18n.qtr("Path:") + "</b> " + root.model.display_mrl + color: theme.fg.secondary topPadding: VLCStyle.margin_xsmall bottomPadding: VLCStyle.margin_large width: parent.width @@ -251,6 +260,7 @@ FocusScope { Widgets.MenuCaption { text: modelData.title + color: theme.fg.secondary font.bold: true bottomPadding: VLCStyle.margin_small } @@ -288,6 +298,7 @@ FocusScope { delegate: Widgets.MenuCaption { topPadding: (!videoDescRepeaterDelegate.isFirst) && (index === 0) ? VLCStyle.margin_small : 0 text: modelData.text + " " + modelData.data + color: theme.fg.secondary bottomPadding: VLCStyle.margin_xsmall } } @@ -316,6 +327,7 @@ FocusScope { topPadding: (!audioDescRepeaterDelegate.isFirst) && (index === 0) ? VLCStyle.margin_small : 0 text: modelData.text + " " + modelData.data bottomPadding: VLCStyle.margin_xsmall + color: theme.fg.secondary } } } diff --git a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml index 0136155fe68d43f5a7779b26683760e3c6f68c01..0a128a99a81ef614cde322bc49ba157a97329007 100644 --- a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml @@ -109,8 +109,6 @@ MainInterface.MainTableView { rowHeight: VLCStyle.tableCoverRow_height - headerColor: VLCStyle.colors.bg - //--------------------------------------------------------------------------------------------- // Connections //--------------------------------------------------------------------------------------------- diff --git a/modules/gui/qt/menus/qml/Menubar.qml b/modules/gui/qt/menus/qml/Menubar.qml index 5a4086b7aa3ba9bbc3975e4e0140914f74603850..bc26a40aff0f09695ae68d5f073f9eed17f4c3a4 100644 --- a/modules/gui/qt/menus/qml/Menubar.qml +++ b/modules/gui/qt/menus/qml/Menubar.qml @@ -31,13 +31,12 @@ Item { implicitHeight: menubarLayout.implicitHeight implicitWidth: menubarLayout.implicitWidth - property color bgColor: "transparent" - property color textColor: VLCStyle.colors.text - property color highlightedBgColor: VLCStyle.colors.bgHover - property color highlightedTextColor: VLCStyle.colors.bgHoverText property bool hovered: _countHovered !== 0 property bool menuOpened: _menuIndex !== -1 + readonly property ColorContext colorContext: ColorContext { + colorSet: ColorContext.MenuBar + } Action{ id: mediaMenu; text: I18n.qtr("&Media") ; onTriggered: menubar.popupMediaMenu(source); } Action{ id: playbackMenu; text: I18n.qtr("&Playback") ; onTriggered: menubar.popupPlaybackMenu(source);} @@ -109,16 +108,24 @@ Item { implicitWidth: contentItem.implicitWidth + VLCStyle.margin_xsmall * 2 implicitHeight: contentItem.implicitHeight + VLCStyle.margin_xxxsmall * 2 + ColorContext { + id: theme + colorSet: root.colorContext.colorSet + + enabled: control.enabled + focused: index === root._menuIndex + hovered: control.hovered + } + contentItem: IconLabel { text: control.text font: control.font opacity: enabled ? 1.0 : 0.3 - color: (control.hovered || index === root._menuIndex) ? root.highlightedTextColor : root.textColor + color: theme.fg.primary } background: Rectangle { - color: (control.hovered || index === root._menuIndex) ? root.highlightedBgColor - : root.bgColor + color: theme.bg.primary } } } diff --git a/modules/gui/qt/network/qml/AddressbarButton.qml b/modules/gui/qt/network/qml/AddressbarButton.qml index 8a3d3f8fc08a047b79c8d691ebe86e1df084d963..f78597898c4da8ac1ee1cdeb9870da0878014093 100644 --- a/modules/gui/qt/network/qml/AddressbarButton.qml +++ b/modules/gui/qt/network/qml/AddressbarButton.qml @@ -19,6 +19,7 @@ import QtQuick 2.11 import QtQuick.Templates 2.4 as T +import org.videolan.vlc 0.1 import "qrc:///style/" import "qrc:///widgets/" as Widgets @@ -31,11 +32,8 @@ T.AbstractButton { property bool highlighted: false - // Aliases - - property color foregroundColor: (hovered) ? VLCStyle.colors.buttonTextHover - : VLCStyle.colors.buttonBanner - property color backgroundColor: "transparent" + property color foregroundColor: theme.fg.primary + property color backgroundColor: theme.bg.primary // Settings @@ -53,11 +51,25 @@ T.AbstractButton { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + + colorSet: ColorContext.ButtonStandard + + enabled: button.enabled + focused: button.visualFocus + hovered: button.hovered + pressed: button.down + } + + background: Widgets.AnimatedBackground { active: visualFocus + animate: theme.initialized backgroundColor: button.backgroundColor foregroundColor: button.foregroundColor + activeBorderColor: theme.visualFocus } contentItem: contentLoader.item diff --git a/modules/gui/qt/network/qml/BrowseDeviceHeader.qml b/modules/gui/qt/network/qml/BrowseDeviceHeader.qml index a783266ffa2d9a4d97f6d3b71e97ff721a4709f1..ddf409be2f6233d9eef35936e3195073211655be 100644 --- a/modules/gui/qt/network/qml/BrowseDeviceHeader.qml +++ b/modules/gui/qt/network/qml/BrowseDeviceHeader.qml @@ -53,6 +53,11 @@ FocusScope { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + RowLayout { id: row @@ -65,6 +70,7 @@ FocusScope { id: label Layout.fillWidth: true + color: theme.fg.primary topPadding: VLCStyle.margin_large bottomPadding: VLCStyle.margin_normal diff --git a/modules/gui/qt/network/qml/BrowseDeviceView.qml b/modules/gui/qt/network/qml/BrowseDeviceView.qml index 8647540a917840216c3987a7146939980102f6e9..734490f27d1f774d02a5b4a8a5a9d6ac29f71867 100644 --- a/modules/gui/qt/network/qml/BrowseDeviceView.qml +++ b/modules/gui/qt/network/qml/BrowseDeviceView.qml @@ -330,8 +330,6 @@ FocusScope { header: root.header - headerColor: VLCStyle.colors.bg - selectionDelegateModel: modelSelect Navigation.parentItem: root @@ -351,6 +349,8 @@ FocusScope { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.icon_tableHeader + + color: parent.colorContext.fg.secondary } } @@ -369,7 +369,8 @@ FocusScope { property var rowModel: parent.rowModel property var colModel: parent.colModel - property color foregroundColor: parent.foregroundColor + readonly property ColorContext colorContext: parent.colorContext + readonly property bool selected: parent.selected width: parent.width @@ -396,7 +397,9 @@ FocusScope { return text } - color: itemText.foregroundColor + color: itemText.selected + ? itemText.colorContext.fg.highlight + : itemText.colorContext.fg.primary } } } diff --git a/modules/gui/qt/network/qml/BrowseHomeDisplay.qml b/modules/gui/qt/network/qml/BrowseHomeDisplay.qml index 41acfcd1444a811de34d058d7fe047831ca22077..6eb6310dbb93b22396922165f7bbb01175c654eb 100644 --- a/modules/gui/qt/network/qml/BrowseHomeDisplay.qml +++ b/modules/gui/qt/network/qml/BrowseHomeDisplay.qml @@ -95,6 +95,11 @@ FocusScope { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + //FIXME use the right xxxLabel class T.Label { anchors.centerIn: parent @@ -104,7 +109,7 @@ FocusScope { lanSection.model.count === 0) font.pixelSize: VLCStyle.fontHeight_xxlarge - color: root.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.text + color: root.activeFocus ? theme.accent : theme.fg.primary text: I18n.qtr("No network shares found") } diff --git a/modules/gui/qt/network/qml/BrowseTreeDisplay.qml b/modules/gui/qt/network/qml/BrowseTreeDisplay.qml index edbfa52181c3ef1eda91f87728d0accff9139222..799f21e8d11d109057411ba2b9e7df4dfbf46e38 100644 --- a/modules/gui/qt/network/qml/BrowseTreeDisplay.qml +++ b/modules/gui/qt/network/qml/BrowseTreeDisplay.qml @@ -184,6 +184,7 @@ FocusScope { Widgets.SubtitleLabel { text: providerModel.name leftPadding: gridView.rowX + color: gridView.colorContext.fg.primary Layout.fillWidth: true } @@ -252,7 +253,7 @@ FocusScope { verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.icon_tableHeader text: VLCIcons.album_cover - color: VLCStyle.colors.caption + color: tableView.colorContext.fg.secondary } property Component thumbnailColumn: NetworkThumbnailItem { @@ -316,7 +317,7 @@ FocusScope { selectionDelegateModel: selectionModel focus: true - headerColor: VLCStyle.colors.bg + Navigation.parentItem: root Navigation.upItem: tableView.headerItem @@ -342,6 +343,7 @@ FocusScope { Widgets.SubtitleLabel { text: providerModel.name leftPadding: VLCStyle.margin_large + color: tableView.colorContext.fg.primary Layout.fillWidth: true } diff --git a/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml b/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml index 0328ac50b3fc26120e9b2f5905fc61d95a7c6c9f..6d78eb7f894850c6bca360ee7bd7017c5fc91ce2 100644 --- a/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml +++ b/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml @@ -43,17 +43,6 @@ FocusScope { searchField.forceActiveFocus(reason); } - // Private - - function _getColor() { - if (searchField.activeFocus) { - return VLCStyle.colors.accent; - } else if (searchField.hovered) { - return VLCStyle.colors.textFieldHover; - } else - return VLCStyle.colors.textField; - } - //--------------------------------------------------------------------------------------------- // Childs //--------------------------------------------------------------------------------------------- diff --git a/modules/gui/qt/network/qml/NetworkAddressbar.qml b/modules/gui/qt/network/qml/NetworkAddressbar.qml index 5ee0250ccf1b0c91883e08025f2a38bc28c1e197..b8840c7b151e56a262406b0a6b9145526dd77586 100644 --- a/modules/gui/qt/network/qml/NetworkAddressbar.qml +++ b/modules/gui/qt/network/qml/NetworkAddressbar.qml @@ -67,10 +67,19 @@ T.Control { control._menuModel = menuModel } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + + focused: control.visualFocus + hovered: control.hovered + enabled: control.enabled + } + background: Rectangle { border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.text, .4) - color: VLCStyle.colors.bg + border.color: theme.border + color: theme.bg.primary } contentItem: RowLayout { @@ -169,8 +178,7 @@ T.Control { visible: index !== contentRepeater.count - 1 text: VLCIcons.breadcrumb_sep font.pixelSize: VLCStyle.icon_addressBar - color: VLCStyle.colors.text - opacity: .6 + color: theme.fg.secondary verticalAlignment: Text.AlignVCenter } } diff --git a/modules/gui/qt/network/qml/NetworkCustomCover.qml b/modules/gui/qt/network/qml/NetworkCustomCover.qml index 874e05b3eac04b2dc780998c4b05efbed077b834..05c49fcb52ff6a651a3d6976abf35cee8f6475c7 100644 --- a/modules/gui/qt/network/qml/NetworkCustomCover.qml +++ b/modules/gui/qt/network/qml/NetworkCustomCover.qml @@ -28,7 +28,9 @@ Widgets.ScaledImage { id: custom_cover property var networkModel - property var bgColor: undefined + property color bgColor + property color color1 + property color accent sourceSize: Qt.size(width, height) source: { @@ -39,11 +41,11 @@ Widgets.ScaledImage { return networkModel.artwork var img = SVGColorImage.colorize(_baseUri(networkModel.type)) - .color1(VLCStyle.colors.text) - .accent(VLCStyle.colors.accent) + .color1(custom_cover.color1) + .accent(custom_cover.accent) if (bgColor !== undefined) - img.background(bgColor) + img.background(custom_cover.bgColor) return img.uri() } diff --git a/modules/gui/qt/network/qml/NetworkGridItem.qml b/modules/gui/qt/network/qml/NetworkGridItem.qml index cc790dd219aa5c910ce05b77a93cbba2cc46a7e0..c6b45ad18838ee29672762a1d15389840720ec6c 100644 --- a/modules/gui/qt/network/qml/NetworkGridItem.qml +++ b/modules/gui/qt/network/qml/NetworkGridItem.qml @@ -64,8 +64,8 @@ Widgets.GridItem { } } return SVGColorImage.colorize(f(model.type)) - .color1(VLCStyle.colors.text) - .accent(VLCStyle.colors.accent) + .color1(root.colorContext.fg.primary) + .accent(root.colorContext.accent) .uri() } } diff --git a/modules/gui/qt/network/qml/NetworkThumbnailItem.qml b/modules/gui/qt/network/qml/NetworkThumbnailItem.qml index ec87d0409352ba6905bece74260c39cc519ff5bd..cac27841ac37e3b2b2d2813f493e1f3683774bc8 100644 --- a/modules/gui/qt/network/qml/NetworkThumbnailItem.qml +++ b/modules/gui/qt/network/qml/NetworkThumbnailItem.qml @@ -41,7 +41,9 @@ Row { readonly property string artworkSource: !!rowModel ? rowModel.artwork : "" - readonly property color foregroundColor: parent.foregroundColor + readonly property ColorContext colorContext: parent.colorContext + + readonly property bool selected: parent.selected // Private @@ -111,7 +113,9 @@ Row { networkModel: rowModel - bgColor: VLCStyle.colors.bg + bgColor: root.colorContext.bg.secondary + color1: root.colorContext.fg.primary + accent: root.colorContext.accent Widgets.PlayCover { x: Math.round((artwork.width - width) / 2) @@ -159,7 +163,9 @@ Row { text: (root.rowModel && model.title) ? root.rowModel[model.title] : "" - color: root.foregroundColor + color: root.selected + ? root.colorContext.fg.highlight + : root.colorContext.fg.primary } } @@ -173,6 +179,10 @@ Row { visible: (text) + color: root.selected + ? root.colorContext.fg.highlight + : root.colorContext.fg.secondary + text: root.getCriterias(root.model, root.rowModel) } } diff --git a/modules/gui/qt/network/qml/ServicesManage.qml b/modules/gui/qt/network/qml/ServicesManage.qml index df18b1dd8fb00d4f912f91cebedb52850a7e421d..618dc105a408d2c6efc6e7341a9b4272b407feb0 100644 --- a/modules/gui/qt/network/qml/ServicesManage.qml +++ b/modules/gui/qt/network/qml/ServicesManage.qml @@ -41,7 +41,7 @@ Widgets.KeyNavigableListView { delegate: Rectangle { width: servicesView.width - VLCStyle.margin_large * 2 height: row.implicitHeight + VLCStyle.margin_small * 2 - color: VLCStyle.colors.bgAlt + color: servicesView.colorContext.bg.secondary onActiveFocusChanged: if (activeFocus) action_btn.forceActiveFocus() @@ -82,10 +82,11 @@ Widgets.KeyNavigableListView { Widgets.SubtitleLabel { text: model.name width: parent.width + color: servicesView.colorContext.fg.primary } Widgets.CaptionLabel { - color: VLCStyle.colors.text + color: servicesView.colorContext.fg.primary textFormat: Text.StyledText text: model.author ? I18n.qtr("by <b>%1</b>").arg(model.author) : I18n.qtr("by <b>Unknown</b>") topPadding: VLCStyle.margin_xxxsmall @@ -124,6 +125,7 @@ Widgets.KeyNavigableListView { Widgets.CaptionLabel { elide: Text.ElideRight text: model.description || model.summary || I18n.qtr("No information available") + color: servicesView.colorContext.fg.secondary topPadding: VLCStyle.margin_xsmall wrapMode: Text.WordWrap Layout.fillWidth: true @@ -133,6 +135,7 @@ Widgets.KeyNavigableListView { Widgets.CaptionLabel { text: I18n.qtr("Score: %1/5 Downloads: %2").arg(model.score).arg(model.downloads) topPadding: VLCStyle.margin_xsmall + color: servicesView.colorContext.fg.secondary Layout.fillWidth: true } } @@ -142,6 +145,7 @@ Widgets.KeyNavigableListView { Widgets.BusyIndicatorExt { runningDelayed: discoveryModel.parsingPending anchors.centerIn: parent + color: servicesView.colorContext.fg.primary z: 1 } diff --git a/modules/gui/qt/network/qml/ServicesSources.qml b/modules/gui/qt/network/qml/ServicesSources.qml index c692f0f422a821e79b74c98aff58c71f36de3b48..24880cbe35f31300204849b48de21f748e83960f 100644 --- a/modules/gui/qt/network/qml/ServicesSources.qml +++ b/modules/gui/qt/network/qml/ServicesSources.qml @@ -53,22 +53,22 @@ MainInterface.MainGridView { image: { if (is_dummy) { return SVGColorImage.colorize("qrc:///placeholder/add_service.svg") - .color1(VLCStyle.colors.text) - .accent(VLCStyle.colors.accent) + .color1(this.colorContext.fg.secondary) + .accent(this.colorContext.accent) .uri() } else if (model.artwork && model.artwork.toString() !== "") { //if the source is a qrc artwork, we should colorize it if (model.artwork.toString().match(/qrc:\/\/.*svg/)) { return SVGColorImage.colorize(model.artwork) - .color1(VLCStyle.colors.text) - .accent(VLCStyle.colors.accent) + .color1(this.colorContext.fg.secondary) + .accent(this.colorContext.accent) .uri() } return model.artwork } else { return SVGColorImage.colorize("qrc:///sd/directory.svg") - .color1(VLCStyle.colors.text) + .color1(this.colorContext.fg.secondary) .uri() } } diff --git a/modules/gui/qt/player/qml/Bookmarks.qml b/modules/gui/qt/player/qml/Bookmarks.qml index d68f11cc97d9cadaf427b30dfd4d0b3ceb69b435..6e4052b1744bbc94761fc02d5c60b44ca8c6c4af 100644 --- a/modules/gui/qt/player/qml/Bookmarks.qml +++ b/modules/gui/qt/player/qml/Bookmarks.qml @@ -30,8 +30,6 @@ Item { property real barHeight property int yShift - property VLCColors colors - property bool controlBarHovered property bool bookmarkHovered @@ -47,10 +45,12 @@ Item { Widgets.PointingTooltip { id: timeTooltip + //tooltip is a Popup, palette should be passed explicitly + colorContext.palette: theme.palette + visible: control.bookmarkHovered text: control.bookmarkText pos: Qt.point(control.bookmarkPosition, - yShift) - colors: control.colors } transitions: [ @@ -82,6 +82,11 @@ Item { state: controlBarHovered && bookmarksRptr.count > 0 ? "visible" : "hidden" + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Repeater { id: bookmarksRptr model: MLBookmarkModel { @@ -112,7 +117,7 @@ Item { background: Rectangle { radius: parent.width * 0.5 - color: colors.playerFg + color: bookmarkButton.colorContext.fg.primary } } } diff --git a/modules/gui/qt/player/qml/ControlBar.qml b/modules/gui/qt/player/qml/ControlBar.qml index 647bb871f50c1ad28b4956e84578407e6d9f3396..110737975a467b2697c68e2aa0087cbf88ad30e7 100644 --- a/modules/gui/qt/player/qml/ControlBar.qml +++ b/modules/gui/qt/player/qml/ControlBar.qml @@ -40,10 +40,8 @@ Control { readonly property alias sliderY: row2.y property int textPosition: ControlBar.TimeTextPosition.AboveSlider - property VLCColors colors: VLCStyle.nightColors property alias identifier: playerControlLayout.identifier property alias sliderHeight: trackPositionSlider.barHeight - property alias sliderBackgroundColor: trackPositionSlider.backgroundColor property real bookmarksHeight: VLCStyle.icon_xsmall * 0.9 signal requestLockUnlockAutoHide(bool lock) @@ -113,6 +111,11 @@ Control { row2.visible = row2.children.length > 0 } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + contentItem: ColumnLayout { spacing: VLCStyle.margin_xsmall z: 1 @@ -143,8 +146,6 @@ Control { Navigation.upItem: trackPositionSlider.enabled ? trackPositionSlider : root.Navigation.upItem - colors: root.colors - onRequestLockUnlockAutoHide: root.requestLockUnlockAutoHide(lock) } } @@ -153,7 +154,7 @@ Control { id: mediaTime text: Player.time.formatHMS() - color: root.colors.playerFg + color: theme.fg.primary } T.Label { @@ -162,7 +163,7 @@ Control { text: (MainCtx.showRemainingTime && Player.remainingTime.valid()) ? "-" + Player.remainingTime.formatHMS() : Player.length.formatHMS() - color: root.colors.playerFg + color: theme.fg.primary MouseArea { anchors.fill: parent @@ -179,11 +180,9 @@ Control { SliderBar { id: trackPositionSlider - backgroundColor: colors.playerSeekBar barHeight: VLCStyle.heightBar_xxsmall Layout.fillWidth: true enabled: Player.playingState === Player.PLAYING_STATE_PLAYING || Player.playingState === Player.PLAYING_STATE_PAUSED - colors: root.colors Navigation.parentItem: root Navigation.downItem: playerControlLayout @@ -206,7 +205,6 @@ Control { width: trackPositionSlider.width onLoaded: { - item.colors = Qt.binding(function() { return root.colors }) item.barHeight = Qt.binding(function() { return bookmarksHeight }) item.controlBarHovered = Qt.binding(function() { return root.hovered }) item.yShift = Qt.binding(function() { return row2.height + VLCStyle.margin_xxsmall }) diff --git a/modules/gui/qt/player/qml/ControlLayout.qml b/modules/gui/qt/player/qml/ControlLayout.qml index d49d13b85d27dfd7509ce88f5582c4b493f9b263..8f78043a2e13c07f443ca4f76131a32cfb969eb7 100644 --- a/modules/gui/qt/player/qml/ControlLayout.qml +++ b/modules/gui/qt/player/qml/ControlLayout.qml @@ -81,6 +81,11 @@ FocusScope { activeFocusChanged.connect(_handleFocus) } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + RowLayout { id: rowLayout @@ -166,11 +171,6 @@ FocusScope { if (item.size !== undefined) item.size = Qt.binding(function() { return defaultSize; }) - // force colors: - if (!!colors && !!item.colors) { - item.colors = Qt.binding(function() { return colors; }) - } - item.width = Qt.binding(function() { return loader.width } ) item.visible = Qt.binding(function() { return loader.visible }) diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml index 20a06416c5cabb87d74d871f7efbab0184d3e156..1e2b781d702bed30c51fad5f64596ab107f21b6d 100644 --- a/modules/gui/qt/player/qml/MiniPlayer.qml +++ b/modules/gui/qt/player/qml/MiniPlayer.qml @@ -60,6 +60,11 @@ T.Pane { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + // this MouseArea prevents mouse events to be sent below miniplayer MouseArea { anchors.fill: parent @@ -68,15 +73,13 @@ T.Pane { } background: Rectangle { - color: VLCStyle.colors.bg + color: theme.bg.primary } contentItem: ControlBar { focus: true - colors: VLCStyle.colors textPosition: ControlBar.TimeTextPosition.Hide sliderHeight: VLCStyle.dp(3, VLCStyle.scale) - sliderBackgroundColor: colors.sliderBarMiniplayerBgColor bookmarksHeight: VLCStyle.icon_xsmall * 0.7 identifier: PlayerControlbarModel.Miniplayer Navigation.parentItem: root diff --git a/modules/gui/qt/player/qml/PlaybackSpeed.qml b/modules/gui/qt/player/qml/PlaybackSpeed.qml index f6de5009c938a7155c66460828839fcda73f8bff..3b6e112b0ecd02a9dabfca5fb0aeb4eb841454dc 100644 --- a/modules/gui/qt/player/qml/PlaybackSpeed.qml +++ b/modules/gui/qt/player/qml/PlaybackSpeed.qml @@ -30,10 +30,6 @@ import "qrc:///util/Helpers.js" as Helpers ColumnLayout { id: root - // Properties - - property VLCColors colors: VLCStyle.nightColors - // Private property var _model: [{ "value": 0.25 }, @@ -61,8 +57,8 @@ ColumnLayout { property real _threshold: 0.03 - property color _color: (slider.visualFocus || slider.pressed) ? colors.accent - : colors.text + property color _color: (slider.visualFocus || slider.pressed) ? theme.accent + : theme.fg.primary // Settings @@ -159,6 +155,11 @@ ColumnLayout { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Widgets.SubtitleLabel { id: label @@ -168,7 +169,7 @@ ColumnLayout { text: I18n.qtr("Playback Speed") - color: root.colors.text + color: theme.fg.primary } Item { @@ -189,7 +190,7 @@ ColumnLayout { text: I18n.qtr("0.25") - color: label.color + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_normal } @@ -202,8 +203,6 @@ ColumnLayout { anchors.centerIn: parent - colors: root.colors - focus: true Navigation.parentItem: rowA @@ -216,7 +215,7 @@ ColumnLayout { text: I18n.qtr("1.00x") - color: buttonReset.background.foregroundColor + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_xlarge } @@ -229,7 +228,7 @@ ColumnLayout { text: I18n.qtr("4.00") - color: label.color + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_normal } @@ -271,7 +270,7 @@ ColumnLayout { radius: VLCStyle.dp(2, VLCStyle.scale) - color: root.colors.bgAlt + color: theme.bg.secondary Rectangle { width: slider.visualPosition * parent.width @@ -377,10 +376,6 @@ ColumnLayout { displayText: (currentIndex === 3) ? currentText : root._value - color: root.colors.buttonText - bgColor: root.colors.button - borderColor: root.colors.buttonBorder - Navigation.parentItem: rowB // NOTE: This makes the navigation possible since 'up' is changing the comboBox value. diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml index 5e4f13aabf6832a2524bed91c2229dcd077a66c4..9f94e6b7ec4c149400d4ccd86a84c8415a503672 100644 --- a/modules/gui/qt/player/qml/Player.qml +++ b/modules/gui/qt/player/qml/Player.qml @@ -54,11 +54,6 @@ FocusScope { VLCStyle.noArtAlbumCover } - - // NOTE: We force the night theme when playing a video. - readonly property VLCColors colors: (MainCtx.hasEmbededVideo && !MainCtx.pinVideoControls) ? VLCStyle.nightColors - : VLCStyle.colors - property bool _keyPressed: false layer.enabled: (StackView.status === StackView.Deactivating || StackView.status === StackView.Activating) @@ -147,6 +142,15 @@ FocusScope { } } + //we draw both the view and the window here + ColorContext { + id: windowTheme + // NOTE: We force the night theme when playing a video. + palette: (MainCtx.hasEmbededVideo && !rootPlayer.pinVideoControls) ? VLCStyle.darkPalette + : VLCStyle.palette + colorSet: ColorContext.Window + } + PlayerPlaylistVisibilityFSM { id: playlistVisibility @@ -190,9 +194,14 @@ FocusScope { Rectangle { visible: !rootPlayer.hasEmbededVideo focus: false - color: rootPlayer.colors.bg + color: bgtheme.bg.primary anchors.fill: parent + readonly property ColorContext colorContext: ColorContext { + id: bgtheme + colorSet: ColorContext.View + } + PlayerBlurredBackground { id: backgroundImage @@ -205,8 +214,8 @@ FocusScope { source: cover - screenColor: rootPlayer.colors.setColorAlpha(rootPlayer.colors.playerBg, .55) - overlayColor: rootPlayer.colors.setColorAlpha(Qt.tint(rootPlayer.colors.playerFg, rootPlayer.colors.playerBg), 0.4) + screenColor: VLCStyle.colors.setColorAlpha(bgtheme.bg.primary, .55) + overlayColor: VLCStyle.colors.setColorAlpha(Qt.tint(bgtheme.fg.primary, bgtheme.bg.primary), 0.4) } } @@ -216,7 +225,7 @@ FocusScope { Rectangle { width: rootPlayer.width - color: rootPlayer.colors.playerBg + color: windowTheme.bg.primary } } @@ -225,7 +234,7 @@ FocusScope { Widgets.AcrylicBackground { width: rootPlayer.width - alternativeColor: rootPlayer.colors.playerBg + tintColor: windowTheme.bg.primary } } @@ -299,9 +308,7 @@ FocusScope { Rectangle { width: controlBarView.width height: controlBarView.height - (rootPlayer.positionSliderY - controlBarView.y) - color: rootPlayer.colors.isThemeDark - ? Qt.darker(rootPlayer.colors.playerBg, 1.2) - : Qt.lighter(rootPlayer.colors.playerBg, 1.2) + color: windowTheme.bg.primary opacity: 0.7 } } @@ -334,7 +341,6 @@ FocusScope { focus: true title: mainPlaylistController.currentItem.title - colors: rootPlayer.colors pinControls: rootPlayer.pinVideoControls showCSD: MainCtx.clientSideDecoration && (MainCtx.intfMainWindow.visibility !== Window.FullScreen) @@ -361,6 +367,11 @@ FocusScope { Item { id: centerContent + readonly property ColorContext colorContext: ColorContext { + id: centerTheme + colorSet: ColorContext.View + } + anchors { left: parent.left right: parent.right @@ -441,7 +452,7 @@ FocusScope { text: mainPlaylistController.currentItem.album font.pixelSize: VLCStyle.fontSize_xxlarge horizontalAlignment: Text.AlignHCenter - color: rootPlayer.colors.playerFg + color: centerTheme.fg.primary Accessible.description: I18n.qtr("album") } @@ -459,7 +470,7 @@ FocusScope { text: mainPlaylistController.currentItem.artist font.weight: Font.Light horizontalAlignment: Text.AlignHCenter - color: rootPlayer.colors.playerFg + color: centerTheme.fg.primary Accessible.description: I18n.qtr("artist") } @@ -486,9 +497,6 @@ FocusScope { size: VLCStyle.icon_audioPlayerButton onClicked: Player.jumpBwd() text: I18n.qtr("Step back") - color: rootPlayer.colors.playerFg - colorHover: rootPlayer.colors.buttonTextHover - colorFocus: rootPlayer.colors.bgFocus } Widgets.IconToolButton { @@ -496,9 +504,6 @@ FocusScope { size: VLCStyle.icon_audioPlayerButton onClicked: Player.toggleVisualization() text: I18n.qtr("Visualization") - color: rootPlayer.colors.playerFg - colorHover: rootPlayer.colors.buttonTextHover - colorFocus: rootPlayer.colors.bgFocus } Widgets.IconToolButton{ @@ -506,9 +511,6 @@ FocusScope { size: VLCStyle.icon_audioPlayerButton onClicked: Player.jumpFwd() text: I18n.qtr("Step forward") - color: rootPlayer.colors.playerFg - colorHover: rootPlayer.colors.buttonTextHover - colorFocus: rootPlayer.colors.bgFocus } } } @@ -540,7 +542,7 @@ FocusScope { height: playlistpopup.height - color: rootPlayer.colors.setColorAlpha(rootPlayer.colors.topBanner, 0.8) + color: VLCStyle.colors.setColorAlpha(windowTheme.bg.primary, 0.8) PL.PlaylistListView { @@ -548,11 +550,9 @@ FocusScope { useAcrylic: false focus: true - anchors.fill: parent - colors: rootPlayer.colors + anchors.fill: parent rightPadding: VLCStyle.applicationHorizontalMargin - topPadding: { if (rootPlayer.pinVideoControls) return VLCStyle.margin_normal @@ -652,7 +652,6 @@ FocusScope { anchors.rightMargin: VLCStyle.applicationHorizontalMargin anchors.bottomMargin: VLCStyle.applicationVerticalMargin - colors: rootPlayer.colors textPosition: rootPlayer.pinVideoControls ? ControlBar.TimeTextPosition.LeftRightSlider : ControlBar.TimeTextPosition.AboveSlider Navigation.parentItem: rootPlayer diff --git a/modules/gui/qt/player/qml/PlayerControlLayout.qml b/modules/gui/qt/player/qml/PlayerControlLayout.qml index 7a976992039b3e66638ea323d892aa5413abe397..6165f9c2b989bf0aeaf44c9ea6bfc0b1380e088b 100644 --- a/modules/gui/qt/player/qml/PlayerControlLayout.qml +++ b/modules/gui/qt/player/qml/PlayerControlLayout.qml @@ -29,8 +29,6 @@ FocusScope { implicitWidth: layoutLoader_left.implicitWidth + layoutLoader_center.implicitWidth + layoutLoader_right.implicitWidth + 2 * layoutSpacing implicitHeight: VLCStyle.maxControlbarControlHeight - property VLCColors colors: null - property real defaultSize: VLCStyle.icon_normal // default size for IconToolButton based controls property real spacing: VLCStyle.margin_normal // spacing between controls @@ -50,6 +48,11 @@ FocusScope { console.assert(identifier >= 0) } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Loader { id: layoutLoader_left diff --git a/modules/gui/qt/player/qml/ResumeDialog.qml b/modules/gui/qt/player/qml/ResumeDialog.qml index b88f97fdf589aa00d51f9044f2f65dd3bdc31b77..fe8f19e5becea1447247c56b8783a57b496e0a7f 100644 --- a/modules/gui/qt/player/qml/ResumeDialog.qml +++ b/modules/gui/qt/player/qml/ResumeDialog.qml @@ -30,7 +30,6 @@ import "qrc:///menus/" as Menus FocusScope { id: resumePanel - property VLCColors colors: VLCStyle.colors property int maxWidth implicitHeight: continueBtn.y + continueBtn.implicitHeight @@ -74,6 +73,12 @@ FocusScope { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + + Component.onCompleted: { if (Player.canRestorePlayback) { showResumePanel() @@ -99,7 +104,7 @@ FocusScope { anchors.top: parent.top anchors.left: parent.left - color: resumePanel.colors.playerFg + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_normal font.bold: true wrapMode: Text.Wrap @@ -116,7 +121,7 @@ FocusScope { text: I18n.qtr("Continue") font.bold: true - color: resumePanel.colors.playerFg + color: theme.fg.primary focus: true onClicked: { Player.restorePlaybackPos() @@ -137,7 +142,7 @@ FocusScope { text: I18n.qtr("Dismiss") font.bold: true - color: resumePanel.colors.playerFg + color: theme.fg.primary onClicked: hideResumePanel() Navigation.parentItem: resumePanel diff --git a/modules/gui/qt/player/qml/SliderBar.qml b/modules/gui/qt/player/qml/SliderBar.qml index 3368acacdf51a134a06f93b018658c62aa975e5b..7327094ecf75f39473bbf226c3723271d6b99bd9 100644 --- a/modules/gui/qt/player/qml/SliderBar.qml +++ b/modules/gui/qt/player/qml/SliderBar.qml @@ -42,8 +42,7 @@ Slider { property bool _currentChapterHovered: false property real _tooltipPosition: timeTooltip.pos.x / sliderRectMouseArea.width - property alias backgroundColor: sliderRect.color - property VLCColors colors: VLCStyle.colors + property color backgroundColor: theme.bg.primary Keys.onRightPressed: Player.jumpFwd() Keys.onLeftPressed: Player.jumpBwd() @@ -53,6 +52,15 @@ Slider { seekpointTimer.restart() } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Slider + + enabled: control.enabled + focused: control.visualFocus + hovered: control.hovered + } + Timer { id: seekpointTimer running: Player.hasChapters && !control.hovered && _isSeekPointsShown @@ -63,6 +71,9 @@ Slider { Widgets.PointingTooltip { id: timeTooltip + //tooltip is a Popup, palette should be passed explicitly + colorContext.palette: theme.palette + visible: control.hovered text: Player.length.scale(pos.x / control.width).formatHMS() + @@ -70,8 +81,6 @@ Slider { " - " + Player.chapters.getNameAtPosition(control._tooltipPosition) : "") pos: Qt.point(sliderRectMouseArea.mouseX, 0) - - colors: control.colors } Item { @@ -160,7 +169,7 @@ Slider { Rectangle { id: sliderRect visible: !Player.hasChapters - color: backgroundColor + color: control.backgroundColor anchors.fill: parent radius: implicitHeight } @@ -220,7 +229,7 @@ Slider { readonly property bool _hovered: control.hovered && (sliderRectMouseArea.mouseX > x && sliderRectMouseArea.mouseX < x+width) - color: _currentChapter < 0 ? control.colors.accent : control.backgroundColor + color: _currentChapter < 0 ? theme.fg.primary : control.backgroundColor width: sliderRect.width * seekpointsRect.endPosition - x - control._seekPointsDistance x: sliderRect.width * seekpointsRect.startPosition @@ -233,7 +242,7 @@ Slider { width: sliderRect.width * control.visualPosition - parent.x - control._seekPointsDistance visible: parent._currentChapter === 0 - color: control.colors.accent + color: theme.fg.primary } } @@ -283,7 +292,7 @@ Slider { id: progressRect width: control.visualPosition * parent.width visible: !Player.hasChapters - color: control.colors.accent + color: theme.fg.primary height: control.barHeight radius: control._seekPointsRadius } @@ -297,7 +306,7 @@ Slider { height: control.barHeight opacity: 0.4 - color: control.colors.buffer + color: theme.fg.neutral //FIXME buffer color ? radius: control.barHeight states: [ @@ -384,7 +393,7 @@ Slider { implicitWidth: sliderHandle._size implicitHeight: sliderHandle._size radius: VLCStyle.margin_small - color: control.colors.accent + color: theme.fg.primary transitions: [ Transition { diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml index c31fd1be9de587828921a7c910e368d2bbd7e5ce..1ceccb8ebb94255c6f7e3a707796054bf95b082e 100644 --- a/modules/gui/qt/player/qml/TopBar.qml +++ b/modules/gui/qt/player/qml/TopBar.qml @@ -34,7 +34,6 @@ FocusScope{ /* required */ property int textWidth property string title - property VLCColors colors: VLCStyle.nightColors property bool showCSD: false property bool showToolbar: false @@ -161,6 +160,11 @@ FocusScope{ reservedHeight = offset } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + //drag and dbl click the titlebar in CSD mode Loader { id: tapNDrag @@ -185,9 +189,6 @@ FocusScope{ visible: root.showToolbar enabled: root.showToolbar - textColor: root.colors.text - highlightedBgColor: root.colors.bgHover - highlightedTextColor: root.colors.bgHoverText onHoveredChanged: root.requestLockUnlockAutoHide(hovered) onMenuOpenedChanged: root.requestLockUnlockAutoHide(menuOpened) @@ -229,8 +230,6 @@ FocusScope{ iconText: VLCIcons.back text: I18n.qtr("Back") focus: true - colors: root.colors - Navigation.parentItem: root Navigation.rightItem: menuSelector @@ -246,6 +245,8 @@ FocusScope{ anchors.left: backBtn.right anchors.leftMargin: VLCStyle.margin_xxsmall + color: theme.accent + Connections { target: logo.button @@ -264,11 +265,12 @@ FocusScope{ //add aditional margin so it align with menubar text when visible (see MenuBar.qml) anchors.leftMargin: VLCStyle.margin_xsmall - colors: root.colors maxWidth: ((root.showCSD && !root.pinControls) ? csdDecorations : playlistGroup).x - VLCStyle.applicationHorizontalMargin - VLCStyle.margin_large + colorContext.palette: theme.palette + Navigation.parentItem: rootPlayer onHidden: { @@ -302,7 +304,7 @@ FocusScope{ rightPadding: VLCStyle.margin_small text: root.title - color: root.colors.playerFg + color: theme.fg.primary font.pixelSize: VLCStyle.dp(13, VLCStyle.scale) font.weight: Font.DemiBold elide: Text.ElideRight @@ -339,7 +341,7 @@ FocusScope{ text: root.title horizontalAlignment: Text.AlignLeft - color: root.colors.playerFg + color: theme.fg.primary font.weight: Font.DemiBold font.pixelSize: VLCStyle.dp(18, VLCStyle.scale) elide: Text.ElideRight @@ -359,17 +361,6 @@ FocusScope{ source: VLCStyle.palette.hasCSDImage ? "qrc:///widgets/CSDThemeButtonSet.qml" : "qrc:///widgets/CSDWindowButtonSet.qml" - onLoaded: { - if (VLCStyle.palette.hasCSDImage) { - if (item.hasOwnProperty("color")) - item.color = Qt.binding(function() { return VLCStyle.colors.topBanner }) - } else { - if (item.hasOwnProperty("color")) - item.color = Qt.binding(function() { return root.colors.playerFg }) - if (item.hasOwnProperty("hoverColor")) - item.hoverColor = Qt.binding(function() { return root.colors.windowCSDButtonDarkBg }) - } - } Connections { target: csdDecorations.item @@ -403,7 +394,6 @@ FocusScope{ iconText: VLCIcons.menu text: I18n.qtr("Menu") - colors: root.colors Navigation.parentItem: root Navigation.leftItem: backBtn @@ -430,7 +420,6 @@ FocusScope{ size: VLCStyle.icon_banner iconText: VLCIcons.playlist text: I18n.qtr("Playlist") - colors: root.colors focus: root.showToolbar width: VLCStyle.bannerButton_width diff --git a/modules/gui/qt/player/qml/TracksMenu.qml b/modules/gui/qt/player/qml/TracksMenu.qml index 0b022050fcc5c2d863af08fadbb0ece659052cb1..6ac23efbc6c05012c64646720182ab529292cf7a 100644 --- a/modules/gui/qt/player/qml/TracksMenu.qml +++ b/modules/gui/qt/player/qml/TracksMenu.qml @@ -52,11 +52,16 @@ T.Popup { // Children + readonly property ColorContext colorContext: ColorContext { + id: popupTheme + colorSet: ColorContext.Window + } + T.Overlay.modal: null background: Rectangle { opacity: 0.8 - color: "#212121" + color: popupTheme.bg.primary } contentItem: StackView { @@ -65,6 +70,13 @@ T.Popup { initialItem: frontPage + //erf, popup are weird, content is not parented to the root + //so, duplicate the context here for the childrens + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: popupTheme.colorSet + palette: popupTheme.palette + } onCurrentItemChanged: currentItem.forceActiveFocus() @@ -211,8 +223,7 @@ T.Popup { width: VLCStyle.margin_xxxsmall height: tracksListContainer.height - color: "white" - opacity: .1 + color: theme.border } } @@ -238,7 +249,7 @@ T.Popup { - parent.rightPadding text: modelData.title - color: "white" + color: theme.fg.primary } Widgets.IconTrackButton { diff --git a/modules/gui/qt/player/qml/TracksPage.qml b/modules/gui/qt/player/qml/TracksPage.qml index e199edf1fdeb15461411603081b3d561b678e076..8d94e51da56f712fd81c508d999dfb9d4cad4d24 100644 --- a/modules/gui/qt/player/qml/TracksPage.qml +++ b/modules/gui/qt/player/qml/TracksPage.qml @@ -49,6 +49,11 @@ RowLayout { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Item { Layout.preferredWidth: VLCStyle.dp(72, VLCStyle.scale) Layout.fillHeight: true @@ -75,9 +80,7 @@ RowLayout { Layout.preferredWidth: VLCStyle.margin_xxxsmall Layout.fillHeight: true - opacity: 0.1 - - color: "white" + color: theme.border } FocusScope { diff --git a/modules/gui/qt/player/qml/TracksPageAudio.qml b/modules/gui/qt/player/qml/TracksPageAudio.qml index f3722cb59526d958e2da048d75a99ff600aaccc7..63dcf03d5c63c0607e4a493ec6e4a06c808372f9 100644 --- a/modules/gui/qt/player/qml/TracksPageAudio.qml +++ b/modules/gui/qt/player/qml/TracksPageAudio.qml @@ -52,7 +52,7 @@ TracksPage { text: I18n.qtr("Audio track synchronization") - color: "white" + color: root.colorContext.fg.primary } RowLayout { @@ -67,7 +67,7 @@ TracksPage { text: I18n.qtr("Audio track delay") - color: "white" + color: root.colorContext.fg.primary } Widgets.SpinBoxExt { diff --git a/modules/gui/qt/player/qml/TracksPageSubtitle.qml b/modules/gui/qt/player/qml/TracksPageSubtitle.qml index ab431698ac458fd1179e5fdf0b299f05db4f1e94..41289654f06ff7c36c24f7d52ddb3351c7ea5c9b 100644 --- a/modules/gui/qt/player/qml/TracksPageSubtitle.qml +++ b/modules/gui/qt/player/qml/TracksPageSubtitle.qml @@ -60,7 +60,7 @@ TracksPage { text: I18n.qtr("Subtitle synchronization") - color: "white" + color: root.colorContext.fg.primary } RowLayout { @@ -75,7 +75,7 @@ TracksPage { text: I18n.qtr("Primary subtitle delay") - color: "white" + color: root.colorContext.fg.primary } Widgets.SpinBoxExt { @@ -147,7 +147,7 @@ TracksPage { text: I18n.qtr("Secondary subtitle delay") - color: "white" + color: root.colorContext.fg.primary } Widgets.SpinBoxExt { @@ -218,7 +218,7 @@ TracksPage { text: I18n.qtr("Subtitle Speed") - color: "white" + color: root.colorContext.fg.primary } Widgets.SpinBoxExt { diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml index 578a77b21ce82af8da0e76f4717bb82e69b6ede5..28d50c3f4019eb5ee9cb10180745d3a80e874f15 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml @@ -19,8 +19,6 @@ import QtQuick 2.11 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.11 -import QtGraphicalEffects 1.0 - import org.videolan.vlc 0.1 import "qrc:///widgets/" as Widgets @@ -32,8 +30,6 @@ AbstractButton { property bool paintOnly: false - property VLCColors colors: VLCStyle.colors - readonly property real minimumWidth: coverRect.implicitWidth + + (leftPadding + rightPadding) @@ -68,9 +64,17 @@ AbstractButton { g_mainDisplay.showPlayer() } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + focused: artworkInfoItem.visualFocus + hovered: artworkInfoItem.hovered + } + background: Widgets.AnimatedBackground { active: visualFocus - activeBorderColor: colors.bgFocus + animate: theme.initialized + activeBorderColor: theme.visualFocus } contentItem: RowLayout { @@ -82,7 +86,7 @@ AbstractButton { implicitHeight: VLCStyle.dp(60, VLCStyle.scale) implicitWidth: implicitHeight - color: colors.bg + color: theme.bg.primary Widgets.DoubleShadow { anchors.fill: parent @@ -118,8 +122,6 @@ AbstractButton { ToolTip.text: I18n.qtr("%1\n%2\n%3").arg(titleLabel.text) .arg(artistLabel.text) .arg(progressIndicator.text) - - property alias colors: artworkInfoItem.colors } } @@ -142,7 +144,7 @@ AbstractButton { else Player.title } - color: colors.text + color: theme.fg.primary } Widgets.MenuCaption { @@ -157,7 +159,7 @@ AbstractButton { else Player.artist } - color: colors.menuCaption + color: theme.fg.secondary } Widgets.MenuCaption { @@ -172,7 +174,7 @@ AbstractButton { else Player.time.formatHMS() + " / " + Player.length.formatHMS() } - color: colors.menuCaption + color: theme.fg.secondary } } } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml index 74e6c15a8b2537a9e275f3d0d2547c4bf9a5da37..5a29bc810923f51dca50d7cfaf1b3eb4ab88b870 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml @@ -25,8 +25,6 @@ import "qrc:///style/" Widgets.ImageToolButton { id: control - property VLCColors colors: VLCStyle.colors - text: I18n.qtr("A to B") sourceSize.width: VLCStyle.icon_toolbar @@ -40,26 +38,26 @@ Widgets.ImageToolButton { switch(Player.ABloopState) { case Player.ABLOOP_STATE_A: return control._colorize( - control.colors.accent, - control.colors.text + control.colorContext.accent, + control.colorContext.fg.primary ) case Player.ABLOOP_STATE_B: return control._colorize( - control.colors.accent, - control.colors.accent + control.colorContext.accent, + control.colorContext.accent ) case Player.ABLOOP_STATE_NONE: default: return control._colorize( - control.colors.text, - control.colors.text + control.colorContext.fg.primary, + control.colorContext.fg.primary ) } } function _colorize(a, b) { return SVGColorImage.colorize("qrc:///icons/atob.svg") - .color1(control.colors.text) + .color1(control.colorContext.fg.primary) .any({ "#AAAAAA": a, "#BBBBBB": b, diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml b/modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml index 11060288516a13d236c34140ba95cb06727209f6..45453f06aeb9facecc28e20c5c7410564d4b2917 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml @@ -28,6 +28,7 @@ import "qrc:///widgets/" as Widgets import "qrc:///util/Helpers.js" as Helpers Widgets.IconControlButton { + id: control // Properties // Private @@ -46,7 +47,7 @@ Widgets.IconControlButton { // Settings - color: (popup.visible) ? colors.accent : colors.playerControlBarFg + color: (popup.visible) ? control.colorContext.accent : control.colorContext.fg.primary // FIXME: We can't use upItem because a Popup is not an Item. Navigation.upAction: function() { @@ -140,11 +141,17 @@ Widgets.IconControlButton { onHeightChanged: if (visible) root._updatePosition() background: Rectangle { + ColorContext { + id: popupTheme + palette: control.colorContext.palette + colorSet: ColorContext.Window + } + radius: VLCStyle.dp(8, VLCStyle.scale) opacity: 0.85 - color: colors.bg + color: popupTheme.bg.primary } } } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml index d2f588ad6f99b3b1dfff4fadbb039d28868a23d2..1566feced20e306f08e41e8c2c4fc5b16b723240 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml @@ -33,12 +33,17 @@ Item { readonly property real minimumWidth: 0 + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Button + } + T.Label { id: spacetext anchors.centerIn: parent text: VLCIcons.space - color: VLCStyle.colors.buttonText + color: theme.fg.secondary visible: paintOnly font.pixelSize: VLCStyle.icon_toolbar diff --git a/modules/gui/qt/player/qml/controlbarcontrols/Fallback.qml b/modules/gui/qt/player/qml/controlbarcontrols/Fallback.qml index 98c9a5ecd85afe06a7299f378fd76c634a4fc43b..cd5d187e4091cd6bd592bf57c05d1112dc2d38c9 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/Fallback.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/Fallback.qml @@ -35,16 +35,21 @@ Control { Keys.onPressed: Navigation.defaultKeyAction(event) property bool paintOnly: false - property VLCColors colors: VLCStyle.colors + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } background: Widgets.AnimatedBackground { active: visualFocus - activeBorderColor: colors.bgFocus + animate: theme.initialized + activeBorderColor: theme.visualFocus } contentItem: Widgets.MenuLabel { text: I18n.qtr("WIDGET\nNOT\nFOUND") horizontalAlignment: Text.AlignHCenter - color: colors.text + color: theme.fg.primary } } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/HighResolutionTimeWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/HighResolutionTimeWidget.qml index 5570dae64f226b68413ea6a10b52cd41834a8984..5e82d0ff4fec139a2603e2619454144020dbe245 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/HighResolutionTimeWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/HighResolutionTimeWidget.qml @@ -30,7 +30,6 @@ Control { id: highResolutionTimeWidget property bool paintOnly: false - property VLCColors colors: VLCStyle.colors padding: VLCStyle.focus_border @@ -55,9 +54,17 @@ Control { _adjustSMPTETimer(false) } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + focused: highResolutionTimeWidget.visualFocus + } + background: Widgets.AnimatedBackground { active: visualFocus - activeBorderColor: colors.bgFocus + animate: theme.initialized + activeBorderColor: theme.visualFocus } contentItem: Item { @@ -69,7 +76,7 @@ Control { anchors.fill: parent text: paintOnly ? "00:00:00:00" : Player.highResolutionTime - color: colors.text + color: theme.fg.primary horizontalAlignment: Text.AlignHCenter } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml index 49a61f04be4bfea571da0a4f0dc64de8998e8daa..704a54d127077fe42738a176bb652244505620da 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml @@ -49,6 +49,8 @@ Widgets.IconControlButton { y: (rootPlayer.positionSliderY - height) z: 1 + colorContext.palette: langBtn.colorContext.palette + onOpened: { langBtn.requestLockUnlockAutoHide(true) if (!!rootPlayer) diff --git a/modules/gui/qt/player/qml/controlbarcontrols/NavigationWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/NavigationWidget.qml index bc00ef64dd840e26345676b3a1f20e1b931570b9..c8bbb6a80568af4d78589125ea3b61e134b87bdf 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/NavigationWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/NavigationWidget.qml @@ -33,8 +33,6 @@ Templates.Pane { property int size: VLCStyle.icon_toolbar - property VLCColors colors: VLCStyle.colors - property bool paintOnly: false // Private @@ -63,7 +61,6 @@ Templates.Pane { function _applyItem(loader, item) { item.focus = true - item.colors = Qt.binding(function() { return colors }) item.paintOnly = Qt.binding(function() { return paintOnly }) item.Navigation.parentItem = Qt.binding(function() { return loader }) @@ -81,6 +78,11 @@ Templates.Pane { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + Row { id: row diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml index 5487c3dee09ec7639abe5b7d3e85fd5a9e584dc9..ecdfe0e745de993649d604319c4d38cb10731d11 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml @@ -34,8 +34,6 @@ T.Control { scale: (_keyOkPressed || (mouseArea.pressed && cursorInside)) ? 0.95 : 1.00 - property VLCColors colors: VLCStyle.colors - property bool paintOnly: false property bool _keyOkPressed: false @@ -70,6 +68,16 @@ T.Control { mainPlaylistController.stop() } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + enabled: playBtn.enabled || playBtn.paintOnly + focused: playBtn.activeFocus + hovered: playBtn.cursorInside + pressed: mouseArea.containsPress + } + Timer { id: keyHoldTimer @@ -174,11 +182,8 @@ T.Control { return VLCIcons.play } - color: cursorInside ? VLCStyle.colors.blendColors(VLCStyle.colors.buttonPlayA, - VLCStyle.colors.buttonPlayB, - 0.5) - : (paintOnly || enabled ? colors.buttonPlayIcon - : colors.textInactive) + color: cursorInside ? theme.accent + : "black" //foreground is always black font.pixelSize: VLCStyle.icon_play font.family: VLCIcons.fontFamily @@ -187,6 +192,7 @@ T.Control { horizontalAlignment: Text.AlignHCenter Behavior on color { + enabled: theme.initialized ColorAnimation { duration: VLCStyle.duration_veryShort easing.type: Easing.InOutSine @@ -207,7 +213,7 @@ T.Control { blurRadius: VLCStyle.dp(9) yOffset: VLCStyle.dp(4) - color: Qt.rgba(255 / 255, 97 / 255, 10 / 255, 0.29) + color: VLCStyle.colors.setColorAlpha(theme.accent, 0.29) xRadius: parent.width yRadius: xRadius @@ -226,7 +232,7 @@ T.Control { blurRadius: VLCStyle.dp(14) yOffset: VLCStyle.dp(1) - color: Qt.rgba(255 / 255, 97 / 255, 10 / 255, 1.0) + color: VLCStyle.colors.setColorAlpha(theme.accent, 1.0) xRadius: parent.width yRadius: xRadius diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml index a6d67b213af49387d39ad50f8a6a1a4235a62042..19e70e2e8db5a1ebdaf12e438a0c191a6c0465fc 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml @@ -32,7 +32,7 @@ ControlButtonPopup { text: I18n.qtr("Playback Speed") popupContent: P.PlaybackSpeed { - colors: root.colors + colorContext.palette: root.colorContext.palette Navigation.parentItem: root diff --git a/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml index 79e3544612aa51e4b7090c37f9c8658f1b48c107..3283f873db58df5b1c0053476e5b1c7d38e9e3f4 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml @@ -29,7 +29,7 @@ Widgets.IconToolButton { enabled: !paintOnly && Player.isPlaying - color: VLCStyle.colors.record + color: "red" //red means recording text: I18n.qtr("record") onClicked: Player.toggleRecord() diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml index d8b6f8c24aefb6ce74a259c16b902e5309ef427f..4c8fab821fb65c2d02a838c6699342d8f0ab0951 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml @@ -29,10 +29,18 @@ Item { implicitHeight: VLCStyle.icon_toolbar property alias spacetextExt: spacetext property bool paintOnly: false + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + enabled: spacer.enabled || spacer.paintOnly + } + T.Label { id: spacetext text: VLCIcons.space - color: VLCStyle.colors.buttonText + color: theme.fg.secondary visible: parent.paintOnly anchors.centerIn: parent diff --git a/modules/gui/qt/player/qml/controlbarcontrols/TeletextButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/TeletextButton.qml index 030e3fb1c0746c6767af865efa34104853fd2298..d286db2515bcc45f21ba8f75946ea6b7d8eab84b 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/TeletextButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/TeletextButton.qml @@ -37,7 +37,7 @@ ControlButtonPopup { text: I18n.qtr("Teletext") popupContent: TeletextWidget { - colors: root.colors + colorContext.palette: root.colorContext.palette Navigation.parentItem: root Navigation.downItem: root diff --git a/modules/gui/qt/player/qml/controlbarcontrols/TeletextColorButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/TeletextColorButton.qml index d0cdcc1df183726b72306c18bd596ce01938c0c7..96a5521b131e94f4154ebaea5069dfb043f8b035 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/TeletextColorButton.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/TeletextColorButton.qml @@ -29,7 +29,5 @@ Widgets.IconControlButton { iconText: VLCIcons.circle - colorDisabled: "grey" - T.ToolTip.visible: (hovered || visualFocus) } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml index 55b83e5783a5bee73d6d73b502d0a5e12d83e93e..e167b253eafde5df8217f133ec9d2b3dfdd08ae9 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml @@ -28,8 +28,6 @@ import "qrc:///style/" T.Pane { id: root - property VLCColors colors: VLCStyle.colors - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) @@ -52,6 +50,11 @@ T.Pane { return base } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Column { id: column @@ -69,7 +72,7 @@ T.Pane { text: I18n.qtr("Teletext") - color: root.colors.text + color: theme.fg.primary } ControlCheckButton { @@ -83,8 +86,6 @@ T.Pane { checked: Player.teletextEnabled - colors: root.colors - Navigation.parentItem: root Navigation.rightItem: teleTransparencyBtn Navigation.downItem: teleTransparencyBtn @@ -109,8 +110,6 @@ T.Pane { iconText: VLCIcons.transparency text: I18n.qtr("Teletext transparency") - colors: root.colors - T.ToolTip.visible: (hovered || visualFocus) Navigation.parentItem: root @@ -138,8 +137,6 @@ T.Pane { } editable: true - textColor: colors.text - bgColor: colors.bg Navigation.parentItem: root Navigation.leftItem: teleTransparencyBtn @@ -189,8 +186,6 @@ T.Pane { iconText: VLCIcons.home text: I18n.qtr("Index key") - colors: root.colors - T.ToolTip.visible: (hovered || visualFocus) Navigation.parentItem: root @@ -210,7 +205,6 @@ T.Pane { text: I18n.qtr("Red key") - colors: root.colors color: root._teletextButtonColor(this, "red") Navigation.parentItem: root @@ -230,7 +224,6 @@ T.Pane { text: I18n.qtr("Green key") - colors: root.colors color: root._teletextButtonColor(this, "green") Navigation.parentItem: root @@ -250,7 +243,6 @@ T.Pane { text: I18n.qtr("Yellow key") - colors: root.colors color: root._teletextButtonColor(this, "yellow") Navigation.parentItem: root @@ -270,7 +262,6 @@ T.Pane { text: I18n.qtr("Blue key") - colors: root.colors color: root._teletextButtonColor(this, "blue") Navigation.parentItem: root diff --git a/modules/gui/qt/player/qml/controlbarcontrols/VolumeWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/VolumeWidget.qml index ae26c5327883571539f4f0bcc9e271ee5f41c66a..e05cc6f55c9fdd0b0a4e45837790ff7b2c600f09 100644 --- a/modules/gui/qt/player/qml/controlbarcontrols/VolumeWidget.qml +++ b/modules/gui/qt/player/qml/controlbarcontrols/VolumeWidget.qml @@ -28,10 +28,14 @@ import "qrc:///style/" T.Pane { id: root - property VLCColors colors: VLCStyle.colors - property color color: colors.accent property bool paintOnly: false + + readonly property color sliderColor: (volControl.position > _fullvolpos) ? theme.fg.negative : theme.fg.primary + readonly property var _player: paintOnly ? ({ muted: false, volume: .5 }) : Player + readonly property int _maxvol: MainCtx.maxVolume + readonly property real _fullvolpos: 100 / _maxvol + readonly property real _maxvolpos: _maxvol / 100 implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) @@ -42,6 +46,15 @@ T.Pane { Keys.priority: Keys.AfterItem Keys.onPressed: Navigation.defaultKeyAction(event) + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Slider + + enabled: volControl.enabled || root.paintOnly + focused: volControl.visualFocus + hovered: volControl.hovered + } + RowLayout { id: volumeWidget @@ -65,9 +78,6 @@ T.Pane { else VLCIcons.volume_high text: I18n.qtr("Mute") - color: colors.buttonText - colorHover: colors.buttonTextHover - colorFocus: colors.bgFocus onClicked: Player.muted = !Player.muted Navigation.parentItem: root @@ -95,7 +105,7 @@ T.Pane { property bool _keyPressed: false from: 0 - to: maxvolpos + to: root._maxvolpos opacity: _player.muted ? 0.5 : 1 Accessible.name: I18n.qtr("Volume") @@ -172,11 +182,6 @@ T.Pane { Keys.priority: Keys.BeforeItem - readonly property color sliderColor: (volControl.position > fullvolpos) ? colors.volmax : root.color - readonly property int maxvol: MainCtx.maxVolume - readonly property real fullvolpos: 100 / maxvol - readonly property real maxvolpos: maxvol / 100 - onValueChanged: { if (paintOnly) return @@ -197,7 +202,8 @@ T.Pane { pos: Qt.point(handle.x + handle.width / 2, handle.y) - colors: root.colors + //tooltip is a Popup, palette should be passed explicitly + colorContext.palette: theme.palette } } @@ -210,26 +216,26 @@ T.Pane { height: implicitHeight width: volControl.availableWidth radius: VLCStyle.dp(4, VLCStyle.scale) - color: colors.volsliderbg + color: theme.bg.primary Rectangle { id: filled width: volControl.visualPosition * sliderBg.width height: parent.height radius: VLCStyle.dp(4, VLCStyle.scale) - color: root.color + color: root.sliderColor } Rectangle{ id: tickmark - x : parent.width * volControl.fullvolpos + x : parent.width * root._fullvolpos width: VLCStyle.dp(1, VLCStyle.scale) height: parent.height radius: VLCStyle.dp(2, VLCStyle.scale) // NOTE: This shouldn't be visible when the volume stops before a 100. - visible: (volControl.maxvol > 100) + visible: (root._maxvol > 100) - color: root.color + color: root.sliderColor // NOTE: This is a helper to select the default volume when clicking on the // tickmark. We apply a higher clamp value to achieve that behavior on @@ -260,7 +266,7 @@ T.Pane { implicitHeight: implicitWidth radius: width * 0.5 visible: (paintOnly || volControl.hovered || volControl.activeFocus) - color: volControl.sliderColor + color: root.sliderColor } MouseArea { @@ -326,7 +332,7 @@ T.Pane { function adjustVolume(mouse) { mouse.accepted = true - var pos = mouse.x * volControl.maxvolpos / width + var pos = mouse.x * root._maxvolpos / width if (pos < 0.25) volControl.value = 0 diff --git a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml index f4f3f6363a198288a21c40cda75184739aaa549f..4a7d7a7baf25def491af0da078e4c0830c675cb9 100644 --- a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml +++ b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml @@ -42,8 +42,6 @@ T.Control { readonly property bool containsDrag: (topContainsDrag || bottomContainsDrag) - readonly property VLCColors colors: root.colors - // Settings topPadding: VLCStyle.margin_xxsmall @@ -91,19 +89,22 @@ T.Control { // Childs + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + + focused: delegate.activeFocus + hovered: delegate.hovered + enabled: delegate.enabled + } + background: Widgets.AnimatedBackground { - color: { - if (selected) - return colors.gridSelect; - else if (hovered) - return colors.listHover; - else - return colors.setColorAlpha(colors.gridSelect, 0); - } + backgroundColor: selected ? theme.bg.highlight : theme.bg.primary - active: visualFocus + active: delegate.visualFocus + animate: theme.initialized - activeBorderColor: colors.bgFocus + activeBorderColor: theme.visualFocus visible: animationRunning || active || selected || hovered } @@ -147,7 +148,7 @@ T.Control { anchors.centerIn: parent visible: (model.isCurrent && text !== "") - color: colors.accent + color: theme.accent text: { if (Player.playingState === Player.PLAYING_STATE_PLAYING) return VLCIcons.volume_high @@ -175,7 +176,7 @@ T.Control { font.weight: model.isCurrent ? Font.Bold : Font.DemiBold text: model.title - color: colors.text + color: theme.fg.primary verticalAlignment: Text.AlignTop } @@ -187,7 +188,7 @@ T.Control { font.weight: model.isCurrent ? Font.DemiBold : Font.Normal text: (model.artist ? model.artist : I18n.qtr("Unknown Artist")) - color: colors.text + color: theme.fg.primary verticalAlignment: Text.AlignBottom } } @@ -198,7 +199,7 @@ T.Control { text: model.duration.formatHMS() horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - color: colors.text + color: theme.fg.primary opacity: 0.5 } } diff --git a/modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml b/modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml index 98db5e05404d755d1f3b49e03cc91b757e0b64db..545f93174b651c02c1493eac4676909745ef64ae 100644 --- a/modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml +++ b/modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml @@ -34,7 +34,7 @@ Window { minimumWidth: playlistView.minimumWidth title: I18n.qtr("Playlist") - color: VLCStyle.colors.bg + color: theme.bg.primary Loader { asynchronous: true @@ -61,6 +61,8 @@ Window { focus: true anchors.fill: parent + colorContext.palette: VLCStyle.palette + readonly property PlaylistListView g_root: playlistView } } diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml index b83749a74d1098bb3ab4a9a1d53626b8798156ba..410e2477b22bcb3c43e62e1abbb0a6f382bfd036 100644 --- a/modules/gui/qt/playlist/qml/PlaylistListView.qml +++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml @@ -45,7 +45,14 @@ Control { onActiveFocusChanged: if (activeFocus) listView.forceActiveFocus(focusReason) - property VLCColors colors: VLCStyle.colors + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + + focused: root.activeFocus + hovered: root.hovered + enabled: root.enabled + } property int mode: PlaylistListView.Mode.Normal @@ -139,8 +146,6 @@ Control { } sourceComponent: PlaylistOverlayMenu { - colors: root.colors - isRight: true rightPadding: VLCStyle.margin_xsmall + VLCStyle.applicationHorizontalMargin bottomPadding: VLCStyle.margin_large + root.bottomPadding @@ -154,8 +159,6 @@ Control { property var selection: null // make this indexes alias? - colors: root.colors - indexes: selection onRequestData: { @@ -183,7 +186,7 @@ Control { background: Widgets.AcrylicBackground { enabled: root.useAcrylic - alternativeColor: colors.bgAlt + tintColor: theme.bg.primary } contentItem: ColumnLayout { @@ -199,14 +202,14 @@ Control { Widgets.SubtitleLabel { text: I18n.qtr("Playqueue") - color: colors.text + color: theme.fg.primary font.weight: Font.Bold font.pixelSize: VLCStyle.dp(24, VLCStyle.scale) } Widgets.CaptionLabel { color: (root.mode === PlaylistListView.Mode.Select || root.mode === PlaylistListView.Mode.Move) - ? colors.accent : colors.caption + ? theme.accent : theme.fg.secondary visible: model.count !== 0 text: { switch (root.mode) { @@ -240,7 +243,7 @@ Control { text: VLCIcons.album_cover font.pixelSize: VLCStyle.icon_playlistHeader - color: colors.caption + color: theme.fg.secondary } Widgets.CaptionLabel { @@ -248,14 +251,14 @@ Control { verticalAlignment: Text.AlignVCenter text: I18n.qtr("Title") - color: colors.caption + color: theme.fg.secondary } Widgets.IconLabel { Layout.preferredWidth: durationMetric.width text: VLCIcons.time - color: colors.caption + color: theme.fg.secondary horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.icon_playlistHeader @@ -289,11 +292,10 @@ Control { // NOTE: We want a gentle fade at the beginning / end of the playqueue. enableFade: true - backgroundColor: background.usingAcrylic ? "transparent" - : background.alternativeColor + backgroundColor: root.background.usingAcrylic ? "transparent" + : listView.colorContext.bg.primary property int shiftIndex: -1 - property Item itemContainsDrag: null onDeselectAll: { @@ -347,7 +349,7 @@ Control { anchors.margins: VLCStyle.margin_small border.width: VLCStyle.dp(2) - border.color: colors.accent + border.color: theme.accent color: "transparent" @@ -363,7 +365,7 @@ Control { font.pointSize: VLCStyle.fontHeight_xxxlarge font.family: VLCIcons.fontFamily - color: colors.accent + color: theme.accent } } @@ -402,7 +404,7 @@ Control { implicitHeight: VLCStyle.dp(1) visible: !!parent - color: colors.accent + color: theme.accent } function updateItemContainsDrag(item, set) { @@ -591,8 +593,7 @@ Control { text: VLCIcons.playlist - color: (listView.activeFocus) ? colors.bgFocus - : colors.text + color: theme.fg.primary font.pixelSize: VLCStyle.dp(48, VLCStyle.scale) } diff --git a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml index c5b0d0d694ac09aeefb58c93e5a0a94d5d8faab5..e2312919d9db497963f59f7846fb90e54ec8e303 100644 --- a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml +++ b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml @@ -28,9 +28,14 @@ import "qrc:///style/" RowLayout { id: rowLayout + readonly property ColorContext colorContext: ColorContext { + colorSet: ColorContext.Window + } + height: VLCStyle.heightBar_normal spacing: VLCStyle.margin_normal + Item { Layout.fillWidth: true implicitHeight: loop.height @@ -104,8 +109,6 @@ RowLayout { mainPlaylistController.sort() } - colors: root.colors - sortOrder: { if (mainPlaylistController.sortOrder === PlaylistControllerModel.SORT_ORDER_ASC) { Qt.AscendingOrder diff --git a/modules/gui/qt/widgets/qml/AcrylicBackground.qml b/modules/gui/qt/widgets/qml/AcrylicBackground.qml index dd6a8d58a32e12ff3e97a07797bd9fa03f67717f..7549860808f16bfb848f3e8063f9ee3e75ccd1a9 100644 --- a/modules/gui/qt/widgets/qml/AcrylicBackground.qml +++ b/modules/gui/qt/widgets/qml/AcrylicBackground.qml @@ -30,11 +30,13 @@ ViewBlockingRectangle { readonly property bool usingAcrylic: visible && enabled && AcrylicController.enabled - property color tintColor: VLCStyle.colors.setColorAlpha(VLCStyle.colors.bg, 0.7) + property color tintColor: "gray" - property color alternativeColor: VLCStyle.colors.bgAlt + property color alternativeColor: tintColor + readonly property color _actualTintColor: VLCStyle.colors.setColorAlpha(tintColor, 0.7) property real _blend: usingAcrylic ? AcrylicController.uiTransluency : 0 - color: VLCStyle.colors.blendColors(root.tintColor, root.alternativeColor, root._blend) + + color: VLCStyle.colors.blendColors(root._actualTintColor, root.alternativeColor, root._blend) } diff --git a/modules/gui/qt/widgets/qml/ActionButtonOverlay.qml b/modules/gui/qt/widgets/qml/ActionButtonOverlay.qml index 8f02bbcfe54168ffe04bca3ee257013a0bd85993..aded20c64c9d84c997368b2c6a41e55452eae01a 100644 --- a/modules/gui/qt/widgets/qml/ActionButtonOverlay.qml +++ b/modules/gui/qt/widgets/qml/ActionButtonOverlay.qml @@ -20,14 +20,11 @@ import QtQuick 2.11 +import org.videolan.vlc 0.1 import "qrc:///style/" ButtonExt { - // Style - iconSize: VLCStyle.icon_actionButton - - foregroundColor: (hovered) ? VLCStyle.colors.white - : VLCStyle.colors.buttonBannerDark + id: control - colorFocus: VLCStyle.colors.white + iconSize: VLCStyle.icon_actionButton } diff --git a/modules/gui/qt/widgets/qml/ActionButtonPrimary.qml b/modules/gui/qt/widgets/qml/ActionButtonPrimary.qml index db72858cf75580c8444474197f14947b95c18dc5..4c79d8e33a970d5b44743bb5e49271d52358dea9 100644 --- a/modules/gui/qt/widgets/qml/ActionButtonPrimary.qml +++ b/modules/gui/qt/widgets/qml/ActionButtonPrimary.qml @@ -20,15 +20,12 @@ import QtQuick 2.11 +import org.videolan.vlc 0.1 import "qrc:///style/" ButtonExt { - // Style + id: control + colorContext.colorSet: ColorContext.ButtonAccent iconSize: VLCStyle.icon_actionButton - - backgroundColor: (hovered) ? VLCStyle.colors.buttonPrimaryHover - : VLCStyle.colors.accent - - foregroundColor: "white" } diff --git a/modules/gui/qt/widgets/qml/AnimatedBackground.qml b/modules/gui/qt/widgets/qml/AnimatedBackground.qml index 89365e7812550708f109c401f5529aff0bfcc600..851516415ba9c5e5e938da9a9fad4412dd176abf 100644 --- a/modules/gui/qt/widgets/qml/AnimatedBackground.qml +++ b/modules/gui/qt/widgets/qml/AnimatedBackground.qml @@ -36,14 +36,9 @@ Rectangle { // `foregroundColor` property is not used in this component but is // provided as a convenience as it gets animated with color property - property color foregroundColor: { - if (backgroundColor.a === 0) - return VLCStyle.colors.text - var brightness = backgroundColor.r*0.299 + backgroundColor.g*0.587 + backgroundColor.b*0.114 - return brightness > .6 ? "black" : "white" - } + property color foregroundColor - property color activeBorderColor: VLCStyle.colors.bgFocus + property color activeBorderColor property int animationDuration: VLCStyle.duration_long diff --git a/modules/gui/qt/widgets/qml/BannerCone.qml b/modules/gui/qt/widgets/qml/BannerCone.qml index e548ae27a61ff6b8992141d6377b2244956ba6ce..efef446f199a8f541d906908bf218ff188e46b7b 100644 --- a/modules/gui/qt/widgets/qml/BannerCone.qml +++ b/modules/gui/qt/widgets/qml/BannerCone.qml @@ -27,11 +27,12 @@ Image { id: root property var button: MainCtx.csdButtonModel.systemMenuButton + /* required */ property color color sourceSize.width: VLCStyle.icon_normal sourceSize.height: VLCStyle.icon_normal source: SVGColorImage.colorize("qrc:///misc/cone.svg") - .accent(VLCStyle.colors.accent) + .accent(root.color) .uri() focus: false diff --git a/modules/gui/qt/widgets/qml/BannerTabButton.qml b/modules/gui/qt/widgets/qml/BannerTabButton.qml index e12d9a3e110e75f20bb4a2365f69bb914d8fb023..22f3cff75c2baddd1e7e11c4b6ca50a024117219 100644 --- a/modules/gui/qt/widgets/qml/BannerTabButton.qml +++ b/modules/gui/qt/widgets/qml/BannerTabButton.qml @@ -37,8 +37,6 @@ T.TabButton { property bool showText: true property bool showCurrentIndicator: true - property color color: VLCStyle.colors.topBanner - // Settings width: control.showText ? VLCStyle.bannerTabButton_width_large @@ -59,34 +57,30 @@ T.TabButton { Keys.onPressed: Navigation.defaultKeyAction(event) - // Private functions + // Childs - function _getBackground() { - if (activeFocus || hovered) - return VLCStyle.colors.buttonHover; - else - return color; - } + ColorContext { + id: theme + colorSet: ColorContext.TabButton - function _getForeground() { - if (activeFocus || hovered || selected) - return VLCStyle.colors.buttonTextHover; - else - return VLCStyle.colors.buttonBanner; + focused: control.activeFocus + hovered: control.hovered + pressed: control.down + enabled: control.enabled } - // Childs - background: Widgets.AnimatedBackground { height: control.height width: control.width active: visualFocus + animate: theme.initialized animationDuration: VLCStyle.duration_short - backgroundColor: _getBackground() - foregroundColor: _getForeground() + backgroundColor: theme.bg.primary + foregroundColor: control.selected ? theme.fg.secondary : theme.fg.primary + activeBorderColor: theme.visualFocus } contentItem: Item { @@ -105,10 +99,9 @@ T.TabButton { Widgets.IconLabel { text: control.iconTxt - color: (control.activeFocus || - control.hovered || - control.selected) ? VLCStyle.colors.accent - : VLCStyle.colors.text + color: (control.selected || control.activeFocus || control.hovered) + ? theme.accent + : theme.fg.primary font.pixelSize: VLCStyle.icon_banner } diff --git a/modules/gui/qt/widgets/qml/BusyIndicatorExt.qml b/modules/gui/qt/widgets/qml/BusyIndicatorExt.qml index e2df6416e7c1f48c38d34884062a3599df4a805f..50f452923dda2462ffbc4b24231857fcff7a7938 100644 --- a/modules/gui/qt/widgets/qml/BusyIndicatorExt.qml +++ b/modules/gui/qt/widgets/qml/BusyIndicatorExt.qml @@ -22,7 +22,8 @@ import "qrc:///style/" BusyIndicator { id: control - palette.text: VLCStyle.colors.text + property color color + palette.text: color running: false property int delay: VLCStyle.duration_humanMoment diff --git a/modules/gui/qt/widgets/qml/ButtonExt.qml b/modules/gui/qt/widgets/qml/ButtonExt.qml index 44909d329cdf1194592dfc5761fac158878d75df..dc3d598cce921ecd373d751c57cadd3dfee17aea 100644 --- a/modules/gui/qt/widgets/qml/ButtonExt.qml +++ b/modules/gui/qt/widgets/qml/ButtonExt.qml @@ -39,15 +39,11 @@ T.Button { property int iconSize: VLCStyle.icon_normal - property color color: VLCStyle.colors.text + property color color: theme.fg.primary + property color colorFocus: theme.visualFocus - // Aliases - - property alias backgroundColor: background.backgroundColor - property alias foregroundColor: background.foregroundColor - - property alias colorFocus: background.activeBorderColor + // Aliases property alias iconRotation: icon.rotation // Settings @@ -72,18 +68,29 @@ T.Button { // Childs + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ButtonStandard + + focused: control.activeFocus + hovered: control.hovered + enabled: control.enabled + pressed: control.down + } + background: Widgets.AnimatedBackground { id: background height: control.height width: control.width - active: visualFocus + active: control.visualFocus + animate: theme.initialized - foregroundColor: (hovered) ? VLCStyle.colors.buttonTextHover - : VLCStyle.colors.buttonBanner - - activeBorderColor: VLCStyle.colors.bgFocus + backgroundColor: theme.bg.primary + foregroundColor: control.color + activeBorderColor: control.colorFocus } contentItem: Item { @@ -119,7 +126,7 @@ T.Button { text: control.iconTxt - color: background.foregroundColor + color: control.color font.pixelSize: control.iconSize } @@ -131,13 +138,15 @@ T.Button { padding: 0 running: control.busy + + palette.text: theme.fg.primary } } Widgets.ListLabel { text: control.text - color: background.foregroundColor + color: theme.fg.primary } } @@ -152,7 +161,7 @@ T.Button { color: "transparent" - border.color: VLCStyle.colors.accent + border.color: theme.accent } } } diff --git a/modules/gui/qt/widgets/qml/CSDWindowButton.qml b/modules/gui/qt/widgets/qml/CSDWindowButton.qml index ded2bb451330e171fb4b6ad66a62b9c90c082242..882c2ce8f1e2b21ea5561147aa72ef10bbbb439f 100644 --- a/modules/gui/qt/widgets/qml/CSDWindowButton.qml +++ b/modules/gui/qt/widgets/qml/CSDWindowButton.qml @@ -26,10 +26,11 @@ import "qrc:///style/" T.Button { id: control - property color color: VLCStyle.colors.text - property color hoverColor: VLCStyle.colors.windowCSDButtonBg + property color color + property color hoverColor property string iconTxt: "" property bool showHovered: false + property bool isThemeDark: false readonly property bool _paintHovered: control.hovered || showHovered @@ -43,13 +44,13 @@ T.Button { height: control.height width: control.width color: { + if (control.pressed) + return control.isThemeDark ? Qt.lighter(control.hoverColor, 1.2) + : Qt.darker(control.hoverColor, 1.2) + if (control._paintHovered) return control.hoverColor - if (control.pressed) - return VLCStyle.colors.isThemeDark ? Qt.lighter(control.hoverColor, 1.2) - : Qt.darker(control.hoverColor, 1.2) - return "transparent" } } diff --git a/modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml b/modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml index ba3ccb234208a55db490710e5e6510b605309e13..a94fe4f5369dce5aae1dfc043ebc142ba7a142dc 100644 --- a/modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml +++ b/modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml @@ -30,8 +30,8 @@ Row { width: implicitWidth - property color color: VLCStyle.colors.text - property color hoverColor: VLCStyle.colors.windowCSDButtonBg + property color color: theme.fg.primary + property color hoverColor: VLCStyle.colors.setColorAlpha(theme.bg.primary, 0.5) readonly property bool hovered: { var h = false @@ -43,6 +43,11 @@ Row { return h } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Repeater { id: repeater @@ -59,6 +64,8 @@ Row { hoverColor: (modelData.type === CSDButton.Close) ? "red" : windowButtonGroup.hoverColor + isThemeDark: theme.palette.isDark + iconTxt: { switch (modelData.type) { case CSDButton.Minimize: diff --git a/modules/gui/qt/widgets/qml/CheckButton.qml b/modules/gui/qt/widgets/qml/CheckButton.qml index a8f0b9b16a0ab7d1c2940855c6b4f14559d96eeb..f96f7b32f51926e540f371c5b34d05de4669b0b3 100644 --- a/modules/gui/qt/widgets/qml/CheckButton.qml +++ b/modules/gui/qt/widgets/qml/CheckButton.qml @@ -32,12 +32,15 @@ T.Switch { property int animationDuration: VLCStyle.duration_long - property color color: (checked) ? VLCStyle.colors.accent - : VLCStyle.colors.black + property color color: (checked) ? theme.bg.secondary + : theme.bg.primary - property color colorHandle: VLCStyle.colors.white + property color colorHandle: (checked) ? theme.fg.secondary + : theme.fg.primary - property color colorActive: VLCStyle.colors.bgFocus + + property color colorBorder: (checked) ? "transparent" + : theme.border // Private @@ -137,21 +140,20 @@ T.Switch { // Children - background: Rectangle { - visible: root.visualFocus - - color: "transparent" + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Switch - border.width: VLCStyle.focus_border - - border.color: (visible) ? root.colorActive - : VLCStyle.colors.setColorAlpha(root.colorActive, 0) + enabled: root.enabled + focused: root.visualFocus + hovered: root.hovered + pressed: root.down + } - Behavior on border.color { - ColorAnimation { - duration: root.animationDuration - } - } + background: AnimatedBackground { + active: root.visualFocus + animate: theme.initialized + activeBorderColor: theme.visualFocus } indicator: Rectangle { @@ -163,6 +165,9 @@ T.Switch { color: root.color + border.color: root.colorBorder + border.width: VLCStyle.border + MouseArea { id: handle diff --git a/modules/gui/qt/widgets/qml/CheckedDelegate.qml b/modules/gui/qt/widgets/qml/CheckedDelegate.qml index f03d78bbd7bff0ab366d7cdc46598d8849794ccb..75df9b2167978cd2308754dec24f7dfe86efc9ff 100644 --- a/modules/gui/qt/widgets/qml/CheckedDelegate.qml +++ b/modules/gui/qt/widgets/qml/CheckedDelegate.qml @@ -37,22 +37,22 @@ T.ItemDelegate { // Childs + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + + focused: control.activeFocus + hovered: control.hovered + pressed: control.pressed + enabled: control.enabled + } + background: AnimatedBackground { active: visualFocus - backgroundColor: { - if (control.hovered) { - if (control.checked) - return VLCStyle.colors.trackItemHover; - else - return VLCStyle.colors.trackItem; - } else if (control.checked) - return VLCStyle.colors.trackItem; - else - return "transparent" - } - - activeBorderColor: VLCStyle.colors.white + animate: theme.initialized + backgroundColor: control.checked ? theme.bg.highlight : theme.bg.primary + activeBorderColor: theme.visualFocus } contentItem: Item { // don't use a row, it will move text when control is unchecked @@ -67,7 +67,7 @@ T.ItemDelegate { text: VLCIcons.check - color: "white" + color: theme.fg.primary font.pixelSize: VLCStyle.icon_track } @@ -87,7 +87,7 @@ T.ItemDelegate { text: control.text font: control.font - color: "white" + color: theme.fg.primary } } } diff --git a/modules/gui/qt/widgets/qml/ComboBoxExt.qml b/modules/gui/qt/widgets/qml/ComboBoxExt.qml index 5a1a7aa3baa6a662b5786e9726e90dbbe3cca2b0..033aa87a97d8284f6e773cf3cf0301c50caa2494 100644 --- a/modules/gui/qt/widgets/qml/ComboBoxExt.qml +++ b/modules/gui/qt/widgets/qml/ComboBoxExt.qml @@ -21,6 +21,7 @@ import QtQuick.Controls 2.4 import org.videolan.vlc 0.1 import "qrc:///style/" +import "qrc:///widgets/" as Widgets ComboBox { id: control @@ -28,9 +29,19 @@ ComboBox { font.pixelSize: VLCStyle.fontSize_large leftPadding: 5 - property color color: VLCStyle.colors.buttonText - property color bgColor: VLCStyle.colors.button - property color borderColor: VLCStyle.colors.buttonBorder + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ComboBox + + focused: control.activeFocus + enabled: control.enabled + hovered: control.hovered + pressed: control.pressed + } + + property color color: theme.fg.primary + property color bgColor: theme.bg.primary + property color borderColor: theme.border Keys.priority: Keys.AfterItem Keys.onPressed: Navigation.defaultKeyAction(event) @@ -71,7 +82,7 @@ ComboBox { context.lineTo(width, 0); context.lineTo(width / 2, height); context.closePath(); - context.fillStyle = control.activeFocus ? VLCStyle.colors.accent : control.color; + context.fillStyle = control.activeFocus ? theme.accent : control.color; context.fill(); } } @@ -91,7 +102,7 @@ ComboBox { implicitWidth: control.width implicitHeight: control.height color: control.bgColor - border.color: control.activeFocus ? VLCStyle.colors.accent : control.borderColor + border.color: control.borderColor border.width: control.activeFocus ? 2 : 1 radius: 2 } @@ -112,16 +123,11 @@ ComboBox { model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex - highlight: Rectangle { - color: VLCStyle.colors.accent - } - - Rectangle { - z: 10 - width: parent.width - height: parent.height - color: "transparent" - border.color: VLCStyle.colors.accent + highlight: Widgets.AnimatedBackground { + active: visualFocus + animate: theme.initialized + activeBorderColor: theme.visualFocus + backgroundColor: theme.bg.secondary } ScrollIndicator.vertical: ScrollIndicator { } diff --git a/modules/gui/qt/widgets/qml/CurrentIndicator.qml b/modules/gui/qt/widgets/qml/CurrentIndicator.qml index 4fb185e51e17d9cbd197ffb9260fba46435c1e15..dfdf4e28f15a89c3f43587b6ba7ccad2341eb1f6 100644 --- a/modules/gui/qt/widgets/qml/CurrentIndicator.qml +++ b/modules/gui/qt/widgets/qml/CurrentIndicator.qml @@ -18,6 +18,8 @@ *****************************************************************************/ import QtQuick 2.11 import QtQuick.Controls 2.4 + +import org.videolan.vlc 0.1 import "qrc:///style/" Rectangle { @@ -25,7 +27,11 @@ Rectangle { property int orientation: Qt.Vertical property int margin: VLCStyle.margin_xxxsmall - color: VLCStyle.colors.accent + readonly property ColorContext colorContext: ColorContext { + id: theme + } + + color: theme.accent width: orientation === Qt.Vertical ? VLCStyle.heightBar_xxxsmall : parent.width height: orientation === Qt.Horizontal ? VLCStyle.heightBar_xxxsmall : parent.height diff --git a/modules/gui/qt/widgets/qml/DragItem.qml b/modules/gui/qt/widgets/qml/DragItem.qml index e8d8cc31cc28a2206187ef4e29154edfaaaa0d86..bb8a1ed4c7918cdc7ef014a7255e5df87a402130 100644 --- a/modules/gui/qt/widgets/qml/DragItem.qml +++ b/modules/gui/qt/widgets/qml/DragItem.qml @@ -39,8 +39,6 @@ Item { readonly property int coverSize: VLCStyle.icon_normal - property VLCColors colors: VLCStyle.colors - property var indexes: [] // data from last setData @@ -178,11 +176,16 @@ Item { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Rectangle { /* background */ anchors.fill: parent - color: colors.button - border.color: colors.buttonBorder + color: theme.bg.primary + border.color: theme.border border.width: VLCStyle.dp(1, VLCStyle.scale) radius: VLCStyle.dp(6, VLCStyle.scale) } @@ -190,7 +193,7 @@ Item { RectangularGlow { anchors.fill: parent glowRadius: VLCStyle.dp(8, VLCStyle.scale) - color: colors.glowColor + color: theme.shadow spread: 0.2 z: -1 } @@ -211,7 +214,7 @@ Item { radius: coverRepeater.count > 1 ? dragItem.coverSize : VLCStyle.dp(2, VLCStyle.scale) anchors.fill: parent - color: colors.bg + color: theme.bg.primary DoubleShadow { anchors.fill: parent @@ -258,7 +261,7 @@ Item { // for cover border color: "transparent" border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: colors.buttonBorder + border.color: theme.border anchors.fill: parent radius: bg.radius } @@ -274,13 +277,13 @@ Item { height: dragItem.coverSize radius: dragItem.coverSize visible: dragItem._indexesSize > dragItem._maxCovers - color: colors.bgAlt + color: theme.bg.secondary border.width: VLCStyle.dp(1, VLCStyle.scale) - border.color: colors.buttonBorder + border.color: theme.border MenuLabel { anchors.centerIn: parent - color: colors.accent + color: theme.accent text: "+" + (dragItem._indexesSize - dragItem._maxCovers) } @@ -324,7 +327,7 @@ Item { width: parent.width elide: Text.ElideNone font.pixelSize: VLCStyle.fontSize_large - color: colors.buttonText + color: theme.fg.primary } } @@ -334,7 +337,7 @@ Item { visible: text && text !== "" width: parent.width text: I18n.qtr("%1 selected").arg(dragItem._indexesSize) - color: colors.menuCaption + color: theme.fg.secondary } } diff --git a/modules/gui/qt/widgets/qml/ExpandGridView.qml b/modules/gui/qt/widgets/qml/ExpandGridView.qml index b6dbf2f7baa308531242bce6e9be719f98337cbe..00b6b3cb08941c5de9f4cd594736843050b56169 100644 --- a/modules/gui/qt/widgets/qml/ExpandGridView.qml +++ b/modules/gui/qt/widgets/qml/ExpandGridView.qml @@ -575,6 +575,11 @@ FocusScope { // Children + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + //Gridview visible above the expanded item Flickable { id: flickable diff --git a/modules/gui/qt/widgets/qml/GridItem.qml b/modules/gui/qt/widgets/qml/GridItem.qml index 975625f0212af4f4a789862c83a167dcafe6d979..348904f0fab17832d7ee963bca4e4a41cb3de29a 100644 --- a/modules/gui/qt/widgets/qml/GridItem.qml +++ b/modules/gui/qt/widgets/qml/GridItem.qml @@ -150,6 +150,14 @@ T.Control { // Childs + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + + focused: root.activeFocus + hovered: root.hovered + } + background: AnimatedBackground { width: root.width + (selectedBorderWidth * 2) height: root.height + (selectedBorderWidth * 2) @@ -158,12 +166,12 @@ T.Control { y: - selectedBorderWidth active: visualFocus + animate: theme.initialized - backgroundColor: root.selected - ? VLCStyle.colors.gridSelect - : VLCStyle.colors.setColorAlpha(VLCStyle.colors.gridSelect, 0) - - visible: animationRunning || active || root.selected + //don't show the backgroud unless selected + backgroundColor: root.selected ? theme.bg.highlight : theme.bg.primary + activeBorderColor: theme.visualFocus + visible: animationRunning || active || root.selected || root.hovered } contentItem: MouseArea { @@ -238,6 +246,7 @@ T.Control { playCoverVisible: false playCoverOpacity: 0 radius: VLCStyle.gridCover_radius + color: theme.bg.secondary Layout.preferredWidth: pictureWidth Layout.preferredHeight: pictureHeight @@ -307,7 +316,9 @@ T.Control { id: titleLabel height: implicitHeight - color: root.background.foregroundColor + color: root.selected + ? theme.fg.highlight + : theme.fg.primary textFormat: Text.PlainText } } @@ -318,17 +329,15 @@ T.Control { visible: text !== "" text: root.subtitle elide: Text.ElideRight - color: root.background.foregroundColor + color: root.selected + ? theme.fg.highlight + : theme.fg.secondary textFormat: Text.PlainText Layout.preferredWidth: Math.min(pictureWidth, implicitWidth) Layout.alignment: root.textAlignHCenter ? Qt.AlignCenter : Qt.AlignLeft Layout.topMargin: VLCStyle.margin_xsmall - // this is based on that MenuCaption.color.a == .6, color of this component is animated (via binding with background.foregroundColor), - // to save operation during animation, directly set the opacity - opacity: .6 - ToolTip.delay: VLCStyle.delayToolTipAppear ToolTip.text: subtitleTxt.text ToolTip.visible: subtitleTxtMouseHandler.hovered diff --git a/modules/gui/qt/widgets/qml/IconControlButton.qml b/modules/gui/qt/widgets/qml/IconControlButton.qml index 54c57f3f580f268fe781f18bd581dbb39e4cce5d..8a1bf677a94926195af7e3bf965e04cce8c02c22 100644 --- a/modules/gui/qt/widgets/qml/IconControlButton.qml +++ b/modules/gui/qt/widgets/qml/IconControlButton.qml @@ -21,18 +21,6 @@ import QtQuick 2.11 import "qrc:///style/" IconToolButton { - // Properties - - property VLCColors colors: VLCStyle.colors - // Style - size: VLCStyle.icon_toolbar - color: colors.buttonPlayer - colorHover: colors.buttonTextHover - colorHighlighted: colors.accent - colorDisabled: paintOnly ? color - : colors.blendColors(colors.playerBg, colors.playerControlBarFg, 0.75) - - colorFocus: colors.bgFocus } diff --git a/modules/gui/qt/widgets/qml/IconToolButton.qml b/modules/gui/qt/widgets/qml/IconToolButton.qml index 746e295fcf80f27b07cb95271895fe734e1b081a..567e7f425aa695ba2bd9628356e6f3f54df923b9 100644 --- a/modules/gui/qt/widgets/qml/IconToolButton.qml +++ b/modules/gui/qt/widgets/qml/IconToolButton.qml @@ -35,24 +35,9 @@ T.ToolButton { property string iconText: "" - // Style + property color color: (control.checked) ? theme.accent : theme.fg.primary - // background colors - // NOTE: We want the background to be transparent for IconToolButton(s). - property color backgroundColor: "transparent" - property color backgroundColorHover: "transparent" - - // foreground colors based on state - property color color: VLCStyle.colors.icon - property color colorHover: VLCStyle.colors.buttonTextHover - property color colorHighlighted: VLCStyle.colors.accent - property color colorDisabled: paintOnly ? color : VLCStyle.colors.textInactive - - // Aliases - - - // active border color - property color colorFocus: VLCStyle.colors.bgFocus + property color backgroundColor: theme.bg.primary // Settings @@ -77,34 +62,28 @@ T.ToolButton { T.ToolTip.text: control.text T.ToolTip.delay: VLCStyle.delayToolTipAppear + readonly property ColorContext colorContext : ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + enabled: control.paintOnly || control.enabled + focused: control.visualFocus + hovered: control.hovered + pressed: control.down + } + background: AnimatedBackground { implicitWidth: size implicitHeight: size + animate: theme.initialized + active: control.visualFocus - backgroundColor: { - if (control.hovered) - return control.backgroundColorHover; - // if base color is transparent, animation starts with black color - else if (control.backgroundColor.a === 0) - return VLCStyle.colors.setColorAlpha(control.backgroundColorHover, 0); - else - return control.backgroundColor; - } - - foregroundColor: { - if (control.highlighted) - return control.colorHighlighted; - else if (control.hovered) - return control.colorHover; - else if (!control.enabled) - return control.colorDisabled; - else - return control.color; - } - - activeBorderColor: control.colorFocus + backgroundColor: control.backgroundColor + foregroundColor: control.color + + activeBorderColor: theme.visualFocus } contentItem: T.Label { @@ -115,7 +94,7 @@ T.ToolButton { text: iconText - color: background ? background.foregroundColor : control.color + color: control.background.foregroundColor font.pixelSize: control.size font.family: VLCIcons.fontFamily diff --git a/modules/gui/qt/widgets/qml/IconTrackButton.qml b/modules/gui/qt/widgets/qml/IconTrackButton.qml index c9d922474440d8c61b25b7f3c88136d9b09d4df9..5d7e1f6cde5148982b077363cd07bf735d0ddae3 100644 --- a/modules/gui/qt/widgets/qml/IconTrackButton.qml +++ b/modules/gui/qt/widgets/qml/IconTrackButton.qml @@ -25,7 +25,4 @@ import "qrc:///style/" IconToolButton { // Style size: VLCStyle.icon_track - color: VLCStyle.colors.white - colorHover: VLCStyle.colors.buttonBannerDark - colorFocus: VLCStyle.colors.white } diff --git a/modules/gui/qt/widgets/qml/ImageToolButton.qml b/modules/gui/qt/widgets/qml/ImageToolButton.qml index 6b8ada8f93db9c305f40321051c4e9e8ed8914ad..89e51549be6005129c26d43bebf9e9d18bfce2c1 100644 --- a/modules/gui/qt/widgets/qml/ImageToolButton.qml +++ b/modules/gui/qt/widgets/qml/ImageToolButton.qml @@ -31,18 +31,6 @@ T.ToolButton { property size sourceSize: Qt.size(VLCStyle.icon_normal, VLCStyle.icon_normal) - // background colors - // NOTE: We want the background to be transparent for IconToolButton(s). - property color backgroundColor: "transparent" - property color backgroundColorHover: "transparent" - - property color color: VLCStyle.colors.icon - property color colorHover: VLCStyle.colors.buttonTextHover - property color colorHighlighted: VLCStyle.colors.accent - property color colorDisabled: paintOnly ? color : VLCStyle.colors.textInactive - property color colorFocus: VLCStyle.colors.bgFocus - - padding: 0 enabled: !paintOnly @@ -55,34 +43,26 @@ T.ToolButton { Keys.priority: Keys.AfterItem Keys.onPressed: Navigation.defaultKeyAction(event) + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + enabled: control.enabled || control.paintOnly + focused: control.visualFocus + hovered: control.hovered + pressed: control.down + } + background: AnimatedBackground { width: control.sourceSize.width height: control.sourceSize.height active: control.visualFocus + animate: theme.initialized - backgroundColor: { - if (control.hovered) - return control.backgroundColorHover; - // if base color is transparent, animation starts with black color - else if (control.backgroundColor.a === 0) - return VLCStyle.colors.setColorAlpha(control.backgroundColorHover, 0); - else - return control.backgroundColor; - } - - foregroundColor: { - if (control.highlighted) - return control.colorHighlighted; - else if (control.hovered) - return control.colorHover; - else if (!control.enabled) - return control.colorDisabled; - else - return control.color; - } - - activeBorderColor: control.colorFocus + backgroundColor: theme.bg.primary + foregroundColor: theme.fg.primary + activeBorderColor: theme.visualFocus } contentItem: Image { diff --git a/modules/gui/qt/widgets/qml/KeyNavigableListView.qml b/modules/gui/qt/widgets/qml/KeyNavigableListView.qml index d7c6fc502e8b86a2c40332a615213c3751424fa2..e98b789881daf3598635f3aca6e75f7b0a9536a8 100644 --- a/modules/gui/qt/widgets/qml/KeyNavigableListView.qml +++ b/modules/gui/qt/widgets/qml/KeyNavigableListView.qml @@ -79,6 +79,8 @@ FadingEdgeListView { activeFocusOnTab: true + backgroundColor: theme.bg.primary + //key navigation is reimplemented for item selection keyNavigationEnabled: false @@ -231,6 +233,12 @@ FadingEdgeListView { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + } + + Component { id: sectionHeading @@ -240,13 +248,13 @@ FadingEdgeListView { Text { text: section font.pixelSize: VLCStyle.fontSize_xlarge - color: VLCStyle.colors.accent + color: theme.accent } Rectangle { width: parent.width height: 1 - color: VLCStyle.colors.textDisabled + color: theme.border } } } diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml index f9cc7b24561d06596f4c9c42b9838ffbad4fcb67..e63e61d5d83a84a618b7a1894d0ffa32bf2a40bf 100644 --- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml +++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml @@ -39,6 +39,7 @@ FocusScope { verticalAlignment: Text.AlignVCenter text: model.text || "" + color: parent.colorContext.fg.secondary } // NOTE: We want edge to edge backgrounds in our delegate and header, so we implement our own @@ -67,7 +68,7 @@ FocusScope { property Component header: Item{} property Item headerItem: view.headerItem ? view.headerItem.loadedHeader : null - property color headerColor + property color headerColor: colorContext.bg.primary property int headerTopPadding: 0 property Util.SelectableDelegateModel selectionDelegateModel @@ -129,6 +130,8 @@ FocusScope { property alias count: view.count + property alias colorContext: view.colorContext + // Signals //forwarded from subview @@ -274,8 +277,8 @@ FocusScope { width: view.width height: col.height - color: headerColor z: 3 + color: root.headerColor // with inline header positioning and for `root.header` which changes it's height after loading, // in such cases after `root.header` completes, the ListView will try to maintain the relative contentY, @@ -293,7 +296,7 @@ FocusScope { topPadding: root.headerTopPadding text: view.currentSection - color: VLCStyle.colors.accent + color: view.colorContext.accent verticalAlignment: Text.AlignTop visible: view.headerPositioning === ListView.OverlayHeader && text !== "" @@ -333,13 +336,12 @@ FocusScope { height: VLCStyle.dp(20, VLCStyle.scale) width: VLCStyle.colWidth(modelData.size) || 1 - //Layout.alignment: Qt.AlignVCenter - Loader { anchors.top: parent.top anchors.bottom: parent.bottom property var model: modelData.model + readonly property ColorContext colorContext: view.colorContext sourceComponent: model.headerDelegate || root.tableHeaderDelegate } @@ -348,7 +350,8 @@ FocusScope { text: (root.model.sortOrder === Qt.AscendingOrder) ? "▼" : "▲" visible: root.model.sortCriteria === modelData.criteria font.pixelSize: VLCStyle.fontSize_normal - color: VLCStyle.colors.accent + color: root.colorContext.accent + anchors { top: parent.top bottom: parent.bottom @@ -384,8 +387,7 @@ FocusScope { topPadding: VLCStyle.margin_xsmall text: section - - color: VLCStyle.colors.accent + color: root.colorContext.accent } delegate: TableViewDelegate { diff --git a/modules/gui/qt/widgets/qml/ListItem.qml b/modules/gui/qt/widgets/qml/ListItem.qml index 5c99856ffe56144eee2809d7a4e90237d5ce46fb..21c27ea1dbb7f5b0a5a381a1d242f6e7f5541568 100644 --- a/modules/gui/qt/widgets/qml/ListItem.qml +++ b/modules/gui/qt/widgets/qml/ListItem.qml @@ -48,6 +48,11 @@ FocusScope { Accessible.role: Accessible.ListItem Accessible.name: line1 + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + } + Component { id: actionAdd IconToolButton { @@ -87,9 +92,7 @@ FocusScope { Rectangle { id: linerect anchors.fill: parent - color: VLCStyle.colors.getBgColor( - root.selected, root.hovered, - root.activeFocus) + color: theme.border MouseArea { id: mouse @@ -129,7 +132,7 @@ FocusScope { Text { id: cover_text anchors.centerIn: parent - color: VLCStyle.colors.textInactive + color: theme.fg.secondary font.pixelSize: VLCStyle.fontSize_xsmall } } @@ -154,7 +157,7 @@ FocusScope { width: parent.width elide: Text.ElideRight - color: VLCStyle.colors.text + color: theme.fg.primary font.pixelSize: VLCStyle.fontSize_normal enabled: text !== "" } @@ -162,7 +165,7 @@ FocusScope { id: line2_text width: parent.width elide: Text.ElideRight - color: VLCStyle.colors.textInactive + color: theme.fg.secondary font.pixelSize: VLCStyle.fontSize_small visible: text !== "" enabled: text !== "" diff --git a/modules/gui/qt/widgets/qml/LocalTabBar.qml b/modules/gui/qt/widgets/qml/LocalTabBar.qml index ebb0f1c7e64150c05fa0c1142e0dfc80e528d67f..446bb3f8070af7b6f9f1d98c8ff10ee3d9de8ed4 100644 --- a/modules/gui/qt/widgets/qml/LocalTabBar.qml +++ b/modules/gui/qt/widgets/qml/LocalTabBar.qml @@ -33,7 +33,6 @@ NavigableRow { selected: model.name === row.currentView.name showCurrentIndicator: false height: VLCStyle.localToolbar_height - color: VLCStyle.colors.lowerBanner onClicked: row.clicked(index) } } diff --git a/modules/gui/qt/widgets/qml/MediaCover.qml b/modules/gui/qt/widgets/qml/MediaCover.qml index 0f542e5cb66d730baf5fd510cd6c44b1a720dca4..6e660d63a169e4da8f1d5bb6b080f8cb403f15e0 100644 --- a/modules/gui/qt/widgets/qml/MediaCover.qml +++ b/modules/gui/qt/widgets/qml/MediaCover.qml @@ -56,8 +56,6 @@ Rectangle { height: VLCStyle.listAlbumCover_height width: VLCStyle.listAlbumCover_width - color: VLCStyle.colors.grid - // Children RoundImage { diff --git a/modules/gui/qt/widgets/qml/MenuLabel.qml b/modules/gui/qt/widgets/qml/MenuLabel.qml index bb974838daccab68f49cf08a4d91c508aaf7147a..2b3b4d1761ea9a235a5f823effc2573fd6a343bf 100644 --- a/modules/gui/qt/widgets/qml/MenuLabel.qml +++ b/modules/gui/qt/widgets/qml/MenuLabel.qml @@ -23,7 +23,6 @@ T.Label { elide: Text.ElideRight font.pixelSize: VLCStyle.fontSize_large font.weight: Font.DemiBold - color: VLCStyle.colors.text verticalAlignment: Text.AlignVCenter textFormat: Text.PlainText } diff --git a/modules/gui/qt/widgets/qml/OverlayMenu.qml b/modules/gui/qt/widgets/qml/OverlayMenu.qml index 0a4ada85e4b029370d9e41f5ab6b1652fa336457..97c4c45fc53b8c0a798876003e834ca751ad8386 100644 --- a/modules/gui/qt/widgets/qml/OverlayMenu.qml +++ b/modules/gui/qt/widgets/qml/OverlayMenu.qml @@ -50,8 +50,6 @@ FocusScope { // Example usage can be found in 'Playlist/PlaylistOverlayMenu.qml' file property var model: undefined - property VLCColors colors: VLCStyle.colors - onModelChanged: { listView.currentModel = model listView.resetStack() @@ -79,6 +77,11 @@ FocusScope { } } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + Rectangle { color: "black" anchors { @@ -104,7 +107,7 @@ FocusScope { Rectangle { id: parentItem - color: root.colors.bg + color: theme.bg.primary anchors { top: parent.top @@ -182,7 +185,7 @@ FocusScope { font.pixelSize: VLCStyle.fontSize_xlarge text: listView.currentModel.title - color: colors.text + color: theme.fg.primary leftPadding: root.leftPadding rightPadding: root.rightPadding @@ -261,7 +264,7 @@ FocusScope { IconLabel { horizontalAlignment: Text.AlignHCenter text: modelData.fontIcon - color: colors.text + color: theme.fg.primary } } @@ -270,7 +273,7 @@ FocusScope { ListLabel { horizontalAlignment: Text.AlignHCenter text: "✓" - color: colors.text + color: theme.fg.primary } } @@ -292,7 +295,7 @@ FocusScope { font.weight: Font.Normal text: modelData.text - color: colors.text + color: theme.fg.primary } ListLabel { @@ -306,13 +309,13 @@ FocusScope { : button.yieldsAnotherModel ? "➜" : "" - color: colors.text + color: theme.fg.primary } } } highlight: Rectangle { - color: colors.accent + color: theme.accent opacity: 0.8 } diff --git a/modules/gui/qt/widgets/qml/PlayCover.qml b/modules/gui/qt/widgets/qml/PlayCover.qml index 6de6e8384002c078f1c5df7c239aa20786226148..6e3401ee4bca1c3239630ace9353cd437a635826 100644 --- a/modules/gui/qt/widgets/qml/PlayCover.qml +++ b/modules/gui/qt/widgets/qml/PlayCover.qml @@ -21,6 +21,7 @@ import QtQuick 2.11 import QtQuick.Controls 2.4 +import org.videolan.vlc 0.1 import "qrc:///style/" import "qrc:///widgets/" as Widgets @@ -38,6 +39,11 @@ MouseArea { hoverEnabled: true + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.ToolButton + } + // Animations Behavior on scale { @@ -78,7 +84,7 @@ MouseArea { radius: width - color: VLCStyle.colors.white + color: "white" } Widgets.IconLabel { @@ -86,8 +92,8 @@ MouseArea { text: VLCIcons.play - color: (containsMouse) ? VLCStyle.colors.accent - : VLCStyle.colors.black + color: (containsMouse) ? theme.accent + : "black" font.pixelSize: Math.round(parent.width / 2) } diff --git a/modules/gui/qt/widgets/qml/PointingTooltip.qml b/modules/gui/qt/widgets/qml/PointingTooltip.qml index 1703d9c5a2e35ab2b6b0f8673445ad5648926e4c..ff038d3a238bf100a3d44330bbb22134ca30fb36 100644 --- a/modules/gui/qt/widgets/qml/PointingTooltip.qml +++ b/modules/gui/qt/widgets/qml/PointingTooltip.qml @@ -33,8 +33,8 @@ ToolTipExt { property point pos background: Rectangle { - border.color: colors.border - color: colors.tooltipColor + border.color: pointingTooltip.colorContext.border + color: pointingTooltip.colorContext.bg.primary radius: VLCStyle.dp(6, VLCStyle.scale) Item { @@ -62,8 +62,8 @@ ToolTipExt { rotation: 45 - color: background.color - border.color: background.border.color + color: pointingTooltip.colorContext.bg.primary + border.color: pointingTooltip.colorContext.border } } } diff --git a/modules/gui/qt/widgets/qml/RoundButton.qml b/modules/gui/qt/widgets/qml/RoundButton.qml index aa48eef3e19a3b7843dd24caa379113b18be4ade..72a0576182157e54eb43bbaf62687dd606131ff5 100644 --- a/modules/gui/qt/widgets/qml/RoundButton.qml +++ b/modules/gui/qt/widgets/qml/RoundButton.qml @@ -18,16 +18,27 @@ import QtQuick 2.11 import QtQuick.Controls 2.4 +import org.videolan.vlc 0.1 import "qrc:///style/" Button{ id: control hoverEnabled: true property real size: VLCStyle.icon_normal + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.View + + enabled: control.enabled + focused: control.visualFocus + hovered: control.hovered + } + contentItem: Text { text: control.text font: control.font - color: control.hovered || control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.text + color: theme.fg.primary horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } @@ -36,7 +47,7 @@ Button{ implicitWidth: control.size implicitHeight: control.size opacity: control.hovered ? 1 : 0.5 - color: VLCStyle.colors.bgAlt + color: theme.bg.primary radius: VLCStyle.icon_normal/2 } } diff --git a/modules/gui/qt/widgets/qml/ScanProgressBar.qml b/modules/gui/qt/widgets/qml/ScanProgressBar.qml index f4690601ed0c2b436a683ff1dadb03369dc54c50..447932fca54e19faca5c2a4b2a1b0ad3b829f865 100644 --- a/modules/gui/qt/widgets/qml/ScanProgressBar.qml +++ b/modules/gui/qt/widgets/qml/ScanProgressBar.qml @@ -43,13 +43,19 @@ T.ProgressBar { value: MediaLib.parsingProgress + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + indeterminate: MediaLib.discoveryPending background: Rectangle { - color: VLCStyle.colors.bg + color: theme.bg.primary } contentItem: Column { + spacing: VLCStyle.margin_small Item { @@ -59,6 +65,11 @@ T.ProgressBar { implicitHeight: VLCStyle.heightBar_xxsmall implicitWidth: 200 + ColorContext { + id: progressBarTheme + colorSet: ColorContext.Slider + } + Rectangle { anchors.left: parent.left anchors.right: parent.right @@ -66,7 +77,7 @@ T.ProgressBar { implicitHeight: VLCStyle.heightBar_xxxsmall - color: VLCStyle.colors.sliderBarMiniplayerBgColor + color: progressBarTheme.bg.primary } Rectangle { @@ -80,7 +91,8 @@ T.ProgressBar { visible: !control.indeterminate - color: VLCStyle.colors.accent + + color: progressBarTheme.accent } Rectangle { @@ -96,10 +108,9 @@ T.ProgressBar { // NOTE: We want round corners. radius: height - visible: control.indeterminate - color: VLCStyle.colors.accent + color: progressBarTheme.accent SequentialAnimation on position { loops: Animation.Infinite @@ -138,6 +149,7 @@ T.ProgressBar { font.pixelSize: VLCStyle.fontSize_large font.weight: Font.Normal + color: theme.fg.primary } } } diff --git a/modules/gui/qt/widgets/qml/SearchBox.qml b/modules/gui/qt/widgets/qml/SearchBox.qml index 196563e25f69a2aa9cf38fe9edd3f48d340c7df3..2ceab53d772809ed2bc68d760a4c0c5c3e9bce28 100644 --- a/modules/gui/qt/widgets/qml/SearchBox.qml +++ b/modules/gui/qt/widgets/qml/SearchBox.qml @@ -70,6 +70,9 @@ FocusScope { PropertyAction { property: "focus" } } } + readonly property ColorContext colorContext: ColorContext { + id: theme + } Row { id: content diff --git a/modules/gui/qt/widgets/qml/SortControl.qml b/modules/gui/qt/widgets/qml/SortControl.qml index 41e2aa5799fb0caed230edcc2d5bf439cf6e8641..4ad0476f39f5290527fc0811d46bbcb6f2836b18 100644 --- a/modules/gui/qt/widgets/qml/SortControl.qml +++ b/modules/gui/qt/widgets/qml/SortControl.qml @@ -37,8 +37,6 @@ FocusScope { property real listWidth: VLCStyle.widthSortBox - property VLCColors colors: VLCStyle.colors - // NOTE: This allows us provide a custom menu and override sortMenu. property SortMenu menu @@ -54,6 +52,7 @@ FocusScope { // Aliases + property alias colorContext: button.colorContext property alias checked: button.checked property alias focusPolicy: button.focusPolicy property alias iconSize: button.size diff --git a/modules/gui/qt/widgets/qml/SpinBoxExt.qml b/modules/gui/qt/widgets/qml/SpinBoxExt.qml index 24283be9a0d81951089db2d896042611a8172b35..ad96517dbcb56f2be0e301fea0709604d5343d4c 100644 --- a/modules/gui/qt/widgets/qml/SpinBoxExt.qml +++ b/modules/gui/qt/widgets/qml/SpinBoxExt.qml @@ -31,10 +31,19 @@ SpinBox { leftPadding: padding + (control.mirrored ? up.indicator.width : 0) rightPadding: padding + (control.mirrored ? 0 : up.indicator.width) - property color textColor: VLCStyle.colors.buttonText - property color bgColor: VLCStyle.colors.bg - property color borderColor: VLCStyle.colors.buttonBorder - property int borderWidth: 0 + property color textColor: theme.fg.primary + property color bgColor: theme.bg.primary + property color borderColor: theme.border + property int borderWidth: VLCStyle.border + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.SpinBox + + enabled: control.enabled + focused: control.visualFocus + hovered: control.hovered + } Keys.priority: Keys.AfterItem Keys.onPressed: Navigation.defaultKeyAction(event) @@ -62,7 +71,7 @@ SpinBox { text: control.textFromValue(control.value, control.locale) font: control.font - color: enabled ? control.textColor : "grey" + color: upTheme.fg.primary padding: 0 horizontalAlignment: Qt.AlignRight @@ -88,13 +97,23 @@ SpinBox { implicitWidth: VLCStyle.dp(15, VLCStyle.scale) implicitHeight: VLCStyle.dp(10, VLCStyle.scale) anchors.top: parent.top - color: control.up.pressed ? VLCStyle.colors.bgHover : control.bgColor - border.color: control.borderColor + + color: downTheme.bg.primary + + ColorContext { + id: upTheme + colorSet: ColorContext.ButtonStandard + + enabled: control.enabled + focused: control.up.visualFocus + hovered: control.up.hovered + pressed: control.up.pressed + } Text { text: "\u2227" // ^ logical AND font.pixelSize: control.font.pixelSize * 2 - color: control.textColor + color: upTheme.fg.primary font.bold: true anchors.fill: parent fontSizeMode: Text.Fit @@ -109,13 +128,23 @@ SpinBox { implicitWidth: VLCStyle.dp(15, VLCStyle.scale) implicitHeight: VLCStyle.dp(10, VLCStyle.scale) anchors.bottom: parent.bottom - color: control.down.pressed ? VLCStyle.colors.bgHover : control.bgColor - border.color: control.borderColor + color: downTheme.bg.primary + + ColorContext { + id: downTheme + colorSet: ColorContext.ButtonStandard + + enabled: control.enabled + focused: control.down.visualFocus + hovered: control.down.hovered + pressed: control.down.pressed + } Text { text: "\u2228" // ^ logical OR font.pixelSize: control.font.pixelSize * 2 - color: control.textColor + color: downTheme.fg.primary + font.bold: true anchors.fill: parent fontSizeMode: Text.Fit horizontalAlignment: Text.AlignHCenter diff --git a/modules/gui/qt/widgets/qml/TableColumns.qml b/modules/gui/qt/widgets/qml/TableColumns.qml index 52e2de374f90382a32fffe9125a09a1e008b6018..053a55162dd30decb766a216dcc5f2f5980adc50 100644 --- a/modules/gui/qt/widgets/qml/TableColumns.qml +++ b/modules/gui/qt/widgets/qml/TableColumns.qml @@ -91,7 +91,8 @@ Item { readonly property bool containsMouse: parent.containsMouse readonly property bool currentlyFocused: parent.currentlyFocused - readonly property color foregroundColor: parent.foregroundColor + readonly property ColorContext colorContext: parent.colorContext + readonly property bool selected: parent.selected anchors.fill: parent spacing: VLCStyle.margin_normal @@ -120,6 +121,7 @@ Item { playIconSize: VLCStyle.play_cover_small onPlayIconClicked: g_mainDisplay.play(MediaLib, titleDel.rowModel.id) radius: root.titleCover_radius + color: titleDel.colorContext.bg.secondary imageOverlay: Item { width: cover.width @@ -171,7 +173,11 @@ Item { text: (titleDel.rowModel && root.showTitleText) ? (titleDel.rowModel[titleDel.model.criteria] || I18n.qtr("Unknown Title")) : "" - color: titleDel.foregroundColor + + color: titleDel.selected + ? titleDel.colorContext.fg.highlight + : titleDel.colorContext.fg.primary + } } @@ -184,6 +190,10 @@ Item { visible: root.showCriterias text: (visible) ? root.getCriterias(titleDel.model, titleDel.rowModel) : "" + + color: titleDel.selected + ? titleDel.colorContext.fg.highlight + : titleDel.colorContext.fg.secondary } } } @@ -191,6 +201,7 @@ Item { property Component titleHeaderDelegate: Row { id: titleHeadDel property var model: parent.colModel + readonly property ColorContext colorContext: parent.colorContext spacing: VLCStyle.margin_normal @@ -200,9 +211,9 @@ Item { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: VLCStyle.icon_tableHeader - color: VLCStyle.colors.caption text: VLCIcons.album_cover + color: titleHeadDel.colorContext.fg.secondary } Widgets.CaptionLabel { @@ -210,6 +221,8 @@ Item { verticalAlignment: Text.AlignVCenter height: parent.height + color: titleHeadDel.colorContext.fg.secondary + text: titleHeadDel.model ? titleHeadDel.model.text || "" : "" @@ -223,7 +236,7 @@ Item { verticalAlignment: Text.AlignVCenter text: VLCIcons.time font.pixelSize: VLCStyle.icon_tableHeader - color: VLCStyle.colors.caption + color: parent.colorContext.fg.secondary } property Component timeColDelegate: Item { @@ -231,7 +244,8 @@ Item { property var rowModel: parent.rowModel property var model: parent.colModel - property color foregroundColor: parent.foregroundColor + readonly property bool selected: parent.selected + readonly property ColorContext colorContext: parent.colorContext Widgets.ListLabel { width: timeTextMetric.width @@ -240,7 +254,9 @@ Item { text: (!timeDel.rowModel || !timeDel.rowModel[timeDel.model.criteria]) ? "" : timeDel.rowModel[timeDel.model.criteria].formatShort() - color: timeDel.foregroundColor + color: timeDel.selected + ? timeDel.colorContext.fg.highlight + : timeDel.colorContext.fg.primary } } diff --git a/modules/gui/qt/widgets/qml/TableViewDelegate.qml b/modules/gui/qt/widgets/qml/TableViewDelegate.qml index ca21e5e285c7368868137c4a72964fa7083fbc1e..19bf0cf4f1efc058428246432f29a2618c7c8103 100644 --- a/modules/gui/qt/widgets/qml/TableViewDelegate.qml +++ b/modules/gui/qt/widgets/qml/TableViewDelegate.qml @@ -21,6 +21,7 @@ import QtQuick.Templates 2.4 as T import QtQuick.Layouts 1.3 import org.videolan.compat 0.1 +import org.videolan.vlc 0.1 import "qrc:///widgets/" as Widgets import "qrc:///style/" @@ -60,7 +61,8 @@ T.Control { id: defaultDelId property var rowModel: parent.rowModel property var colModel: parent.colModel - property color foregroundColor: parent.foregroundColor + readonly property ColorContext colorContext: parent.colorContext + readonly property bool selected: parent.selected label: text forceScroll: parent.currentlyFocused @@ -74,13 +76,16 @@ T.Control { text: defaultDelId.rowModel ? (defaultDelId.rowModel[defaultDelId.colModel.criteria] || "") : "" - color: defaultDelId.foregroundColor + + color: defaultDelId.selected + ? defaultDelId.colorContext.fg.highlight + : defaultDelId.colorContext.fg.primary } } // Settings hoverEnabled: true - + ListView.delayRemove: dragActive Component.onCompleted: { @@ -89,19 +94,21 @@ T.Control { // Childs + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Item + + focused: delegate.visualFocus + hovered: delegate.hovered + } + background: AnimatedBackground { active: visualFocus animationDuration: VLCStyle.duration_short - - backgroundColor: { - if (delegate.selected) - return VLCStyle.colors.gridSelect; - else if (delegate.hovered) - return VLCStyle.colors.listHover; - else - return VLCStyle.colors.setColorAlpha(VLCStyle.colors.listHover, 0); - } + animate: theme.initialized + backgroundColor: delegate.selected ? theme.bg.highlight : theme.bg.primary + activeBorderColor: theme.visualFocus MouseArea { id: hoverArea @@ -189,9 +196,11 @@ T.Control { readonly property bool currentlyFocused: delegate.activeFocus + readonly property bool selected: delegate.selected + readonly property bool containsMouse: hoverArea.containsMouse - readonly property color foregroundColor: delegate.background.foregroundColor + readonly property ColorContext colorContext: theme width: (modelData.size) ? VLCStyle.colWidth(modelData.size) : 0 diff --git a/modules/gui/qt/widgets/qml/TextFieldExt.qml b/modules/gui/qt/widgets/qml/TextFieldExt.qml index 805f25a4c843325a1d1a8d319f9297db3db57af8..a3edc7c2cf6d13cc509671408f086c254fd584f2 100644 --- a/modules/gui/qt/widgets/qml/TextFieldExt.qml +++ b/modules/gui/qt/widgets/qml/TextFieldExt.qml @@ -26,17 +26,26 @@ import "qrc:///style/" TextField { id: control - selectedTextColor : VLCStyle.colors.bgHoverText - selectionColor : VLCStyle.colors.bgHover - color : VLCStyle.colors.text + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.TextField + + focused: control.activeFocus + hovered: control.hovered + enabled: control.enabled + } + + selectedTextColor : theme.fg.highlight + selectionColor : theme.bg.highlight + color : theme.fg.primary font.pixelSize: VLCStyle.fontSize_normal background: Rectangle { implicitWidth: 200 implicitHeight: 40 border.width: control.enabled ? VLCStyle.dp(2, VLCStyle.scale) : 0 - color: VLCStyle.colors.bgAlt - border.color: control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.buttonBorder + color: theme.bg.primary + border.color: theme.border } } diff --git a/modules/gui/qt/widgets/qml/TextToolButton.qml b/modules/gui/qt/widgets/qml/TextToolButton.qml index 5eade57fbb343e809e69e5ff9c20a8ea905c9c33..73ddcf65b4b1ead24190fb83da6c2e64110af77a 100644 --- a/modules/gui/qt/widgets/qml/TextToolButton.qml +++ b/modules/gui/qt/widgets/qml/TextToolButton.qml @@ -38,18 +38,28 @@ T.ToolButton { Keys.onPressed: Navigation.defaultKeyAction(event) + readonly property ColorContext colorContext : ColorContext { + id: theme + colorSet: ColorContext.ToolButton + + enabled: control.enabled + focused: control.visualFocus + hovered: control.hovered + pressed: control.down + } + contentItem: T.Label { text: control.text font: control.font - color: VLCStyle.colors.text + color: theme.fg.primary verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } background: AnimatedBackground { + animate: theme.initialized active: visualFocus - - backgroundColor: control.hovered ? VLCStyle.colors.buttonHover - : VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0) + backgroundColor: theme.bg.primary + activeBorderColor: theme.visualFocus } } diff --git a/modules/gui/qt/widgets/qml/ToolTipExt.qml b/modules/gui/qt/widgets/qml/ToolTipExt.qml index b6de855ea88cd82bba5e2e89dc28cc13e5e57c2a..2a3ea26318ba05eccc58851f909b1fbcc3b5eae9 100644 --- a/modules/gui/qt/widgets/qml/ToolTipExt.qml +++ b/modules/gui/qt/widgets/qml/ToolTipExt.qml @@ -19,6 +19,7 @@ import QtQuick 2.11 import QtQuick.Templates 2.4 as T +import org.videolan.vlc 0.1 import "qrc:///style/" T.ToolTip { @@ -39,17 +40,20 @@ T.ToolTip { closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent - property VLCColors colors: VLCStyle.colors + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Tooltip + } contentItem: Text { text: control.text font: control.font - color: colors.tooltipTextColor + color: theme.fg.primary } background: Rectangle { - border.color: colors.border - color: colors.tooltipColor + border.color: theme.border + color: theme.bg.primary } } diff --git a/modules/gui/qt/widgets/qml/VideoProgressBar.qml b/modules/gui/qt/widgets/qml/VideoProgressBar.qml index 086c4eb8fbbb79a1aaaf11536e9cc5fe5c24d6de..f1dec10d28c61c9e37ea48f8f6a8dcd1d13c3de8 100644 --- a/modules/gui/qt/widgets/qml/VideoProgressBar.qml +++ b/modules/gui/qt/widgets/qml/VideoProgressBar.qml @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ import QtQuick 2.11 +import org.videolan.vlc 0.1 import "qrc:///style/" //we want the progress bar to match the radius of the of the video thumbnail @@ -31,6 +32,11 @@ Item { property real value: 0 property int radius: implicitHeight + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Slider + } + Rectangle { anchors.left: parent.left @@ -40,6 +46,7 @@ Item { height: Math.max(progressBar.radius * 2, //to have at least the proper radius applied parent.height + radius) //the top radius section should be always clipped + //FIXME do we want it always white or do we want it to change with the theme color: "white" radius: progressBar.radius @@ -59,7 +66,7 @@ Item { anchors.bottom: parent.bottom anchors.left: parent.left - color: VLCStyle.colors.accent + color: theme.fg.primary radius: progressBar.radius } } diff --git a/modules/gui/qt/widgets/qml/VideoQualityLabels.qml b/modules/gui/qt/widgets/qml/VideoQualityLabels.qml index a49e876c6d3069fc5966300d79c951fa241bb5e8..faf16e1239a6d84ed6ad09dc280fab0c8baa8cbd 100644 --- a/modules/gui/qt/widgets/qml/VideoQualityLabels.qml +++ b/modules/gui/qt/widgets/qml/VideoQualityLabels.qml @@ -18,6 +18,7 @@ import QtQuick 2.11 import QtQuick.Templates 2.4 as T +import org.videolan.vlc 0.1 import "qrc:///style/" Row { @@ -25,22 +26,30 @@ Row { spacing: VLCStyle.margin_xxsmall + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Badge + } + Repeater { id: repeater delegate: T.Label { id: label - text: modelData - color: "white" bottomPadding: VLCStyle.margin_xxxsmall topPadding: VLCStyle.margin_xxxsmall leftPadding: VLCStyle.margin_xxxsmall rightPadding: VLCStyle.margin_xxxsmall + + text: modelData font.pixelSize: VLCStyle.fontSize_normal + + color: theme.fg.primary + background: Rectangle { anchors.fill: label - color: "black" + color: theme.bg.primary opacity: 0.5 radius: VLCStyle.dp(3, VLCStyle.scale) }