From 245af4da15528df5406e1d4da3c6ee29aeeb36a0 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Thu, 16 Dec 2021 17:33:39 +0300 Subject: [PATCH] [applets/batterymonitor] PowerProfileItem: Elide slider labels There are many languages (including Russian) where three three power profile titles do take much more space than it is available in applet. RowLayout's spacing ensures they do not stick to each other side by side. Ideally, we should have "shrinking labels" which are capable of adjusting their text's kerning based on available space. In the meantime, localization teams are advised to use as short profile names as possible without loosing their meaning. --- .../batterymonitor/package/contents/ui/PowerProfileItem.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applets/batterymonitor/package/contents/ui/PowerProfileItem.qml b/applets/batterymonitor/package/contents/ui/PowerProfileItem.qml index 8f9fe2b08..65bedb5c2 100644 --- a/applets/batterymonitor/package/contents/ui/PowerProfileItem.qml +++ b/applets/batterymonitor/package/contents/ui/PowerProfileItem.qml @@ -104,8 +104,8 @@ RowLayout { RowLayout { Layout.fillWidth: true + spacing: PlasmaCore.Units.smallSpacing - spacing: 0 Repeater { id: repeater model: root.profileData @@ -121,6 +121,7 @@ RowLayout { default: return Text.AlignHCenter; // middle } + elide: Text.ElideMiddle // Disable label for inhibited items to reinforce unavailability enabled: !(root.profileData[index].canBeInhibited && root.inhibited)