fix(edit-mode): 全屏应用图标适配编辑模式状态

This commit is contained in:
hewenfei 2024-02-22 09:37:36 +08:00
parent 4edd1ad83a
commit f46521509b
1 changed files with 30 additions and 0 deletions

View File

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