From f46521509b9ebb96875384e8f56c96895f4c5fa0 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Thu, 22 Feb 2024 09:37:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(edit-mode):=20=E5=85=A8=E5=B1=8F=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=9B=BE=E6=A0=87=E9=80=82=E9=85=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/FullScreenAppList.qml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/qml/AppUI/FullScreenAppList.qml b/qml/AppUI/FullScreenAppList.qml index acc4f45..47cb514 100644 --- a/qml/AppUI/FullScreenAppList.qml +++ b/qml/AppUI/FullScreenAppList.qml @@ -109,6 +109,36 @@ ListView { Drag.hotSpot.x: width / 2 Drag.hotSpot.y: height / 2 Drag.mimeData: {"id": model.id, "favorite": model.favorite > 0} + + // 收藏按钮 + Loader { + property bool isFavorited: model.favorite > 0 + anchors.top: parent.top + anchors.topMargin: 10 + anchors.right: parent.right + anchors.rightMargin: 28 + + width: 28 + height: 28 + + active: mainWindow.editMode + sourceComponent: Component { + UkuiItems.Button { + icon.width: 16 + icon.height: 16 + background.paletteRole: Platform.Theme.Light + background.alpha: 1 + activeFocusOnTab: false + + onClicked: { + appManager.changeFavoriteState(id, !isFavorited); + } + + background.radius: width / 2 + icon.source: isFavorited ? "ukui-cancel-star-symbolic" : "non-starred-symbolic" + } + } + } } } }