* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwidgetsaddons/, kde-frameworks/kwidgetsaddons/files/
@ 2019-01-30 17:28 Andreas Sturmlechner
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2019-01-30 17:28 UTC (permalink / raw
To: gentoo-commits
commit: c3581c4fe51dcd2ceadc1977a135fa78050b9213
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 30 16:56:46 2019 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 30 16:56:46 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3581c4f
kde-frameworks/kwidgetsaddons: No light font styles for headings
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 <AT> gentoo.org>
...addons-5.54.0-no-light-fontstyle-headings.patch | 88 ++++++++++++++++++++++
.../kwidgetsaddons/kwidgetsaddons-5.54.0-r1.ebuild | 28 +++++++
2 files changed, 116 insertions(+)
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
index 00000000000..38c89728b52
--- /dev/null
+++ b/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.54.0-no-light-fontstyle-headings.patch
@@ -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
index 00000000000..274e1794131
--- /dev/null
+++ b/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.54.0-r1.ebuild
@@ -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
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwidgetsaddons/, kde-frameworks/kwidgetsaddons/files/
@ 2021-11-23 14:59 Andreas Sturmlechner
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2021-11-23 14:59 UTC (permalink / raw
To: gentoo-commits
commit: 0f5e823650417f6d4598d24407c6b6de8983906c
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 23 11:22:02 2021 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Nov 23 14:59:10 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f5e8236
kde-frameworks/kwidgetsaddons: Fix conflicts w/ actions w/ Alt+X shortcuts
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=444990
Upstream commit 294fe8ddc2f10d0a783bf9b80769c31ecc5922b1
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
....88.0-kacceleratormanager-alt-x-shortcuts.patch | 149 +++++++++++++++++++++
.../kwidgetsaddons/kwidgetsaddons-5.88.0-r1.ebuild | 38 ++++++
2 files changed, 187 insertions(+)
diff --git a/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.88.0-kacceleratormanager-alt-x-shortcuts.patch b/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.88.0-kacceleratormanager-alt-x-shortcuts.patch
new file mode 100644
index 000000000000..6e7ca9e47298
--- /dev/null
+++ b/kde-frameworks/kwidgetsaddons/files/kwidgetsaddons-5.88.0-kacceleratormanager-alt-x-shortcuts.patch
@@ -0,0 +1,149 @@
+From 294fe8ddc2f10d0a783bf9b80769c31ecc5922b1 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Fri, 5 Nov 2021 23:23:59 +0100
+Subject: [PATCH] KAcceleratorManager: Take into account actions with Alt+X
+ shortcuts
+
+We need to mark those X labels as used, otherwise the accelerator
+manager may decide to use X for an accelerator and when pressing Alt+X
+we will have a conflict
+
+BUGS: 444990
+---
+ autotests/kacceleratormanagertest.cpp | 21 +++++++++++++++++++
+ src/kacceleratormanager.cpp | 30 ++++++++++++++++++++-------
+ src/kacceleratormanager_p.h | 4 ++--
+ 3 files changed, 46 insertions(+), 9 deletions(-)
+
+diff --git a/autotests/kacceleratormanagertest.cpp b/autotests/kacceleratormanagertest.cpp
+index 3fc07928..2bdc4f74 100644
+--- a/autotests/kacceleratormanagertest.cpp
++++ b/autotests/kacceleratormanagertest.cpp
+@@ -8,6 +8,7 @@
+ #include <kacceleratormanager.h>
+
+ #include <QMenu>
++#include <QPushButton>
+ #include <QTest>
+
+ #define QSL QStringLiteral
+@@ -75,6 +76,26 @@ private Q_SLOTS:
+ QCOMPARE(texts, expectedTexts);
+ }
+
++ void testExistingActionsShortcutsAreTakenIntoAccount()
++ {
++ std::unique_ptr<QWidget> w(new QWidget());
++
++ QPushButton *pb = new QPushButton(QSL("Open"), w.get());
++
++ KAcceleratorManager::manage(w.get());
++ QCOMPARE(pb->text(), QSL("&Open"));
++
++ delete pb;
++ pb = new QPushButton(QSL("Open"), w.get());
++
++ QAction *a = new QAction();
++ a->setShortcut(QSL("Alt+O"));
++ w->addAction(a);
++
++ KAcceleratorManager::manage(w.get());
++ QCOMPARE(pb->text(), QSL("O&pen"));
++ }
++
+ void testActionIconTexts_data()
+ {
+ QTest::addColumn<QStringList>("initialTexts");
+diff --git a/src/kacceleratormanager.cpp b/src/kacceleratormanager.cpp
+index 66d596d3..2f7b1879 100644
+--- a/src/kacceleratormanager.cpp
++++ b/src/kacceleratormanager.cpp
+@@ -94,9 +94,8 @@ void KAcceleratorManagerPrivate::manage(QWidget *widget)
+
+ Item *root = new Item;
+
+- manageWidget(widget, root);
+-
+ QString used;
++ manageWidget(widget, root, used);
+ calculateAccelerators(root, used);
+ delete root;
+ }
+@@ -175,7 +174,7 @@ void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, QString &used
+ }
+ }
+
+-void KAcceleratorManagerPrivate::traverseChildren(QWidget *widget, Item *item)
++void KAcceleratorManagerPrivate::traverseChildren(QWidget *widget, Item *item, QString &used)
+ {
+ const QList<QWidget *> childList = widget->findChildren<QWidget *>();
+ for (QWidget *w : childList) {
+@@ -192,12 +191,29 @@ void KAcceleratorManagerPrivate::traverseChildren(QWidget *widget, Item *item)
+ continue;
+ }
+
+- manageWidget(w, item);
++ manageWidget(w, item, used);
+ }
+ }
+
+-void KAcceleratorManagerPrivate::manageWidget(QWidget *w, Item *item)
++void KAcceleratorManagerPrivate::manageWidget(QWidget *w, Item *item, QString &used)
+ {
++ // If the widget has any action whose shortcuts contain keystrokes in the
++ // form of Alt+X we need to mark X as used, otherwise we may assign it as accelerator
++ // and there will be a conflict when trying to use it
++ const QList<QAction *> widgetActions = w->actions();
++ for (QAction *action : widgetActions) {
++ const QList<QKeySequence> actionShortcuts = action->shortcuts();
++ for (const QKeySequence &sequence : actionShortcuts) {
++ const QString sequenceAsText = sequence.toString(QKeySequence::PortableText);
++ const QStringList splitSequence = sequenceAsText.split(QStringLiteral(", "));
++ for (const QString &shortcut : splitSequence) {
++ if (shortcut.length() == 5 && shortcut.startsWith(QStringLiteral("Alt+"))) {
++ used.append(shortcut.right(1));
++ }
++ }
++ }
++ }
++
+ // first treat the special cases
+
+ QTabBar *tabBar = qobject_cast<QTabBar *>(w);
+@@ -247,7 +263,7 @@ void KAcceleratorManagerPrivate::manageWidget(QWidget *w, Item *item)
+ }
+
+ if (w->inherits("KUrlRequester")) {
+- traverseChildren(w, item);
++ traverseChildren(w, item, used);
+ return;
+ }
+
+@@ -316,7 +332,7 @@ void KAcceleratorManagerPrivate::manageWidget(QWidget *w, Item *item)
+ item->addChild(i);
+ }
+ }
+- traverseChildren(w, item);
++ traverseChildren(w, item, used);
+ }
+
+ void KAcceleratorManagerPrivate::manageTabBar(QTabBar *bar, Item *item)
+diff --git a/src/kacceleratormanager_p.h b/src/kacceleratormanager_p.h
+index a92d04ab..04926476 100644
+--- a/src/kacceleratormanager_p.h
++++ b/src/kacceleratormanager_p.h
+@@ -227,9 +227,9 @@ public:
+ typedef QList<Item *> ItemList;
+
+ private:
+- static void traverseChildren(QWidget *widget, Item *item);
++ static void traverseChildren(QWidget *widget, Item *item, QString &used);
+
+- static void manageWidget(QWidget *widget, Item *item);
++ static void manageWidget(QWidget *widget, Item *item, QString &used);
+ static void manageMenuBar(QMenuBar *mbar, Item *item);
+ static void manageTabBar(QTabBar *bar, Item *item);
+ static void manageDockWidget(QDockWidget *dock, Item *item);
+--
+GitLab
+
diff --git a/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.88.0-r1.ebuild b/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.88.0-r1.ebuild
new file mode 100644
index 000000000000..cb0733f838d6
--- /dev/null
+++ b/kde-frameworks/kwidgetsaddons/kwidgetsaddons-5.88.0-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_DESIGNERPLUGIN="true"
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="An assortment of high-level widgets for common tasks"
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="nls"
+
+DEPEND="
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+
+PATCHES=( "${FILESDIR}/${P}-kacceleratormanager-alt-x-shortcuts.patch" ) # KDE-bug 444990
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_PythonModuleGeneration=ON # bug 746866
+ )
+ ecm_src_configure
+}
+
+src_test() {
+ # bug 650216, 653186, 697866, 808216
+ local myctestargs=( -E "(kdatecomboboxtest|ksqueezedtextlabelautotest|ktwofingertaptest|ktwofingerswipetest)" )
+ ecm_src_test
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-23 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-23 14:59 [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwidgetsaddons/, kde-frameworks/kwidgetsaddons/files/ Andreas Sturmlechner
-- strict thread matches above, loose matches on Subject: below --
2019-01-30 17:28 Andreas Sturmlechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox