[vlc-commits] qml: rename playlist color variables
Fatih Uzunoglu
git at videolan.org
Tue Jan 12 13:20:27 UTC 2021
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Jan 8 00:36:29 2021 +0300| [84b301b4956627e2edd560dda9f3a9333bca1795] | committer: Pierre Lamot
qml: rename playlist color variables
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=84b301b4956627e2edd560dda9f3a9333bca1795
---
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"
More information about the vlc-commits
mailing list