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..5a2e9a6b 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -147,10 +147,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..c22ead96 100644 --- a/qml/windowed/IconItemDelegate.qml +++ b/qml/windowed/IconItemDelegate.qml @@ -68,9 +68,7 @@ Control { ToolTip.text: root.text ToolTip.delay: 1000 ToolTip.visible: hovered - background: ButtonPanel { - button: parent - outsideBorderColor: null + background: ItemBackground { radius: 8 } 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..c7b9ccbe 100644 --- a/qml/windowed/SideBar.qml +++ b/qml/windowed/SideBar.qml @@ -114,6 +114,8 @@ ColumnLayout { } } + background: ItemBackground { } + onClicked: { const menu = categorizedCom.createObject(this); menu.popup(this, Qt.point(title.x, title.y)); @@ -137,6 +139,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showUrl("computer:///") } + background: ItemBackground { } } D.ToolButton { @@ -152,6 +155,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.PicturesLocation) } + background: ItemBackground { } } D.ToolButton { @@ -167,6 +171,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.DocumentsLocation) } + background: ItemBackground { } } D.ToolButton { @@ -182,6 +187,7 @@ ColumnLayout { onClicked: { DesktopIntegration.showFolder(StandardPaths.DesktopLocation) } + background: ItemBackground { } } D.ToolButton { @@ -197,6 +203,7 @@ ColumnLayout { onClicked: { DesktopIntegration.openSystemSettings(); } + background: ItemBackground { } } Item {