commit:     c1b6912946d2a307fc754deca8f8266d29522af7
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 24 23:04:33 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jul 26 12:04:51 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1b69129

kde-frameworks/qqc2-desktop-style: ProgressBar/Slider/ToolTip fixes

Upstream commits:
6a095ad15153479e22472628ddfe1bab1183d911
efb795efbe0579cb30cc042d61214c139c5fb110
299748e9bdc01a30e90cb7413b0815564864dc3b
939273025ed92246b5e6d1e3a944a8c88bbc682b

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=455339
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=456729
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=457079
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...p-style-5.96.0-drop-layout-direction-hack.patch | 27 +++++++++
 ...c2-desktop-style-5.96.0-fix-menubar-theme.patch | 31 ++++++++++
 .../qqc2-desktop-style-5.96.0-fix-precision.patch  | 70 ++++++++++++++++++++++
 ...-desktop-style-5.96.0-strip-out-apersands.patch | 47 +++++++++++++++
 .../qqc2-desktop-style-5.96.0-r1.ebuild            | 36 +++++++++++
 5 files changed, 211 insertions(+)

diff --git 
a/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-drop-layout-direction-hack.patch
 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-drop-layout-direction-hack.patch
new file mode 100644
index 000000000000..6f31670f5a52
--- /dev/null
+++ 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-drop-layout-direction-hack.patch
@@ -0,0 +1,27 @@
+From 6a095ad15153479e22472628ddfe1bab1183d911 Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <[email protected]>
+Date: Sat, 4 Jun 2022 03:11:58 +0300
+Subject: [PATCH] ProgressBar: Drop layout direction hack
+
+It is not needed anymore: mirroring is now handled correctly in the
+Breeze theme implementation.
+---
+ org.kde.desktop/ProgressBar.qml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/org.kde.desktop/ProgressBar.qml b/org.kde.desktop/ProgressBar.qml
+index 23c1df3..2d075c7 100644
+--- a/org.kde.desktop/ProgressBar.qml
++++ b/org.kde.desktop/ProgressBar.qml
+@@ -26,7 +26,7 @@ T.ProgressBar {
+         control: controlRoot
+         maximum: indeterminate ? 0 : 10000 * controlRoot.to
+         minimum: indeterminate ? 0 : 10000 * controlRoot.from
+-        value: indeterminate ? 0 : 10000 * ((Qt.application.layoutDirection 
=== Qt.LeftToRight ? controlRoot.visualPosition : 1 - 
controlRoot.visualPosition) * (controlRoot.to - controlRoot.from) + 
controlRoot.from)
++        value: indeterminate ? 0 : 10000 * controlRoot.value
+         horizontal: true
+         enabled: controlRoot.enabled
+ 
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-menubar-theme.patch
 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-menubar-theme.patch
new file mode 100644
index 000000000000..6cb908283ffc
--- /dev/null
+++ 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-menubar-theme.patch
@@ -0,0 +1,31 @@
+From 299748e9bdc01a30e90cb7413b0815564864dc3b Mon Sep 17 00:00:00 2001
+From: Kartikey Subramanium <[email protected]>
+Date: Wed, 20 Jul 2022 14:33:55 +0000
+Subject: [PATCH] Fix QQC2 MenuBar theme.
+
+BUG: 456729
+
+| Before | After |
+| ------ | ------ |
+| 
![Screenshot_20220720_193546](/uploads/4eded8d26fe77b8a64d9abd7806ecf2f/Screenshot_20220720_193546.png)
 | 
![Screenshot_20220720_193536](/uploads/825c2cc901d859ea5cd84fe299bdc941/Screenshot_20220720_193536.png)
 |
+---
+ org.kde.desktop/MenuBar.qml | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/org.kde.desktop/MenuBar.qml b/org.kde.desktop/MenuBar.qml
+index f10b01a..68b92af 100644
+--- a/org.kde.desktop/MenuBar.qml
++++ b/org.kde.desktop/MenuBar.qml
+@@ -13,6 +13,9 @@ import org.kde.kirigami 2.4 as Kirigami
+ T.MenuBar {
+     id: controlRoot
+ 
++    Kirigami.Theme.colorSet: Kirigami.Theme.Header
++    Kirigami.Theme.inherit: false
++
+     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+                             contentWidth + leftPadding + rightPadding)
+     implicitHeight: Math.max(implicitBackgroundHeight + topInset + 
bottomInset,
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-precision.patch
 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-precision.patch
new file mode 100644
index 000000000000..36705ce0c8b6
--- /dev/null
+++ 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-fix-precision.patch
@@ -0,0 +1,70 @@
+From efb795efbe0579cb30cc042d61214c139c5fb110 Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <[email protected]>
+Date: Fri, 22 Jul 2022 20:31:48 +0300
+Subject: [PATCH] ProgressBar,Slider: Adapt great precision to the harsh
+ reality
+
+Test case: `to` values >= 214749 should work.
+
+BUG: 455339
+---
+ org.kde.desktop/ProgressBar.qml | 10 +++++++---
+ org.kde.desktop/Slider.qml      | 12 ++++++++----
+ 2 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/org.kde.desktop/ProgressBar.qml b/org.kde.desktop/ProgressBar.qml
+index 18d879b..77beb1b 100644
+--- a/org.kde.desktop/ProgressBar.qml
++++ b/org.kde.desktop/ProgressBar.qml
+@@ -22,11 +22,15 @@ T.ProgressBar {
+     contentItem: Item {}
+ 
+     background: StylePrivate.StyleItem {
++        // Rescale for extra precision. Adapts to the range of `from` & `to` 
to avoid integer overflow.
++        property int factor: (Math.abs(controlRoot.from) < 100000 && 
Math.abs(controlRoot.to) < 100000)
++            ? 10000 : 1
++
+         elementType: "progressbar"
+         control: controlRoot
+-        maximum: indeterminate ? 0 : 10000 * controlRoot.to
+-        minimum: indeterminate ? 0 : 10000 * controlRoot.from
+-        value: indeterminate ? 0 : 10000 * controlRoot.value
++        maximum: indeterminate ? 0 : factor * controlRoot.to
++        minimum: indeterminate ? 0 : factor * controlRoot.from
++        value: indeterminate ? 0 : factor * controlRoot.value
+         horizontal: true
+         enabled: controlRoot.enabled
+ 
+diff --git a/org.kde.desktop/Slider.qml b/org.kde.desktop/Slider.qml
+index 58bc99a..49b8ccb 100644
+--- a/org.kde.desktop/Slider.qml
++++ b/org.kde.desktop/Slider.qml
+@@ -28,6 +28,10 @@ T.Slider {
+     snapMode: T.Slider.SnapOnRelease
+ 
+     background: StylePrivate.StyleItem {
++        // Rescale for extra precision. Adapts to the range of `from` & `to` 
to avoid integer overflow.
++        property int factor: (Math.abs(controlRoot.from) < 100000 && 
Math.abs(controlRoot.to) < 100000)
++            ? 10000 : 1
++
+         control: controlRoot
+         elementType: "slider"
+         sunken: controlRoot.pressed
+@@ -36,10 +40,10 @@ T.Slider {
+         contentHeight: horizontal ? (Kirigami.Settings.tabletMode ? 24 : 22) 
: controlRoot.implicitHeight
+         anchors.verticalCenter: controlRoot.verticalCenter
+ 
+-        maximum: 10000 * controlRoot.to
+-        minimum: 10000 * controlRoot.from
+-        step: 10000 * controlRoot.stepSize
+-        value: 10000 * controlRoot.value
++        maximum: factor * controlRoot.to
++        minimum: factor * controlRoot.from
++        step: factor * controlRoot.stepSize
++        value: factor * controlRoot.value
+         horizontal: controlRoot.orientation === Qt.Horizontal
+         enabled: controlRoot.enabled
+         hasFocus: controlRoot.activeFocus
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-strip-out-apersands.patch
 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-strip-out-apersands.patch
new file mode 100644
index 000000000000..59bb60c6c347
--- /dev/null
+++ 
b/kde-frameworks/qqc2-desktop-style/files/qqc2-desktop-style-5.96.0-strip-out-apersands.patch
@@ -0,0 +1,47 @@
+From 939273025ed92246b5e6d1e3a944a8c88bbc682b Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <[email protected]>
+Date: Fri, 22 Jul 2022 21:27:04 +0300
+Subject: [PATCH] ToolTip: Sync to PC3: Strip out ampersands
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Easily reproducible broken example: put a notes applet on a desktop,
+hover over its "Configure…" button (it should be fine so far), then
+right click it, press Escape (or otherwise close the context menu, and
+hover again: now the tooltip spells "&Configure…" because for some
+reason a mnemonic was added during this time.
+---
+ org.kde.desktop/ToolTip.qml | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/org.kde.desktop/ToolTip.qml b/org.kde.desktop/ToolTip.qml
+index 40dfcbd..3a03cc5 100644
+--- a/org.kde.desktop/ToolTip.qml
++++ b/org.kde.desktop/ToolTip.qml
+@@ -13,7 +13,7 @@ import QtQuick.Layouts 1.15
+ import org.kde.kirigami 2.12 as Kirigami
+ 
+ T.ToolTip {
+-    id: controlRoot
++    id: control
+ 
+     Kirigami.Theme.colorSet: Kirigami.Theme.Tooltip
+     Kirigami.Theme.inherit: false
+@@ -41,9 +41,11 @@ T.ToolTip {
+     closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | 
T.Popup.CloseOnReleaseOutsideParent
+ 
+     contentItem: Controls.Label {
+-        text: controlRoot.text
++        // Strip out ampersands right before non-whitespace characters, i.e.
++        // those used to determine the alt key shortcut
++        text: control.text.replace(/&(?=\S)/g, "")
+         wrapMode: Text.WordWrap
+-        font: controlRoot.font
++        font: control.font
+         Kirigami.Theme.colorSet: Kirigami.Theme.Tooltip
+         color: Kirigami.Theme.textColor
+     }
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.96.0-r1.ebuild 
b/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.96.0-r1.ebuild
new file mode 100644
index 000000000000..4f8f1501b88f
--- /dev/null
+++ b/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.96.0-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_QTHELP="false"
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.15.4
+inherit ecm frameworks.kde.org
+
+DESCRIPTION="Style for QtQuickControls 2 that uses QWidget's QStyle for 
painting"
+
+LICENSE="|| ( GPL-2+ LGPL-3+ )"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE=""
+
+DEPEND="
+       >=dev-qt/qtdeclarative-${QTMIN}:5=
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       =kde-frameworks/kconfigwidgets-${PVCUT}*:5
+       =kde-frameworks/kiconthemes-${PVCUT}*:5
+       =kde-frameworks/kirigami-${PVCUT}*:5
+       =kde-frameworks/sonnet-${PVCUT}*:5[qml]
+"
+RDEPEND="${DEPEND}
+       >=dev-qt/qtgraphicaleffects-${QTMIN}:5
+       >=dev-qt/qtquickcontrols2-${QTMIN}:5
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}-fix-menubar-theme.patch" # KDE-bug #456729
+       "${FILESDIR}/${P}-drop-layout-direction-hack.patch" # mirror fix in 
breeze 5.24.6-r1
+       "${FILESDIR}/${P}-fix-precision.patch" # KDE-bug #455339
+       "${FILESDIR}/${P}-strip-out-apersands.patch" # KDE-bug #457079
+)

Reply via email to