Hello community, here is the log from the commit of package qqc2-desktop-style for openSUSE:Factory checked in at 2020-08-12 12:27:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qqc2-desktop-style (Old) and /work/SRC/openSUSE:Factory/.qqc2-desktop-style.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qqc2-desktop-style" Wed Aug 12 12:27:17 2020 rev:37 rq:825122 version:5.73.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qqc2-desktop-style/qqc2-desktop-style.changes 2020-07-14 07:57:28.833438183 +0200 +++ /work/SRC/openSUSE:Factory/.qqc2-desktop-style.new.3399/qqc2-desktop-style.changes 2020-08-12 12:29:36.520186543 +0200 @@ -1,0 +2,16 @@ +Sun Aug 2 07:13:59 UTC 2020 - Christophe Giboudeaux <[email protected]> + +- Update to 5.73.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/kde-frameworks-5.73.0 +- Changes since 5.72.0: + * Use "raised" style for non-flat toolbuttons + * Only reserve space for the icon in toolbutton if we actually have an icon + * Support showing a menu arrow on tool buttons + * Use camelcase include. (scripted) + * Really fix menu separator height on high DPI + * Update Mainpage.dox + * Set height of MenuSeparator properly (kde#423653) + +------------------------------------------------------------------- Old: ---- qqc2-desktop-style-5.72.0.tar.xz qqc2-desktop-style-5.72.0.tar.xz.sig New: ---- qqc2-desktop-style-5.73.0.tar.xz qqc2-desktop-style-5.73.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qqc2-desktop-style.spec ++++++ --- /var/tmp/diff_new_pack.yFrlcl/_old 2020-08-12 12:29:37.036186820 +0200 +++ /var/tmp/diff_new_pack.yFrlcl/_new 2020-08-12 12:29:37.040186822 +0200 @@ -16,11 +16,11 @@ # -%define _tar_path 5.72 +%define _tar_path 5.73 # Only needed for the package signature condition %bcond_without lang Name: qqc2-desktop-style -Version: 5.72.0 +Version: 5.73.0 Release: 0 Summary: A Qt Quick Controls 2 Style for Desktop UIs License: GPL-2.0-or-later ++++++ qqc2-desktop-style-5.72.0.tar.xz -> qqc2-desktop-style-5.73.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/CMakeLists.txt new/qqc2-desktop-style-5.73.0/CMakeLists.txt --- old/qqc2-desktop-style-5.72.0/CMakeLists.txt 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/CMakeLists.txt 2020-08-01 21:21:36.000000000 +0200 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.72.0") # handled by release scripts -set(KF5_DEP_VERSION "5.72.0") # handled by release scripts +set(KF5_VERSION "5.73.0") # handled by release scripts +set(KF5_DEP_VERSION "5.73.0") # handled by release scripts project(qqc2-desktop-style VERSION ${KF5_VERSION}) @@ -21,7 +21,7 @@ ################# set KDE specific information ################# -find_package(ECM 5.72.0 REQUIRED NO_MODULE) +find_package(ECM 5.73.0 REQUIRED NO_MODULE) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/Mainpage.dox new/qqc2-desktop-style-5.73.0/Mainpage.dox --- old/qqc2-desktop-style-5.72.0/Mainpage.dox 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/Mainpage.dox 2020-08-01 21:21:36.000000000 +0200 @@ -10,19 +10,28 @@ \section overview Introduction -This is a style for QtQuicControls2 which is using QStyle to paint the controls in order to give it a native look and feel. -It has no api, applications shouldn't (and can't) use it directly, but they can depend from this framework in their desktop version if they want to impose an integrated look when running on the desktop. -It will be used when the environment variable QT_QUICK_CONTROLS_STYLE=org.kde.desktop is exported, or from the following C++ code: -@code -#include <QQuickStyle> -... -int main(int argc, char *argv[]) -{ - ... - QQuickStyle::setStyle("org.kde.desktop"); - ... -} -@endcode + +QQC2-Desktop-Style is a style for Qt Quick Controls 2 (QQC2) which uses [`QStyle`](https://doc.qt.io/qt-5/qstyle.html) to paint the controls in order to give them native look and feel. + +This framework has no public API, applications should not (and can not) use it directly. Instead, developers should add this framework as a dependency of their desktop apps. + +Style name is `"org.kde.desktop"`. It can be enabled like [any other QQC2 style](https://doc.qt.io/qt-5/qtquickcontrols2-styles.html#using-styles-in-qt-quick-controls), e.g.: + - via environment variable `QT_QUICK_CONTROLS_STYLE=org.kde.desktop` + - from the C++ code: + + @code{cpp} + #include <QQuickStyle> + + int main(int argc, char *argv[]) + { + QGuiApplication app(argc, argv); + + QQuickStyle::setStyle("org.kde.desktop"); + + QQmlApplicationEngine engine; + // ... + } + @endcode @authors Marco Martin \<[email protected]\><br> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/org.kde.desktop/MenuSeparator.qml new/qqc2-desktop-style-5.73.0/org.kde.desktop/MenuSeparator.qml --- old/qqc2-desktop-style-5.72.0/org.kde.desktop/MenuSeparator.qml 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/org.kde.desktop/MenuSeparator.qml 2020-08-01 21:21:36.000000000 +0200 @@ -13,12 +13,13 @@ T.MenuSeparator { id: controlRoot - implicitHeight: Kirigami.Units.smallSpacing + separator.height + implicitHeight: Kirigami.Units.smallSpacing + separator.implicitHeight width: parent.width background: Kirigami.Separator { id: separator anchors.centerIn: controlRoot width: controlRoot.width + height: implicitHeight } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/org.kde.desktop/ToolButton.qml new/qqc2-desktop-style-5.73.0/org.kde.desktop/ToolButton.qml --- old/qqc2-desktop-style-5.72.0/org.kde.desktop/ToolButton.qml 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/org.kde.desktop/ToolButton.qml 2020-08-01 21:21:36.000000000 +0200 @@ -38,12 +38,13 @@ id: styleitem anchors.fill:parent control: controlRoot - elementType: controlRoot.flat ? "toolbutton" : "button" + elementType: "toolbutton" on: controlRoot.pressed || (controlRoot.checkable && controlRoot.checked) hover: controlRoot.hovered text: controlRoot.Kirigami.MnemonicData.mnemonicLabel hasFocus: false activeControl: controlRoot.isDefault ? "default" : "f" + raised: !controlRoot.flat properties: { "icon": controlRoot.icon ? (controlRoot.icon.name || controlRoot.icon.source) : "", "iconColor": controlRoot.icon && controlRoot.icon.color.a > 0? controlRoot.icon.color : Kirigami.Theme.textColor, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/plugin/kquickpadding_p.h new/qqc2-desktop-style-5.73.0/plugin/kquickpadding_p.h --- old/qqc2-desktop-style-5.72.0/plugin/kquickpadding_p.h 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/plugin/kquickpadding_p.h 2020-08-01 21:21:36.000000000 +0200 @@ -11,7 +11,7 @@ #ifndef KQUICKPADDING_H #define KQUICKPADDING_H -#include <qobject.h> +#include <QObject> class KQuickPadding : public QObject { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/plugin/kquickstyleitem.cpp new/qqc2-desktop-style-5.73.0/plugin/kquickstyleitem.cpp --- old/qqc2-desktop-style-5.72.0/plugin/kquickstyleitem.cpp 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/plugin/kquickstyleitem.cpp 2020-08-01 21:21:36.000000000 +0200 @@ -10,18 +10,18 @@ #include "kquickstyleitem_p.h" -#include <qstringbuilder.h> -#include <qpainter.h> -#include <qpixmapcache.h> -#include <qstyle.h> -#include <qstylefactory.h> +#include <QStringBuilder> +#include <QPainter> +#include <QPixmapCache> +#include <QStyle> +#include <QStyleFactory> #include <qstyleoption.h> -#include <qapplication.h> -#include <qquickwindow.h> +#include <QApplication> +#include <QQuickWindow> #include <QtQuick/qsgninepatchnode.h> #include <ksharedconfig.h> -#include <kconfiggroup.h> +#include <KConfigGroup> #include <Kirigami2/PlatformTheme> @@ -206,8 +206,8 @@ } const QFont font = qApp->font("QPushButton"); opt->fontMetrics = QFontMetrics(font); - QObject * menu = m_properties[QStringLiteral("menu")].value<QObject *>(); - if (menu) { + bool hasMenu = m_properties[QStringLiteral("menu")].toBool(); + if (hasMenu) { opt->features |= QStyleOptionButton::HasMenu; } } @@ -295,7 +295,11 @@ QStyleOptionToolButton *opt = qstyleoption_cast<QStyleOptionToolButton*>(m_styleoption); opt->subControls = QStyle::SC_ToolButton; - opt->state |= QStyle::State_AutoRaise; + + if (!m_raised || m_on) { + opt->state |= QStyle::State_AutoRaise; + } + opt->activeSubControls = QStyle::SC_ToolButton; opt->text = text(); const QVariant icon = m_properties[QStringLiteral("icon")]; @@ -317,8 +321,7 @@ opt->iconSize = iconSize; if (m_properties.value(QStringLiteral("menu")).toBool()) { - opt->subControls |= QStyle::SC_ToolButtonMenu; - opt->features = QStyleOptionToolButton::HasMenu; + opt->features = QStyleOptionToolButton::Menu; } const int toolButtonStyle = m_properties.value(QStringLiteral("toolButtonStyle")).toInt(); @@ -916,8 +919,10 @@ int h = 0; if (btn->toolButtonStyle != Qt::ToolButtonTextOnly) { QSize icon = btn->iconSize; - w = icon.width(); - h = icon.height(); + if (btn->toolButtonStyle == Qt::ToolButtonIconOnly || !btn->icon.isNull()) { + w = icon.width(); + h = icon.height(); + } } if (btn->toolButtonStyle != Qt::ToolButtonIconOnly) { QSize textSize = btn->fontMetrics.size(Qt::TextShowMnemonic, btn->text); @@ -935,6 +940,9 @@ h = textSize.height(); } } + if (btn->features & QStyleOptionToolButton::Menu) { + w += KQuickStyleItem::style()->subControlRect(QStyle::CC_ToolButton, btn, QStyle::SC_ToolButtonMenu).width(); + } btn->rect.setSize(QSize(w, h)); size = KQuickStyleItem::style()->sizeFromContents(QStyle::CT_ToolButton, m_styleoption, QSize(w, h)); } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/plugin/qsgdefaultninepatchnode_p.h new/qqc2-desktop-style-5.73.0/plugin/qsgdefaultninepatchnode_p.h --- old/qqc2-desktop-style-5.72.0/plugin/qsgdefaultninepatchnode_p.h 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/plugin/qsgdefaultninepatchnode_p.h 2020-08-01 21:21:36.000000000 +0200 @@ -21,7 +21,7 @@ // //#include <private/qtquickglobal_p.h> -#include "qsgninepatchnode.h" +#include <QSGNinePatchNode> #include <QtQuick/qsggeometry.h> #include <QtQuick/qsgtexturematerial.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/plugin/qsgninepatchnode.cpp new/qqc2-desktop-style-5.73.0/plugin/qsgninepatchnode.cpp --- old/qqc2-desktop-style-5.72.0/plugin/qsgninepatchnode.cpp 2020-07-04 11:59:39.000000000 +0200 +++ new/qqc2-desktop-style-5.73.0/plugin/qsgninepatchnode.cpp 2020-08-01 21:21:36.000000000 +0200 @@ -6,7 +6,7 @@ SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KFQF-Accepted-GPL OR LicenseRef-Qt-Commercial */ -#include "qsgninepatchnode.h" +#include <QSGNinePatchNode> QT_BEGIN_NAMESPACE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qqc2-desktop-style-5.72.0/tests/ToolButton.qml new/qqc2-desktop-style-5.73.0/tests/ToolButton.qml --- old/qqc2-desktop-style-5.72.0/tests/ToolButton.qml 1970-01-01 01:00:00.000000000 +0100 +++ new/qqc2-desktop-style-5.73.0/tests/ToolButton.qml 2020-08-01 21:21:36.000000000 +0200 @@ -0,0 +1,93 @@ +import QtQuick 2.3 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 + +ApplicationWindow +{ + visible: true + width: 800 + height: 600 + + GridLayout { + anchors.fill: parent + anchors.margins: 10 + rows: 6 + flow: GridLayout.TopToBottom + + Label { + text: "Flat" + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Default" + flat: true + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Icon Only" + display: ToolButton.IconOnly + flat: true + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Only" + display: ToolButton.TextOnly + flat: true + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Beside Icon" + display: ToolButton.TextBesideIcon + flat: true + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Below Icon" + display: ToolButton.TextUnderIcon + flat: true + } + + Label { + text: "Non-Flat" + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Default" + flat: false + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Icon Only" + display: ToolButton.IconOnly + flat: false + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Only" + display: ToolButton.TextOnly + flat: false + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Beside Icon" + display: ToolButton.TextBesideIcon + flat: false + } + + ToolButton { + icon.name: "documentinfo" + text: "Tool Button Text Below Icon" + display: ToolButton.TextUnderIcon + flat: false + } + } +}
