[vlc-devel] [PATCH 16/55] qml: rename playlist color variables
Fatih Uzunoglu
fuzun54 at outlook.com
Thu Jan 7 21:36:29 UTC 2021
---
modules/gui/qt/playlist/qml/PlaylistDelegate.qml | 10 ++++++++++
modules/gui/qt/playlist/qml/PlaylistListView.qml | 1 -
modules/gui/qt/style/VLCColors.qml | 16 +++-------------
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
index 729ab57c35..9f04634aa8 100644
--- a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
@@ -67,6 +67,16 @@ Rectangle {
}
+ color: {
+ if (selected)
+ colors.plItemSelected
+ else if (hovered)
+ colors.plItemHovered
+ else if (activeFocus)
+ colors.plItemFocused
+ else
+ return "transparent"
+ }
function isDropAcceptable(drop, index) {
console.assert(false, "parent should reimplement this function")
}
diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index 136b13b6f5..72057d285d 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -378,7 +378,6 @@ Widgets.NavigableFocusScope {
contextMenu.popup(index, globalMousePos)
}
onItemDoubleClicked: mainPlaylistController.goTo(index, true)
- color: colors.getPLItemColor(model.selected, plitem.hovered, plitem.activeFocus)
colors: root.colors
onDragStarting: {
diff --git a/modules/gui/qt/style/VLCColors.qml b/modules/gui/qt/style/VLCColors.qml
index 9e836119ed..a0b6ab57ea 100644
--- a/modules/gui/qt/style/VLCColors.qml
+++ b/modules/gui/qt/style/VLCColors.qml
@@ -89,19 +89,9 @@ Item {
property color roundPlayCoverBorder: "#979797"
// playlist
- property color playlistSeparator: isThemeDark ? "white" : "#f2f2f2"
- property color plItemHover_Focus: bannerHover
- property color plItemSelect: isThemeDark ? "#1E1E1E" : "#EDEDED"
-
- function getPLItemColor(selected, hovered, focus)
- {
- if (hovered || focus)
- return plItemHover_Focus
- else if ( selected )
- return plItemSelect
- else
- return "transparent"
- }
+ property color plItemHovered: bannerHover
+ property color plItemSelected: isThemeDark ? "#1E1E1E" : "#EDEDED"
+ property color plItemFocused: blendColors(plItemSelected, plItemHovered, 0.25)
// basic color definitions for color blending:
property color black: "black"
--
2.27.0
More information about the vlc-devel
mailing list