From 49e2d2aabc0bf36b275934a3cfc3477c18e498c9 Mon Sep 17 00:00:00 2001 From: Wang Zichong Date: Thu, 23 Nov 2023 14:19:32 +0800 Subject: [PATCH] fix(UI): add hover state for AppListView items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 给小窗口启动器左侧列表视图的项目增加 hover 效果。 Issue: https://github.com/linuxdeepin/developer-center/issues/6205 Log: --- qml/WindowedFrame.qml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qml/WindowedFrame.qml b/qml/WindowedFrame.qml index 5e9f7fce..333f6902 100644 --- a/qml/WindowedFrame.qml +++ b/qml/WindowedFrame.qml @@ -8,6 +8,7 @@ import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 import org.deepin.dtk 1.0 +import org.deepin.dtk.private 1.0 as P import org.deepin.launchpad 1.0 @@ -45,8 +46,9 @@ StackView { text: model.display checkable: false icon.name: iconName + width: appListView.width // icon.source: "image://app-icon/" + iconName; - backgroundVisible: false + ColorSelector.family: Palette.CrystalColor TapHandler { acceptedButtons: Qt.RightButton @@ -55,17 +57,18 @@ StackView { } } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - launchApp(desktopId) - } + onClicked: { + launchApp(desktopId) } Keys.onReturnPressed: { launchApp(desktopId) } + + background: P.ButtonPanel { + button: parent + visible: ColorSelector.controlState === DTK.HoveredState + } } }