1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-03 20:18:31 -04:00

animations: fix regression eliding button group text caused by recently

RTL fixes
fixes #2741
This commit is contained in:
bbedward
2026-07-04 10:44:02 -04:00
parent 19b44b1782
commit 8cb4e21716
5 changed files with 184 additions and 199 deletions
+9 -1
View File
@@ -239,12 +239,20 @@ Row {
StyledText {
id: buttonText
readonly property real capAvailable: {
if (root._segmentCap <= 0)
return -1;
const cap = Math.max(root._segmentCap, root.minButtonWidth);
return Math.max(0, cap - root.buttonPadding * 2 - (checkIcon.visible ? checkIcon.width + contentRow.spacing : 0));
}
text: typeof modelData === "string" ? modelData : modelData.text || ""
font.pixelSize: root.textSize
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)))
width: capAvailable < 0 ? implicitWidth : Math.min(implicitWidth, capAvailable)
maximumLineCount: 1
}
}