From f593ad0f2c47c9d2009dd32dced87493115b8aa5 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 5 Sep 2025 23:34:50 +0200 Subject: [PATCH] make selection buttons less weird with cjk --- .../common/widgets/SelectionGroupButton.qml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml b/.config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml index a1d766099..178138953 100644 --- a/.config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml +++ b/.config/quickshell/ii/modules/common/widgets/SelectionGroupButton.qml @@ -41,9 +41,22 @@ GroupButton { } } - StyledText { - color: root.toggled ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer - text: root.buttonText + Item { + implicitWidth: textItem.implicitWidth + implicitHeight: textMetrics.height // Force height to that of regular text + + TextMetrics { + id: textMetrics + font.family: Appearance.font.family.main + text: "Abc" + } + + StyledText { + id: textItem + anchors.centerIn: parent + color: root.toggled ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer + text: root.buttonText + } } } }