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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user