ukui-menu/qml/AppControls2/StyleText.qml

27 lines
592 B
QML
Raw Normal View History

import QtQuick 2.0
import org.ukui.menu.core 1.0
Text {
property int paletteRole: Palette.Text
property real alpha: 1.0
function updateColor() {
color = themePalette.paletteColorWithCustomTransparency(paletteRole, Palette.Active, alpha)
}
Component.onCompleted: {
updateColor()
themePalette.styleColorChanged.connect(updateColor)
}
Component.onDestruction: {
themePalette.styleColorChanged.disconnect(updateColor)
}
onPaletteRoleChanged: {
updateColor()
}
onAlphaChanged: {
updateColor()
}
}