Commit b0d86c02 authored by Bharadwaj Raju's avatar Bharadwaj Raju Committed by Nate Graham
Browse files

applets/timer: Make the label size not jump around as it changes

parent 73166ced
Pipeline #225888 passed with stage
in 1 minute and 47 seconds
......@@ -170,7 +170,22 @@ Item {
PlasmaComponents3.Label {
id: remainingTimeLabel
Layout.fillWidth: true
Layout.alignment: layoutForm == CompactRepresentation.LayoutType.VerticalPanel || layoutForm === CompactRepresentation.LayoutType.VerticalDesktop ? Qt.AlignHCenter : Qt.AlignLeft
Layout.fillWidth: false
Layout.maximumWidth: textMetrics.width
Layout.minimumWidth: textMetrics.width
TextMetrics {
id: textMetrics
text: {
if (root.isVertical) {
return i18ncp("remaining time", "%1s", "%1s", root.seconds);
}
// make it not jump around: reserve space for one extra digit than reasonable
return root.showSeconds ? "44:44:444" : "44:444";
}
font: remainingTimeLabel.font
}
activeFocusOnTab: true
elide: root.inPanel ? Text.ElideRight : Text.ElideNone
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment