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-05-15 17:28:48 +08:00
|
|
|
property real alpha: 1
|
|
|
|
property real systemFontSize: 10
|
|
|
|
property real textUltra: 2*systemFontSize
|
2022-12-21 10:22:48 +08:00
|
|
|
|
2023-05-15 17:28:48 +08:00
|
|
|
font.pointSize: systemFontSize
|
2022-12-21 10:22:48 +08:00
|
|
|
function updateColor() {
|
2023-05-15 17:28:48 +08:00
|
|
|
color = themePalette.paletteColorWithCustomTransparency(paletteRole, Palette.Active, alpha);
|
|
|
|
}
|
2023-11-03 15:09:42 +08:00
|
|
|
function updateFont() {
|
|
|
|
font = themePalette.systemFont();
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
2023-05-15 17:28:48 +08:00
|
|
|
updateColor();
|
2023-11-03 15:09:42 +08:00
|
|
|
updateFont();
|
2023-05-15 17:28:48 +08:00
|
|
|
themePalette.styleColorChanged.connect(updateColor);
|
2023-11-03 15:09:42 +08:00
|
|
|
themePalette.systemFontChanged.connect(updateFont);
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
2023-05-15 17:28:48 +08:00
|
|
|
themePalette.styleColorChanged.disconnect(updateColor);
|
2023-11-03 15:09:42 +08:00
|
|
|
themePalette.systemFontChanged.disconnect(updateFont);
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|
|
|
|
onPaletteRoleChanged: {
|
2023-05-15 17:28:48 +08:00
|
|
|
updateColor();
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|
2023-03-06 09:37:06 +08:00
|
|
|
onAlphaChanged: {
|
2023-05-15 17:28:48 +08:00
|
|
|
updateColor();
|
2023-03-06 09:37:06 +08:00
|
|
|
}
|
2022-12-21 10:22:48 +08:00
|
|
|
}
|