ukui-menu/qml/extensions/EditModeFlag.qml

31 lines
787 B
QML
Raw Normal View History

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