kde-frameworks/kwidgetsaddons: No light font styles for headings
authorAndreas Sturmlechner <asturm@gentoo.org>
Wed, 30 Jan 2019 16:56:46 +0000 (17:56 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Wed, 30 Jan 2019 16:56:46 +0000 (17:56 +0100)
Fixes a readability regression in 5.53.0.

KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=402730
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.54.0-no-light-fontstyle-headings.patch [new file with mode: 0644]
kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.54.0-r1.ebuild [new file with mode: 0644]

diff --git a/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.54.0-no-light-fontstyle-headings.patch b/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.54.0-no-light-fontstyle-headings.patch
new file mode 100644 (file)
index 0000000..38c8972
--- /dev/null
@@ -0,0 +1,88 @@
+From dc901a1f0b5f6621bfa1c23e33dcfdf6246e7cb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Cohar?= <kcohar@gmail.com>
+Date: Thu, 10 Jan 2019 09:19:33 -0700
+Subject: [KWidgetsAddons] Do not use light font styles for headings (3/3)
+
+Summary:
+This patch brings back regular font styles for headings to KTitleWidget for the sake of consistency with QML and Kirigami, where they were also reintroduced in favor of better legibility.
+
+CCBUG: 402730
+
+FIXED-IN: 5.54
+
+Test Plan:
+Before:
+{F6520054}
+After:
+{F6520058}
+
+Reviewers: ngraham, #frameworks, #vdg, #plasma
+
+Reviewed By: ngraham, #vdg
+
+Subscribers: cfeck, filipf, kde-frameworks-devel
+
+Tags: #frameworks
+
+Differential Revision: https://phabricator.kde.org/D17907
+---
+ src/ktitlewidget.cpp | 29 -----------------------------
+ 1 file changed, 29 deletions(-)
+
+diff --git a/src/ktitlewidget.cpp b/src/ktitlewidget.cpp
+index 7a34bc2..d8b0517 100644
+--- a/src/ktitlewidget.cpp
++++ b/src/ktitlewidget.cpp
+@@ -213,16 +213,6 @@ void KTitleWidget::changeEvent(QEvent *e)
+     if (e->type() == QEvent::PaletteChange || e->type() == QEvent::FontChange
+                                            || e->type() == QEvent::ApplicationFontChange) {
+         d->textLabel->setStyleSheet(d->textStyleSheet());
+-        //Qt stylesheet doesn't support lighter font-weight
+-        QFont font(d->textLabel->font());
+-        if (d->level <= 4) {
+-            font.setWeight(QFont::Light);
+-            font.setStyleName(QStringLiteral("Light"));
+-        } else {
+-            font.setWeight(QFont::Normal);
+-            font.setStyleName(QStringLiteral("Regular"));
+-        }
+-        d->textLabel->setFont(font);
+         d->commentLabel->setStyleSheet(d->commentStyleSheet());
+     }
+ }
+@@ -233,16 +223,6 @@ void KTitleWidget::setText(const QString &text, Qt::Alignment alignment)
+     if (!Qt::mightBeRichText(text)) {
+         d->textLabel->setStyleSheet(d->textStyleSheet());
+-        //Qt stylesheet doesn't support lighter font-weight
+-        QFont font(d->textLabel->font());
+-        if (d->level <= 4) {
+-            font.setWeight(QFont::Light);
+-            font.setStyleName(QStringLiteral("Light"));
+-        } else {
+-            font.setWeight(QFont::Normal);
+-            font.setStyleName(QStringLiteral("Regular"));
+-        }
+-        d->textLabel->setFont(font);
+     }
+     d->textLabel->setText(text);
+@@ -259,15 +239,6 @@ void KTitleWidget::setLevel(int level)
+     d->level = level;
+     d->textLabel->setStyleSheet(d->textStyleSheet());
+-    //Qt stylesheet doesn't support lighter font-weight
+-    QFont font(d->textLabel->font());
+-    if (d->level <= 4) {
+-        font.setWeight(QFont::Light);
+-        font.setStyleName(QStringLiteral("Light"));
+-    } else {
+-        font.setWeight(QFont::Normal);
+-        font.setStyleName(QStringLiteral("Regular"));
+-    }
+ }
+ int KTitleWidget::level()
+-- 
+cgit v1.1
+
diff --git a/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.54.0-r1.ebuild b/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.54.0-r1.ebuild
new file mode 100644 (file)
index 0000000..274e179
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="An assortment of high-level widgets for common tasks"
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="nls"
+
+RDEPEND="
+       $(add_qt_dep qtgui)
+       $(add_qt_dep qtwidgets)
+"
+DEPEND="${RDEPEND}
+       nls? ( $(add_qt_dep linguist-tools) )
+"
+
+PATCHES=( "${FILESDIR}/${P}-no-light-fontstyle-headings.patch" )
+
+src_test() {
+       # bug 650216, 653186
+       local myctestargs=( -E "(kdatecomboboxtest|ktooltipwidgettest)" )
+       kde5_src_test
+}