KDE Frameworks 5.50.0

OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kcmutils?expand=0&rev=157
This commit is contained in:
Wolfgang Bauer 2018-09-14 13:48:43 +00:00 committed by Git OBS Bridge
parent da3004aaef
commit 36983faed4
6 changed files with 94 additions and 94 deletions

View File

@ -0,0 +1,72 @@
From cc4ecfdcd48a52a67f60eb69ed69e91ca42ee405 Mon Sep 17 00:00:00 2001
From: Valeriy Malov <jazzvoid@gmail.com>
Date: Mon, 10 Sep 2018 17:39:40 +0300
Subject: [PATCH] Manually resize KCMUtilDialog to sizeHint()
Summary:
Workaround for https://bugreports.qt.io/browse/QTBUG-3459
Currently adjustSize() is limited to 2/3 of the screen size for windows
This adds unnecessary scrollbars on dialogs that would otherwise fit the
screen
Manually resize the window after adjustSize() happens to avoid this
limitation
CCBUG: 389585
Test Plan:
Tested on a 1366x768 laptop, with this patch networkmanagement window opens
in full screen height (respecting the panel)
Reviewers: #frameworks, ngraham
Reviewed By: ngraham
Subscribers: davidedmundson, acrouthamel, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D15406
---
src/kcmultidialog.cpp | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/kcmultidialog.cpp b/src/kcmultidialog.cpp
index d5f2f10..2fd7cb8 100644
--- a/src/kcmultidialog.cpp
+++ b/src/kcmultidialog.cpp
@@ -27,8 +27,10 @@
#include "kcmoduleproxy.h"
+#include <QApplication>
#include <QDebug>
#include <QDesktopServices>
+#include <QDesktopWidget>
#include <QProcess>
#include <QPushButton>
#include <QScrollArea>
@@ -261,9 +263,18 @@ KCMultiDialog::~KCMultiDialog()
void KCMultiDialog::showEvent(QShowEvent *ev)
{
- resize(QSize(800, 550));
- adjustSize();
KPageDialog::showEvent(ev);
+ adjustSize();
+ /**
+ * adjustSize() relies on sizeHint but is limited to 2/3 of the desktop size
+ * Workaround for https://bugreports.qt.io/browse/QTBUG-3459
+ *
+ * We adjust the size after passing the show event
+ * because otherwise window pos is set to (0,0)
+ */
+ const QSize maxSize = QApplication::desktop()->availableGeometry(pos()).size();
+ resize(qMin(sizeHint().width(), maxSize.width()),
+ qMin(sizeHint().height(), maxSize.height()));
}
void KCMultiDialog::slotDefaultClicked()
--
2.18.0

View File

@ -1,87 +0,0 @@
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 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:388587f864352e98670c41a9fb615cc6580c42b2b026041a341202976e4a6877
size 236748

3
kcmutils-5.50.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d70e08568a16cb294fae094383afdd4565f2fc39d8020fb347d35807c4453fe1
size 236768

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Thu Sep 13 21:58:44 UTC 2018 - lbeltrame@kde.org
- Update to 5.50.0
* New feature release
* For more details please see:
* https://www.kde.org/announcements/kde-frameworks-5.50.0.php
- Changes since 5.49.0:
* Use custom QScrollArea with size hint not limited by font size (kde#389585)
- Dropped patches, now upstream:
* 0001-Use-custom-QScrollArea-with-size-hint-not-limited-by.patch
- Add upstream patch 0001-Manually-resize-KCMUtilDialog-to-sizeHint.patch:
* Workaround for QTBUG-3459 to prevent too small windows when
system settings modules are opened standalone (kde#389585)
-------------------------------------------------------------------
Tue Aug 28 16:49:02 UTC 2018 - fabian@ritter-vogt.de

View File

@ -12,19 +12,19 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define lname libKF5KCMUtils5
%define _tar_path 5.49
%define _tar_path 5.50
# Full KF5 version (e.g. 5.33.0)
%{!?_kf5_version: %global _kf5_version %{version}}
# Last major and minor KF5 version (e.g. 5.33)
%{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
%bcond_without lang
Name: kcmutils
Version: 5.49.0
Version: 5.50.0
Release: 0
Summary: Classes to work with KCModules
License: LGPL-2.1-or-later
@ -33,7 +33,7 @@ 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
Patch0: 0001-Manually-resize-KCMUtilDialog-to-sizeHint.patch
BuildRequires: cmake >= 3.0
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes