2022-12-21 10:22:48 +08:00
|
|
|
import QtQuick 2.0
|
|
|
|
import org.ukui.menu.core 1.0
|
|
|
|
|
|
|
|
Text {
|
|
|
|
property int paletteRole: Palette.Text
|
2023-03-06 09:37:06 +08:00
|
|
|
property real alpha: 1.0
|
2022-12-21 10:22:48 +08:00
|
|
|
|
|
|
|
function updateColor() {
|
2023-03-06 09:37:06 +08:00
|
|
|
color = themePalette.paletteColorWithCustomTransparency(paletteRole, Palette.Active, alpha)
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
updateColor()
|
|
|
|
themePalette.styleColorChanged.connect(updateColor)
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
themePalette.styleColorChanged.disconnect(updateColor)
|
|
|
|
}
|
|
|
|
|
|
|
|
onPaletteRoleChanged: {
|
|
|
|
updateColor()
|
|
|
|
}
|
2023-03-06 09:37:06 +08:00
|
|
|
onAlphaChanged: {
|
|
|
|
updateColor()
|
|
|
|
}
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|