1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 14:08:29 -04:00

i18n: numerous RTL layout fixes across DankDash and Settings

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