fix(edit-mode): 全屏应用图标适配编辑模式状态
This commit is contained in:
parent
4edd1ad83a
commit
f46521509b
|
@ -109,6 +109,36 @@ ListView {
|
||||||
Drag.hotSpot.x: width / 2
|
Drag.hotSpot.x: width / 2
|
||||||
Drag.hotSpot.y: height / 2
|
Drag.hotSpot.y: height / 2
|
||||||
Drag.mimeData: {"id": model.id, "favorite": model.favorite > 0}
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue