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" + } + } + } } } }