1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 13:38:28 -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
+16 -1
View File
@@ -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
}
}
}