public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steve Cossette <farchord@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/plasma-breeze] f44: Upstream patch: Use font metrics to only inset where the text can spare it
Date: Sat, 15 Aug 2026 13:04:12 GMT [thread overview]
Message-ID: <178679905235.1.2370021334973794487.rpms-plasma-breeze-c4a6af5ee904@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/plasma-breeze
Branch : f44
Commit : c4a6af5ee9043030884b95678c6da1df30c39bb1
Author : Steve Cossette <farchord@gmail.com>
Date : 2026-08-15T06:52:50-04:00
Stats : +56/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/plasma-breeze/c/c4a6af5ee9043030884b95678c6da1df30c39bb1?branch=f44
Log:
Upstream patch: Use font metrics to only inset where the text can spare it
---
diff --git a/a74ad95349ec913f1042f5390dbd95a8341aea06.patch b/a74ad95349ec913f1042f5390dbd95a8341aea06.patch
new file mode 100644
index 0000000..58fd789
--- /dev/null
+++ b/a74ad95349ec913f1042f5390dbd95a8341aea06.patch
@@ -0,0 +1,50 @@
+From a74ad95349ec913f1042f5390dbd95a8341aea06 Mon Sep 17 00:00:00 2001
+From: Akseli Lahtinen <akselmo@akselmo.dev>
+Date: Fri, 14 Aug 2026 23:20:58 +0300
+Subject: [PATCH] Use font metrics to only inset where the text can spare it
+
+Applying the inset from aba0f922b unconditionally causes eliding in some
+cases. Check the font metrics instead and take the inset only from items
+that have the width to spare.
+
+BUG: 523118
+
+
+(cherry picked from commit f0b1d7534aa2356d7336241d0c7051522e8a6b68)
+
+Co-authored-by: Allen Hewes <rallenh@hotmail.com>
+---
+ kstyle/breezestyle.cpp | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
+index 3a9096524..f0d4dfe45 100644
+--- a/kstyle/breezestyle.cpp
++++ b/kstyle/breezestyle.cpp
+@@ -1062,8 +1062,21 @@ QRect Style::subElementRect(SubElement element, const QStyleOption *option, cons
+ QRect rect = ParentStyleClass::subElementRect(element, option, widget);
+ if (viewItem) {
+ const QMargins margins = _helper->itemViewItemMargins(viewItem);
+- rect.setRight(rect.right() - margins.right() - Metrics::ItemView_ItemPaddingWidth);
+- rect.setLeft(rect.left() + margins.left() + Metrics::ItemView_ItemPaddingWidth);
++ const int leftInset = margins.left() + Metrics::ItemView_ItemPaddingWidth;
++ const int rightInset = margins.right() + Metrics::ItemView_ItemPaddingWidth;
++
++ // Use the font metrics to inset only as far as the text can spare,
++ // so the inset itself cannot cause elision.
++ const int textMargin = proxy()->pixelMetric(PM_FocusFrameHMargin, option, widget) + 1;
++ const int available = rect.width() - 2 * textMargin; // viewItemDrawText() removes textMargin again
++ const int required = viewItem->fontMetrics.horizontalAdvance(viewItem->text);
++ const int inset = qBound(0, available - required, leftInset + rightInset);
++
++ // Shrink both sides in proportion so the text stays where it was.
++ const int total = leftInset + rightInset;
++ const int right = total > 0 ? inset * rightInset / total : 0;
++ rect.setRight(rect.right() - right);
++ rect.setLeft(rect.left() + (inset - right));
+ rect.moveTop(rect.top() + margins.top() - margins.bottom());
+ }
+
+--
+GitLab
+
diff --git a/plasma-breeze.spec b/plasma-breeze.spec
index 6030bf9..306146b 100644
--- a/plasma-breeze.spec
+++ b/plasma-breeze.spec
@@ -16,6 +16,12 @@ URL: https://invent.kde.org/plasma/%{base_name}.git
Source0: https://download.kde.org/%{stable_kf6}/plasma/%{version}/%{base_name}-%{version}.tar.xz
Source1: https://download.kde.org/%{stable_kf6}/plasma/%{version}/%{base_name}-%{version}.tar.xz.sig
+# Upstream Patches
+
+# Use font metrics to only inset where the text can spare it
+# https://invent.kde.org/plasma/breeze/-/commit/a74ad95349ec913f1042f5390dbd95a8341aea06
+Patch0: a74ad95349ec913f1042f5390dbd95a8341aea06.patch
+
# Misc
BuildRequires: extra-cmake-modules
BuildRequires: gettext
reply other threads:[~2026-08-15 13:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178679905235.1.2370021334973794487.rpms-plasma-breeze-c4a6af5ee904@fedoraproject.org \
--to=farchord@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox