2024-02-06 09:54:18 +08:00
|
|
|
import QtQuick 2.15
|
|
|
|
import org.ukui.menu.core 1.0
|
|
|
|
import org.ukui.quick.items 1.0 as UkuiItems
|
|
|
|
import org.ukui.quick.platform 1.0 as Platform
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: tag
|
2024-02-26 18:02:03 +08:00
|
|
|
property bool isFavorited
|
2024-02-06 09:54:18 +08:00
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: editImage
|
|
|
|
UkuiItems.Button {
|
|
|
|
width: 28
|
|
|
|
height: 28
|
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
background.paletteRole: Platform.Theme.Light
|
|
|
|
background.alpha: 1
|
|
|
|
activeFocusOnTab: false
|
|
|
|
|
|
|
|
onClicked: tag.clicked()
|
|
|
|
|
|
|
|
background.radius: width / 2
|
2024-02-26 18:02:03 +08:00
|
|
|
icon.source: isFavorited ? "ukui-cancel-star-symbolic" : "non-starred-symbolic"
|
2024-02-06 09:54:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceComponent: mainWindow.editMode && (type === DataType.Normal) ? editImage : null
|
|
|
|
}
|