secondary tab button: icon in loader

This commit is contained in:
end-4
2025-05-15 22:48:45 +02:00
parent 0f7eed736b
commit b9e116e17f
@@ -35,19 +35,28 @@ TabButton {
RowLayout { RowLayout {
anchors.centerIn: parent anchors.centerIn: parent
spacing: 0 spacing: 0
MaterialSymbol {
visible: buttonIcon?.length > 0 Loader {
id: iconLoader
active: buttonIcon?.length > 0
sourceComponent: buttonIcon?.length > 0 ? materialSymbolComponent : null
Layout.rightMargin: 5 Layout.rightMargin: 5
verticalAlignment: Text.AlignVCenter }
text: buttonIcon
iconSize: Appearance.font.pixelSize.huge Component {
fill: selected ? 1 : 0 id: materialSymbolComponent
color: selected ? Appearance.m3colors.m3primary : Appearance.colors.colOnLayer1 MaterialSymbol {
Behavior on color { verticalAlignment: Text.AlignVCenter
ColorAnimation { text: buttonIcon
duration: Appearance.animation.elementMove.duration iconSize: Appearance.font.pixelSize.huge
easing.type: Appearance.animation.elementMove.type fill: selected ? 1 : 0
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve color: selected ? Appearance.m3colors.m3primary : Appearance.colors.colOnLayer1
Behavior on color {
ColorAnimation {
duration: Appearance.animation.elementMove.duration
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve
}
} }
} }
} }