From 83081d7e18a5144e4503a0d44c66ebdad624b4f6 Mon Sep 17 00:00:00 2001 From: xionglinlin Date: Tue, 3 Sep 2024 19:13:47 +0800 Subject: [PATCH] fix: update the color of a darg-and-drop in FreeSortList same color as the hover Log: update the color Bug: https://pms.uniontech.com/bug-view-271431.html --- qml/Helper.qml | 16 ++++++++++++++++ qml/windowed/FreeSortListView.qml | 5 +++-- qml/windowed/ItemBackground.qml | 17 +++-------------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/qml/Helper.qml b/qml/Helper.qml index 462c67f9..2ccc4acc 100644 --- a/qml/Helper.qml +++ b/qml/Helper.qml @@ -4,6 +4,7 @@ pragma Singleton import QtQuick 2.0 +import org.deepin.dtk 1.0 as D QtObject { property QtObject windowed :QtObject { @@ -23,4 +24,19 @@ QtObject { property int cellPaddingColumns: 14 property int cellPaddingRows: 6 } + + property D.Palette itemBackground: D.Palette { + normal { + common: Qt.rgba(0, 0, 0, 0.1) + crystal: Qt.rgba(0, 0, 0, 0.1) + } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered { + common: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) + crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) + } + } } diff --git a/qml/windowed/FreeSortListView.qml b/qml/windowed/FreeSortListView.qml index e1670a51..d104226a 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -136,10 +136,11 @@ Item { x : 10 width: bg.width height: indicatorDefaultHeight - color: "lightgray" visible: showDropIndicator radius: height > indicatorDefaultHeight ? 8 : 1 - opacity: 0.5 + + property Palette background: Helper.itemBackground + color: dropIndicator.ColorSelector.background } ItemDelegate { diff --git a/qml/windowed/ItemBackground.qml b/qml/windowed/ItemBackground.qml index 50aed731..7fae0f48 100644 --- a/qml/windowed/ItemBackground.qml +++ b/qml/windowed/ItemBackground.qml @@ -6,23 +6,12 @@ import QtQuick 2.15 import org.deepin.dtk 1.0 as D import org.deepin.dtk.style 1.0 as DS +import org.deepin.launchpad 1.0 + D.BoxPanel { id: control property Item button - property D.Palette background: D.Palette { - normal { - common: Qt.rgba(0, 0, 0, 0.1) - crystal: Qt.rgba(0, 0, 0, 0.1) - } - normalDark { - common: Qt.rgba(1, 1, 1, 0.1) - crystal: Qt.rgba(1, 1, 1, 0.1) - } - hovered { - common: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) - crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) - } - } + property D.Palette background: Helper.itemBackground implicitWidth: DS.Style.toolButton.width implicitHeight: DS.Style.toolButton.height