Accepting request 1101852 from home:Vogtinator:plasma5.27
- Add patch to fix line wrapping of "100 %" in OSDs (kde#469576): * 0001-OSD-Fix-size-calculation-for-progress-value.patch OBS-URL: https://build.opensuse.org/request/show/1101852 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=705
This commit is contained in:
parent
88ecef9834
commit
106080a94a
63
0001-OSD-Fix-size-calculation-for-progress-value.patch
Normal file
63
0001-OSD-Fix-size-calculation-for-progress-value.patch
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
From 94b2c3d1d4a72d70d487513954601c2cf723e673 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
||||||
|
Date: Tue, 1 Aug 2023 19:47:52 +0200
|
||||||
|
Subject: [PATCH] OSD: Fix size calculation for progress value
|
||||||
|
|
||||||
|
Use a common function for formatting the percent, so placeholder 100% label will
|
||||||
|
use the exact formatting used by the label next to the progress bar.
|
||||||
|
|
||||||
|
Also use font advanceWidth, which is the appropriate means of calculating the
|
||||||
|
bounding box of text in this case. Also ceil it to avoid subpixel alignment.
|
||||||
|
|
||||||
|
And to be absolutely sure disable word wrapping.
|
||||||
|
|
||||||
|
BUG: 469576
|
||||||
|
(cherry picked from commit 9737efa79440b65db303030f34f0039f1c9cd6a0)
|
||||||
|
---
|
||||||
|
lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml | 11 ++++++++---
|
||||||
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml b/lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml
|
||||||
|
index fa892cb23..bc60efc15 100644
|
||||||
|
--- a/lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml
|
||||||
|
+++ b/lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml
|
||||||
|
@@ -26,6 +26,10 @@ RowLayout {
|
||||||
|
// false for displaying the value as normal text
|
||||||
|
property bool showingProgress: false
|
||||||
|
|
||||||
|
+ function formatPercent(number) {
|
||||||
|
+ return i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Percentage value", "%1%", number);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
spacing: PlasmaCore.Units.smallSpacing
|
||||||
|
|
||||||
|
Layout.preferredWidth: Math.max(Math.min(Screen.desktopAvailableWidth / 2, implicitWidth), PlasmaCore.Units.gridUnit * 15)
|
||||||
|
@@ -63,7 +67,7 @@ RowLayout {
|
||||||
|
// to the maximum width to avoid the progress bad resizing itself
|
||||||
|
TextMetrics {
|
||||||
|
id: widestLabelSize
|
||||||
|
- text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "100%")
|
||||||
|
+ text: formatPercent(100)
|
||||||
|
font: percentageLabel.font
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -71,13 +75,14 @@ RowLayout {
|
||||||
|
PlasmaExtra.Heading {
|
||||||
|
id: percentageLabel
|
||||||
|
Layout.fillHeight: true
|
||||||
|
- Layout.preferredWidth: widestLabelSize.width
|
||||||
|
+ Layout.preferredWidth: Math.ceil(widestLabelSize.advanceWidth)
|
||||||
|
Layout.rightMargin: PlasmaCore.Units.smallSpacing
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
level: 3
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
- text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Percentage value", "%1%", progressBar.value)
|
||||||
|
+ text: formatPercent(progressBar.value)
|
||||||
|
+ wrapMode: Text.NoWrap
|
||||||
|
visible: showingProgress
|
||||||
|
// Display a subtle visual indication that the volume might be
|
||||||
|
// dangerously high
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 1 20:07:29 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||||
|
|
||||||
|
- Add patch to fix line wrapping of "100 %" in OSDs (kde#469576):
|
||||||
|
* 0001-OSD-Fix-size-calculation-for-progress-value.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Aug 1 11:19:31 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de>
|
Tue Aug 1 11:19:31 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ Source1: https://download.kde.org/stable/plasma/%{version}/plasma-workspa
|
|||||||
Source2: plasma.keyring
|
Source2: plasma.keyring
|
||||||
%endif
|
%endif
|
||||||
Source3: xprop-kde-full-session.desktop
|
Source3: xprop-kde-full-session.desktop
|
||||||
|
# PATCH-FIX-UPSTREAM
|
||||||
|
Patch1: 0001-OSD-Fix-size-calculation-for-progress-value.patch
|
||||||
# PATCHES 501-??? are PATCH-FIX-OPENSUSE
|
# PATCHES 501-??? are PATCH-FIX-OPENSUSE
|
||||||
Patch501: 0001-Use-qdbus-qt5.patch
|
Patch501: 0001-Use-qdbus-qt5.patch
|
||||||
Patch502: 0001-Ignore-default-sddm-face-icons.patch
|
Patch502: 0001-Ignore-default-sddm-face-icons.patch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user