From 61108b76687439dac25679bed108f0126e31db6d Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 3 Jul 2026 11:57:09 -0400 Subject: [PATCH] i18n: numerous RTL layout fixes across DankDash and Settings --- .../Modules/DankDash/Overview/ClockCard.qml | 2 + quickshell/Modules/DankDash/WeatherTab.qml | 3 + quickshell/Modules/Settings/AutoStartTab.qml | 25 ++- quickshell/Modules/Settings/GreeterTab.qml | 24 ++- quickshell/Modules/Settings/LauncherTab.qml | 6 + .../Modules/Settings/MediaPlayerTab.qml | 6 +- .../Modules/Settings/WidgetsTabSection.qml | 187 ++++++++++++++++++ quickshell/Widgets/DankButtonGroup.qml | 17 +- 8 files changed, 253 insertions(+), 17 deletions(-) diff --git a/quickshell/Modules/DankDash/Overview/ClockCard.qml b/quickshell/Modules/DankDash/Overview/ClockCard.qml index 805febff1..4269d6221 100644 --- a/quickshell/Modules/DankDash/Overview/ClockCard.qml +++ b/quickshell/Modules/DankDash/Overview/ClockCard.qml @@ -18,6 +18,7 @@ Card { Row { spacing: 0 anchors.horizontalCenter: parent.horizontalCenter + LayoutMirroring.enabled: false StyledText { text: { @@ -57,6 +58,7 @@ Card { Row { spacing: 0 anchors.horizontalCenter: parent.horizontalCenter + LayoutMirroring.enabled: false StyledText { text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(0) diff --git a/quickshell/Modules/DankDash/WeatherTab.qml b/quickshell/Modules/DankDash/WeatherTab.qml index 12fd17809..1f920d534 100644 --- a/quickshell/Modules/DankDash/WeatherTab.qml +++ b/quickshell/Modules/DankDash/WeatherTab.qml @@ -382,6 +382,9 @@ Item { height: dateStepperInner.height + Theme.spacingM * 2 width: dateStepperInner.width + LayoutMirroring.enabled: false + LayoutMirroring.childrenInherit: true + property var currentDate: new Date() readonly property var changeDate: (magnitudeIndex, sign) => { diff --git a/quickshell/Modules/Settings/AutoStartTab.qml b/quickshell/Modules/Settings/AutoStartTab.qml index 5d555ee40..1e388bd53 100644 --- a/quickshell/Modules/Settings/AutoStartTab.qml +++ b/quickshell/Modules/Settings/AutoStartTab.qml @@ -669,9 +669,10 @@ Item { border.width: 0 Row { - width: parent.width anchors.left: parent.left + anchors.right: entryToggle.left anchors.leftMargin: Theme.spacingM + anchors.rightMargin: Theme.spacingM anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingM @@ -699,7 +700,7 @@ Item { } Column { - width: parent.width - 20 - Theme.spacingM - 24 - Theme.spacingM - Theme.spacingM - 60 - Theme.spacingM - 32 - Theme.spacingS + width: parent.width - 20 - 24 - Theme.spacingM * 2 anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingXXS @@ -709,7 +710,9 @@ Item { font.pixelSize: Theme.fontSizeMedium font.weight: Font.Medium color: modelData.hidden ? Theme.surfaceVariantText : Theme.surfaceText + maximumLineCount: 1 elide: Text.ElideRight + horizontalAlignment: Text.AlignLeft opacity: modelData.hidden ? 0.6 : 1.0 } @@ -718,18 +721,24 @@ Item { text: modelData.hidden ? I18n.tr("Disabled") : modelData.exec font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceVariantText + maximumLineCount: 1 elide: Text.ElideRight + horizontalAlignment: Text.AlignLeft } } - - DankToggle { - anchors.verticalCenter: parent.verticalCenter - checked: !modelData.hidden - onToggled: checked => root.setHidden(modelData, !checked) - } + } + + DankToggle { + id: entryToggle + anchors.right: entryRemoveButton.left + anchors.rightMargin: Theme.spacingS + anchors.verticalCenter: parent.verticalCenter + checked: !modelData.hidden + onToggled: checked => root.setHidden(modelData, !checked) } DankActionButton { + id: entryRemoveButton anchors.right: parent.right anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter diff --git a/quickshell/Modules/Settings/GreeterTab.qml b/quickshell/Modules/Settings/GreeterTab.qml index 0c61ca1db..7e97faea3 100644 --- a/quickshell/Modules/Settings/GreeterTab.qml +++ b/quickshell/Modules/Settings/GreeterTab.qml @@ -1,7 +1,6 @@ pragma ComponentBehavior: Bound import QtQuick -import QtQuick.Layouts import Quickshell.Io import qs.Common import qs.Modals.Common @@ -12,6 +11,9 @@ import qs.Modules.Settings.Widgets Item { id: root + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true + readonly property bool greeterFprintToggleAvailable: SettingsData.greeterFingerprintCanEnable || SettingsData.greeterEnableFprint readonly property bool greeterU2fToggleAvailable: SettingsData.greeterU2fCanEnable || SettingsData.greeterEnableU2f @@ -420,6 +422,7 @@ Item { color: Theme.surfaceVariantText width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft } Item { @@ -451,7 +454,7 @@ Item { height: Theme.spacingM } - RowLayout { + Flow { width: parent.width spacing: Theme.spacingS @@ -463,10 +466,6 @@ Item { enabled: !root.greeterInstallActionRunning && !root.greeterSyncRunning } - Item { - Layout.fillWidth: true - } - DankButton { text: I18n.tr("Refresh") iconName: "refresh" @@ -497,6 +496,7 @@ Item { color: Theme.surfaceVariantText width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft } SettingsToggleRow { @@ -534,6 +534,8 @@ Item { font.weight: Font.Medium color: Theme.surfaceText topPadding: Theme.spacingM + width: parent.width + horizontalAlignment: Text.AlignLeft } SettingsFontDropdownRow { @@ -551,6 +553,8 @@ Item { font.weight: Font.Medium color: Theme.surfaceText topPadding: Theme.spacingM + width: parent.width + horizontalAlignment: Text.AlignLeft } SettingsToggleRow { @@ -585,6 +589,8 @@ Item { font.weight: Font.Medium color: Theme.surfaceText topPadding: Theme.spacingM + width: parent.width + horizontalAlignment: Text.AlignLeft } SettingsDropdownRow { @@ -610,6 +616,8 @@ Item { font.weight: Font.Medium color: Theme.surfaceText topPadding: Theme.spacingM + width: parent.width + horizontalAlignment: Text.AlignLeft } StyledText { @@ -618,6 +626,7 @@ Item { color: Theme.surfaceVariantText width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft } SettingsWallpaperPicker { @@ -645,6 +654,7 @@ Item { color: Theme.surfaceVariantText width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft } SettingsToggleRow { @@ -688,6 +698,7 @@ Item { color: Theme.surfaceVariantText width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft } StyledText { @@ -698,6 +709,7 @@ Item { linkColor: Theme.primary width: parent.width wrapMode: Text.Wrap + horizontalAlignment: Text.AlignLeft onLinkActivated: url => Qt.openUrlExternally(url) MouseArea { diff --git a/quickshell/Modules/Settings/LauncherTab.qml b/quickshell/Modules/Settings/LauncherTab.qml index e1d50218e..45e779807 100644 --- a/quickshell/Modules/Settings/LauncherTab.qml +++ b/quickshell/Modules/Settings/LauncherTab.qml @@ -295,6 +295,7 @@ Item { DankButtonGroup { id: logoModeGroup anchors.horizontalCenter: parent.horizontalCenter + maximumWidth: parent.width buttonPadding: parent.width < 480 ? Theme.spacingS : Theme.spacingL minButtonWidth: parent.width < 480 ? 44 : 64 textSize: parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium @@ -376,7 +377,9 @@ Item { font.pixelSize: Theme.fontSizeMedium color: SettingsData.launcherLogoCustomPath ? Theme.surfaceText : Theme.outlineButton width: parent.width - Theme.spacingM * 2 + wrapMode: Text.NoWrap elide: Text.ElideMiddle + horizontalAlignment: Text.AlignLeft } } @@ -418,6 +421,7 @@ Item { DankButtonGroup { id: colorModeGroup + maximumWidth: parent.parent.width - (colorPickerCircle.visible ? colorPickerCircle.width + Theme.spacingM : 0) buttonPadding: parent.parent.width < 480 ? Theme.spacingS : Theme.spacingL minButtonWidth: parent.parent.width < 480 ? 44 : 64 textSize: parent.parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium @@ -626,6 +630,7 @@ Item { DankButtonGroup { id: sizeGroup anchors.horizontalCenter: parent.horizontalCenter + maximumWidth: parent.width buttonPadding: parent.width < 400 ? Theme.spacingS : Theme.spacingL minButtonWidth: parent.width < 400 ? 60 : 80 textSize: parent.width < 400 ? Theme.fontSizeSmall : Theme.fontSizeMedium @@ -725,6 +730,7 @@ Item { DankButtonGroup { id: borderColorGroup anchors.horizontalCenter: parent.horizontalCenter + maximumWidth: parent.width buttonPadding: parent.width < 400 ? Theme.spacingS : Theme.spacingL minButtonWidth: parent.width < 400 ? 50 : 70 textSize: parent.width < 400 ? Theme.fontSizeSmall : Theme.fontSizeMedium diff --git a/quickshell/Modules/Settings/MediaPlayerTab.qml b/quickshell/Modules/Settings/MediaPlayerTab.qml index 43fcb8903..402739f6c 100644 --- a/quickshell/Modules/Settings/MediaPlayerTab.qml +++ b/quickshell/Modules/Settings/MediaPlayerTab.qml @@ -93,11 +93,12 @@ Item { Column { id: audioWheelScrollAmountColumn - x: Theme.spacingL - width: 120 + anchors.left: parent.left + anchors.leftMargin: Theme.spacingL spacing: Theme.spacingS StyledText { + anchors.left: parent.left text: I18n.tr("Adjust volume per scroll indent") font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceVariantText @@ -106,6 +107,7 @@ Item { } DankTextField { + anchors.left: parent.left width: 100 height: 28 placeholderText: "5" diff --git a/quickshell/Modules/Settings/WidgetsTabSection.qml b/quickshell/Modules/Settings/WidgetsTabSection.qml index b499ca8c7..4956ff255 100644 --- a/quickshell/Modules/Settings/WidgetsTabSection.qml +++ b/quickshell/Modules/Settings/WidgetsTabSection.qml @@ -1276,6 +1276,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { anchors.fill: parent anchors.margins: Theme.spacingS @@ -1290,8 +1292,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: swapToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "swap_horiz" @@ -1306,6 +1311,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1343,8 +1351,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: gbToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "straighten" @@ -1359,6 +1370,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1413,6 +1427,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: contentColumn anchors.fill: parent @@ -1428,8 +1444,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: trayOverflowToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "arrow_selector_tool" @@ -1444,6 +1463,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1479,8 +1501,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: trayPopupLineToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "view_week" @@ -1495,6 +1520,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1532,8 +1560,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: trayAutoOverflowToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "responsive_layout" @@ -1548,6 +1579,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1583,8 +1617,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: trayMaxVisibleButtons.left + anchors.rightMargin: Theme.spacingXS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "low_priority" @@ -1599,6 +1636,7 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + maximumLineCount: 1 } StyledText { @@ -1613,6 +1651,7 @@ Column { } Row { + id: trayMaxVisibleButtons anchors.right: parent.right anchors.rightMargin: Theme.spacingXS anchors.verticalCenter: parent.verticalCenter @@ -1677,6 +1716,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: kbdLayoutCtxMenuColumn anchors.fill: parent @@ -1692,8 +1733,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: kbdLayoutCtxMenuIconToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "visibility" @@ -1708,6 +1752,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1762,6 +1809,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: focusedWindowMenuColumn anchors.fill: parent @@ -1777,8 +1826,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: fwCompactToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "zoom_in" @@ -1793,6 +1845,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -1863,8 +1918,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: fwSizeCheck.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: modelData.icon @@ -1879,10 +1937,14 @@ Column { font.weight: isSelected() ? Font.Medium : Font.Normal color: isSelected() ? Theme.primary : Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } DankIcon { + id: fwSizeCheck anchors.right: parent.right anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter @@ -1931,6 +1993,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: diskMenuColumn anchors.fill: parent @@ -1994,8 +2058,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: diskModeCheck.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: modelData.icon @@ -2010,10 +2077,14 @@ Column { color: isSelected() ? Theme.primary : Theme.surfaceText font.weight: isSelected() ? Font.Medium : Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } DankIcon { + id: diskModeCheck anchors.right: parent.right anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter @@ -2304,6 +2375,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true function getCurrentWidgetData() { const widgets = root.items || []; if (controlCenterContextMenu.widgetIndex >= 0 && controlCenterContextMenu.widgetIndex < widgets.length) @@ -2529,6 +2602,7 @@ Column { font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight + maximumLineCount: 1 width: parent.width - 16 - Theme.spacingS - 16 - Theme.spacingS } } @@ -2610,6 +2684,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: menuPrivacyColumn @@ -2668,6 +2744,7 @@ Column { font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight + maximumLineCount: 1 width: parent.width - 16 - Theme.spacingS } } @@ -2725,6 +2802,7 @@ Column { font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight + maximumLineCount: 1 width: parent.width - 16 - Theme.spacingS } } @@ -2782,6 +2860,7 @@ Column { font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight + maximumLineCount: 1 width: parent.width - 16 - Theme.spacingS } } @@ -2836,6 +2915,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: gpuMenuColumn anchors.fill: parent @@ -2945,6 +3026,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: batteryMenuColumn anchors.fill: parent @@ -2960,8 +3043,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: batteryPercentToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "percent" @@ -2976,6 +3062,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } @@ -3014,8 +3103,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + 18 + anchors.right: batteryPercentOnlyOnBatteryToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "battery_charging_full" @@ -3030,6 +3122,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } @@ -3069,8 +3164,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: batteryTimeToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "schedule" @@ -3085,6 +3183,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } @@ -3123,8 +3224,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + 18 + anchors.right: batteryTimeOnlyOnBatteryToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "battery_charging_full" @@ -3139,6 +3243,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } @@ -3194,6 +3301,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: musicMenuColumn anchors.fill: parent @@ -3242,8 +3351,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: musicSizeCheck.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: modelData.icon @@ -3258,10 +3370,14 @@ Column { font.weight: isSelected() ? Font.Medium : Font.Normal color: isSelected() ? Theme.primary : Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 18 - Theme.spacingS } } DankIcon { + id: musicSizeCheck anchors.right: parent.right anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter @@ -3311,6 +3427,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: runningAppsMenuColumn anchors.fill: parent @@ -3343,8 +3461,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: raCompactToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "zoom_in" @@ -3358,6 +3479,9 @@ Column { font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3395,8 +3519,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: raGroupToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "apps" @@ -3410,6 +3537,9 @@ Column { font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3447,8 +3577,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: raWorkspaceToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "workspaces" @@ -3462,6 +3595,9 @@ Column { font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3499,8 +3635,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: raDisplayToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "monitor" @@ -3514,6 +3653,9 @@ Column { font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3570,6 +3712,8 @@ Column { } contentItem: Item { + LayoutMirroring.enabled: I18n.isRtl + LayoutMirroring.childrenInherit: true Column { id: appsDockMenuColumn anchors.fill: parent @@ -3582,6 +3726,9 @@ Column { font.weight: Font.Medium color: Theme.surfaceText leftPadding: Theme.spacingS + rightPadding: Theme.spacingS + width: parent.width + horizontalAlignment: Text.AlignLeft } StyledText { @@ -3590,6 +3737,9 @@ Column { font.weight: Font.Medium color: Theme.surfaceText leftPadding: Theme.spacingS + rightPadding: Theme.spacingS + width: parent.width + horizontalAlignment: Text.AlignLeft } Column { @@ -3606,6 +3756,8 @@ Column { color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter width: 120 + maximumLineCount: 1 + horizontalAlignment: Text.AlignLeft } Row { @@ -3660,6 +3812,8 @@ Column { color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter width: 120 + maximumLineCount: 1 + horizontalAlignment: Text.AlignLeft } Row { @@ -3720,8 +3874,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: badgeToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "notifications" @@ -3736,6 +3893,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3777,7 +3937,10 @@ Column { font.weight: Font.Medium color: Theme.surfaceText leftPadding: Theme.spacingS + rightPadding: Theme.spacingS topPadding: Theme.spacingXS + width: parent.width + horizontalAlignment: Text.AlignLeft } Rectangle { @@ -3789,8 +3952,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: hideIndicatorsToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "visibility_off" @@ -3805,6 +3971,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3842,8 +4011,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: colorizeActiveToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "palette" @@ -3858,6 +4030,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3898,6 +4073,8 @@ Column { color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter width: 90 + maximumLineCount: 1 + horizontalAlignment: Text.AlignLeft } DankButtonGroup { @@ -3941,8 +4118,11 @@ Column { Row { anchors.left: parent.left anchors.leftMargin: Theme.spacingS + anchors.right: enlargeOnHoverToggle.left + anchors.rightMargin: Theme.spacingS anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingS + clip: true DankIcon { name: "zoom_in" @@ -3957,6 +4137,9 @@ Column { color: Theme.surfaceText font.weight: Font.Normal anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + maximumLineCount: 1 + width: parent.width - 16 - Theme.spacingS } } @@ -3996,6 +4179,8 @@ Column { color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter width: 120 + maximumLineCount: 1 + horizontalAlignment: Text.AlignLeft } Row { @@ -4047,6 +4232,8 @@ Column { color: Theme.surfaceText anchors.verticalCenter: parent.verticalCenter width: 120 + maximumLineCount: 1 + horizontalAlignment: Text.AlignLeft } Row { diff --git a/quickshell/Widgets/DankButtonGroup.qml b/quickshell/Widgets/DankButtonGroup.qml index ad592dbd3..396ea8215 100644 --- a/quickshell/Widgets/DankButtonGroup.qml +++ b/quickshell/Widgets/DankButtonGroup.qml @@ -31,6 +31,13 @@ Row { property int textSize: size === "small" ? Theme.fontSizeSmall : Theme.fontSizeMedium property bool userInteracted: false property bool usePopupTransparency: !checkParentDisablesTransparency() + property real maximumWidth: -1 + readonly property real _segmentCap: { + const count = model?.length ?? 0; + if (maximumWidth <= 0 || count === 0) + return -1; + return (maximumWidth - spacing * (count - 1)) / count - 4; + } signal selectionChanged(int index, bool selected) signal animationCompleted @@ -98,7 +105,13 @@ Row { property bool prevSelected: index > 0 ? root.isSelected(index - 1) : false property bool nextSelected: index < repeater.count - 1 ? root.isSelected(index + 1) : false - width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0) + readonly property real contentNaturalWidth: (checkIcon.visible ? checkIcon.width + contentRow.spacing : 0) + buttonText.implicitWidth + + width: { + const natural = Math.max(contentNaturalWidth + root.buttonPadding * 2, root.minButtonWidth); + const capped = root._segmentCap > 0 ? Math.min(natural, Math.max(root._segmentCap, root.minButtonWidth)) : natural; + return capped + (selected ? 4 : 0); + } height: root.buttonHeight color: selected ? Theme.buttonBg : (root.usePopupTransparency ? Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency) : Theme.surfaceVariant) @@ -231,6 +244,8 @@ Row { font.weight: segment.selected ? Font.Medium : Font.Normal color: segment.selected ? Theme.buttonText : Theme.surfaceVariantText anchors.verticalCenter: parent.verticalCenter + width: Math.min(implicitWidth, Math.max(0, segment.width - (segment.selected ? 4 : 0) - root.buttonPadding * 2 - (checkIcon.visible ? checkIcon.width + contentRow.spacing : 0))) + maximumLineCount: 1 } } }