From b9e116e17f817dadf9f981c9ccd8565ed64ae7bc Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 15 May 2025 22:48:45 +0200 Subject: [PATCH] secondary tab button: icon in loader --- .../common/widgets/SecondaryTabButton.qml | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/SecondaryTabButton.qml b/.config/quickshell/modules/common/widgets/SecondaryTabButton.qml index 3ca0fd3e3..050cec6c3 100644 --- a/.config/quickshell/modules/common/widgets/SecondaryTabButton.qml +++ b/.config/quickshell/modules/common/widgets/SecondaryTabButton.qml @@ -35,19 +35,28 @@ TabButton { RowLayout { anchors.centerIn: parent spacing: 0 - MaterialSymbol { - visible: buttonIcon?.length > 0 + + Loader { + id: iconLoader + active: buttonIcon?.length > 0 + sourceComponent: buttonIcon?.length > 0 ? materialSymbolComponent : null Layout.rightMargin: 5 - verticalAlignment: Text.AlignVCenter - text: buttonIcon - iconSize: Appearance.font.pixelSize.huge - fill: selected ? 1 : 0 - 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 + } + + Component { + id: materialSymbolComponent + MaterialSymbol { + verticalAlignment: Text.AlignVCenter + text: buttonIcon + iconSize: Appearance.font.pixelSize.huge + fill: selected ? 1 : 0 + 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 + } } } }