Accepting request 632016 from home:Vogtinator:branches:KDE:Frameworks5

- Add patch to fix default size of kcms (kde#389585):
  * 0001-Use-custom-QScrollArea-with-size-hint-not-limited-by.patch

OBS-URL: https://build.opensuse.org/request/show/632016
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kcmutils?expand=0&rev=155
This commit is contained in:
Luca Beltrame 2018-08-28 20:03:17 +00:00 committed by Git OBS Bridge
parent 1198736e33
commit da3004aaef
3 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,87 @@
From 23ba2b37ef825f0efccc169455f45b0dcdac97cf Mon Sep 17 00:00:00 2001
From: Valeriy Malov <jazzvoid@gmail.com>
Date: Wed, 8 Aug 2018 16:42:00 +0300
Subject: [PATCH] Use custom QScrollArea with size hint not limited by font
size
Summary:
For some reason original QScrollArea has constraint on a size hint
This causes large KCMShell pages open in relatively small windows,
because QScrollArea inside reports small size hint
BUG: 389585
Test Plan:
patched 5.48.0 with this, tested networkmanager and few other kcms,
they now seem to open in full size (except for kscreen which has custom sizehint,
it probably needs size hint for the QML area specifically, not the whole window;
and except for opengl that has it's own scrollable area which needs a size hint too)
Reviewers: #frameworks, ngraham
Reviewed By: ngraham
Subscribers: ngraham, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D14692
---
src/kcmultidialog.cpp | 2 +-
src/kcmultidialog.h | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/kcmultidialog.cpp b/src/kcmultidialog.cpp
index 6526efb..d5f2f10 100644
--- a/src/kcmultidialog.cpp
+++ b/src/kcmultidialog.cpp
@@ -425,7 +425,7 @@ KPageWidgetItem *KCMultiDialog::addModule(const KCModuleInfo &moduleInfo,
}
// Create the scroller
- QScrollArea *moduleScroll = new QScrollArea(this);
+ auto *moduleScroll = new UnboundScrollArea(this);
// Prepare the scroll area
moduleScroll->setWidgetResizable(true);
moduleScroll->setFrameStyle(QFrame::NoFrame);
diff --git a/src/kcmultidialog.h b/src/kcmultidialog.h
index c405dc3..2073be5 100644
--- a/src/kcmultidialog.h
+++ b/src/kcmultidialog.h
@@ -23,6 +23,8 @@
#ifndef KCMULTIDIALOG_H
#define KCMULTIDIALOG_H
+#include <QScrollArea>
+
#include <kcmoduleinfo.h>
#include <kpagedialog.h>
@@ -180,4 +182,24 @@ private:
Q_PRIVATE_SLOT(d_func(), void _k_updateHeader(bool use, const QString &message))
};
+/**
+ * @brief Custom QScrollArea class that doesn't limit its size hint
+ *
+ * See original QScrollArea::sizeHint() function,
+ * where the size hint is bound by 36*24 font heights
+ *
+ * Workaround for https://bugreports.qt.io/browse/QTBUG-10459
+ */
+
+class UnboundScrollArea : public QScrollArea {
+ Q_OBJECT
+public:
+ QSize sizeHint() const override {
+ return widget() ? widget()->sizeHint() : QSize();
+ }
+
+ UnboundScrollArea(QWidget * w) : QScrollArea(w) {}
+ virtual ~UnboundScrollArea() = default;
+};
+
#endif
--
2.18.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Aug 28 16:49:02 UTC 2018 - fabian@ritter-vogt.de
- Add patch to fix default size of kcms (kde#389585):
* 0001-Use-custom-QScrollArea-with-size-hint-not-limited-by.patch
-------------------------------------------------------------------
Tue Aug 21 10:19:23 UTC 2018 - jengelh@inai.de

View File

@ -32,6 +32,8 @@ Group: System/GUI/KDE
URL: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM
Patch1: 0001-Use-custom-QScrollArea-with-size-hint-not-limited-by.patch
BuildRequires: cmake >= 3.0
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes
@ -83,6 +85,7 @@ created with the KConfigWidgets framework. Development files.
%prep
%setup -q
%autopatch -p1
%build
%cmake_kf5 -d build