From 416755758b029c69d423d2a497b81e73c0744945 Mon Sep 17 00:00:00 2001 From: rewine Date: Thu, 18 Apr 2024 14:42:18 +0800 Subject: [PATCH] fix: use more lighter background for item log: https://github.com/linuxdeepin/developer-center/issues/7935 --- qml/windowed/AppListView.qml | 7 +++---- qml/windowed/CMakeLists.txt | 1 + qml/windowed/FreeSortListView.qml | 5 ++--- qml/windowed/IconItemDelegate.qml | 16 +++++++++++++++- qml/windowed/ItemBackground.qml | 25 +++++++++++++++++++++++++ qml/windowed/SideBar.qml | 8 ++++++++ 6 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 qml/windowed/ItemBackground.qml diff --git a/qml/windowed/AppListView.qml b/qml/windowed/AppListView.qml index bd226c45..1d88c183 100644 --- a/qml/windowed/AppListView.qml +++ b/qml/windowed/AppListView.qml @@ -110,6 +110,8 @@ Item { } } + background: ItemBackground { } + MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton @@ -205,10 +207,7 @@ Item { } } - background: BoxPanel { - visible: ColorSelector.controlState === DTK.HoveredState - outsideBorderColor: null - } + background: ItemBackground { } } } } diff --git a/qml/windowed/CMakeLists.txt b/qml/windowed/CMakeLists.txt index c8d34c16..178b5582 100644 --- a/qml/windowed/CMakeLists.txt +++ b/qml/windowed/CMakeLists.txt @@ -23,4 +23,5 @@ qt_add_qml_module(launcher-qml-windowed RecentlyInstalledView.qml FrequentlyUsedView.qml SearchResultView.qml + ItemBackground.qml ) diff --git a/qml/windowed/FreeSortListView.qml b/qml/windowed/FreeSortListView.qml index 11eb56fb..701a8b8b 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -6,6 +6,7 @@ import QtQuick 2.15 import QtQml.Models 2.15 import QtQuick.Controls 2.15 as QQC2 import org.deepin.dtk 1.0 +import org.deepin.dtk.style 1.0 as DS import org.deepin.launchpad 1.0 import org.deepin.launchpad.models 1.0 @@ -147,10 +148,8 @@ Item { "text/x-dde-launcher-dnd-desktopId": model.desktopId } - background: BoxPanel { + background: ItemBackground { id: bg - visible: ColorSelector.controlState === DTK.HoveredState - outsideBorderColor: null } MouseArea { diff --git a/qml/windowed/IconItemDelegate.qml b/qml/windowed/IconItemDelegate.qml index 935bd6c6..c8ca92fd 100644 --- a/qml/windowed/IconItemDelegate.qml +++ b/qml/windowed/IconItemDelegate.qml @@ -70,8 +70,22 @@ Control { ToolTip.visible: hovered background: ButtonPanel { button: parent - outsideBorderColor: null radius: 8 + insideBorderColor: null + outsideBorderColor: null + property Palette background: Palette { + normal { + crystal: Qt.rgba(0, 0, 0, 0.1) + } + normalDark { + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered { + crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) + } + } + color1: background + color2: background } onClicked: { diff --git a/qml/windowed/ItemBackground.qml b/qml/windowed/ItemBackground.qml new file mode 100644 index 00000000..aad23cb6 --- /dev/null +++ b/qml/windowed/ItemBackground.qml @@ -0,0 +1,25 @@ +import QtQuick 2.15 +import org.deepin.dtk 1.0 as D +import org.deepin.dtk.style 1.0 as DS + +D.BoxPanel { + visible: D.ColorSelector.controlState === D.DTK.HoveredState + outsideBorderColor: null + insideBorderColor: null + implicitWidth: DS.Style.toolButton.width + implicitHeight: DS.Style.toolButton.height + + property D.Palette background: D.Palette { + normal { + crystal: Qt.rgba(0, 0, 0, 0.1) + } + normalDark { + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered { + crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1) + } + } + color1: background + color2: background +} diff --git a/qml/windowed/SideBar.qml b/qml/windowed/SideBar.qml index 4ca3a128..ebcdd9cf 100644 --- a/qml/windowed/SideBar.qml +++ b/qml/windowed/SideBar.qml @@ -15,6 +15,7 @@ import org.deepin.launchpad 1.0 import org.deepin.launchpad.models 1.0 ColumnLayout { + id: root spacing: 10 property bool isFreeSort: CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.FreeCategory @@ -114,6 +115,8 @@ ColumnLayout { } } + background: ItemBackground { } + onClicked: { const menu = categorizedCom.createObject(this); menu.popup(this, Qt.point(title.x, title.y)); @@ -137,6 +140,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showUrl("computer:///") } + background: ItemBackground { } } D.ToolButton { @@ -152,6 +156,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.PicturesLocation) } + background: ItemBackground { } } D.ToolButton { @@ -167,6 +172,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.DocumentsLocation) } + background: ItemBackground { } } D.ToolButton { @@ -182,6 +188,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.DesktopLocation) } + background: ItemBackground { } } D.ToolButton { @@ -197,6 +204,7 @@ ColumnLayout { onClicked: { DesktopIntegration.openSystemSettings(); } + background: ItemBackground { } } Item {