Hello community,
here is the log from the commit of package qqc2-desktop-style for
openSUSE:Factory checked in at 2018-03-22 12:02:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qqc2-desktop-style (Old)
and /work/SRC/openSUSE:Factory/.qqc2-desktop-style.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qqc2-desktop-style"
Thu Mar 22 12:02:12 2018 rev:7 rq:586871 version:5.44.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/qqc2-desktop-style/qqc2-desktop-style.changes
2018-02-18 11:42:19.605681726 +0100
+++
/work/SRC/openSUSE:Factory/.qqc2-desktop-style.new/qqc2-desktop-style.changes
2018-03-22 12:08:17.682839850 +0100
@@ -1,0 +2,26 @@
+Mon Mar 12 23:29:43 CET 2018 - [email protected]
+
+- Update to 5.44.0
+ * New feature release
+ * For more details please see:
+ * https://www.kde.org/announcements/kde-frameworks-5.44.0.php
+- Changes since 5.43.0:
+ * Fix syntax error in previous commit, detected by launching ruqola
+ * Show a radiobutton when we are showing an exclusive control
+ * fix some Qt 5.9 bugs
+ * implement MenuBarItem
+ * fix logic
+ * implement DelayButton
+ * New component: round button
+ * take into account toolbar position
+ * support colors for icons in buttons
+ * support --reverse
+ * icons in Menu fully functional
+ * consistent shadows with the new breeze style
+ * ame behavior as qwidget menus
+ * make icons actually work
+ * Some QStyles seem to not return sensible pixelmetrics here
+ * first rough icons support
+ * don't wrap around with mouse wheel
+
+-------------------------------------------------------------------
Old:
----
qqc2-desktop-style-5.43.0.tar.xz
New:
----
qqc2-desktop-style-5.44.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qqc2-desktop-style.spec ++++++
--- /var/tmp/diff_new_pack.2GqbSs/_old 2018-03-22 12:08:18.434812895 +0100
+++ /var/tmp/diff_new_pack.2GqbSs/_new 2018-03-22 12:08:18.438812751 +0100
@@ -16,12 +16,12 @@
#
-%define _tar_path 5.43
+%define _tar_path 5.44
Name: qqc2-desktop-style
-Version: 5.43.0
+Version: 5.44.0
Release: 0
Summary: A Qt Quick Controls 2 Style for Desktop UIs
-License: GPL-2.0+
+License: GPL-2.0-or-later
Group: Development/Libraries/KDE
Url: http://www.kde.org/
Source:
https://download.kde.org/stable/frameworks/%{_tar_path}/qqc2-desktop-style-%{version}.tar.xz
++++++ qqc2-desktop-style-5.43.0.tar.xz -> qqc2-desktop-style-5.44.0.tar.xz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/CMakeLists.txt
new/qqc2-desktop-style-5.44.0/CMakeLists.txt
--- old/qqc2-desktop-style-5.43.0/CMakeLists.txt 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/CMakeLists.txt 2018-03-03
10:54:13.000000000 +0100
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
-set(KF5_VERSION "5.43.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.43.0") # handled by release scripts
+set(KF5_VERSION "5.44.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.44.0") # handled by release scripts
project(qqc2-desktop-style VERSION ${KF5_VERSION})
@@ -21,7 +21,7 @@
################# set KDE specific information #################
-find_package(ECM 5.43.0 REQUIRED NO_MODULE)
+find_package(ECM 5.44.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}
${ECM_KDE_MODULE_DIR})
@@ -96,8 +96,14 @@
#FIXME: this assumes there will always be a QQC2 release for each Qt release,
needs
#something to discover what's the latest qqc2 version available
-math(EXPR QQC2_VERSION "${Qt5QuickControls2_VERSION_MINOR} - 7")
-set(QQC2_VERSION "2.${QQC2_VERSION}")
+math(EXPR QQC2_VERSION_MINOR "${Qt5QuickControls2_VERSION_MINOR} - 7")
+set(QQC2_VERSION "2.${QQC2_VERSION_MINOR}")
+
+if (QQC2_VERSION_MINOR LESS 3)
+ set(DISABLE_UNDER_QQC2_2_3 "//Needs QtQuick.Controls 2.3 ")
+else()
+ set(DISABLE_UNDER_QQC2_2_3 "")
+endif()
# Find all the source qml files
FILE(GLOB_RECURSE inFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -109,7 +115,7 @@
"${CMAKE_CURRENT_SOURCE_DIR}/${infileName}"
"${CMAKE_CURRENT_BINARY_DIR}/${infileName}"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
- PATH_VARS QQC2_VERSION
+ PATH_VARS QQC2_VERSION DISABLE_UNDER_QQC2_2_3
)
ENDFOREACH(infileName)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/BusyIndicator.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/BusyIndicator.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/BusyIndicator.qml
2018-02-05 09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/BusyIndicator.qml
2018-03-03 10:54:13.000000000 +0100
@@ -38,6 +38,7 @@
contentItem: Kirigami.Icon {
source: "view-refresh"
opacity: controlRoot.running ? 1 : 0
+ smooth: true
// appearing/fading opacity change
Behavior on opacity {
@@ -46,7 +47,7 @@
// rotating loading icon
RotationAnimator {
- target: controlRoot
+ target: controlRoot.contentItem
running: controlRoot.visible && controlRoot.running
from: 360
to: 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/org.kde.desktop/Button.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/Button.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/Button.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/Button.qml 2018-03-03
10:54:13.000000000 +0100
@@ -45,5 +45,9 @@
text: controlRoot.text
hasFocus: controlRoot.activeFocus
activeControl: controlRoot.isDefault ? "default" : "f"
+ properties: {
+ "icon": controlRoot.icon ? (controlRoot.icon.name ||
controlRoot.icon.source) : "",
+ "iconColor": controlRoot.icon ? controlRoot.icon.color :
"transparent"
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/CheckIndicator.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/CheckIndicator.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/CheckIndicator.qml
2018-02-05 09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/CheckIndicator.qml
2018-03-03 10:54:13.000000000 +0100
@@ -25,7 +25,7 @@
StylePrivate.StyleItem {
id: styleitem
- elementType: "checkbox"
+ elementType: control.autoExclusive ? "radiobutton" : "checkbox"
sunken: control.pressed
on: control.checked || control.pressed
hover: control.hovered
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/ComboBox.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/ComboBox.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/ComboBox.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/ComboBox.qml 2018-03-03
10:54:13.000000000 +0100
@@ -58,9 +58,9 @@
onPressed: mouse.accepted = false;
onWheel: {
if (wheel.pixelDelta.y < 0 || wheel.angleDelta.y < 0) {
- controlRoot.currentIndex = (controlRoot.currentIndex + 1) %
delegateModel.count
+ controlRoot.currentIndex = Math.min(controlRoot.currentIndex +
1, delegateModel.count -1);
} else {
- controlRoot.currentIndex = (controlRoot.currentIndex - 1 +
delegateModel.count) % delegateModel.count
+ controlRoot.currentIndex = Math.max(controlRoot.currentIndex -
1, 0);
}
}
T.TextField {
@@ -139,9 +139,9 @@
layer.effect: DropShadow {
transparentBorder: true
- radius: 4
+ radius: 8
samples: 8
- horizontalOffset: 2
+ horizontalOffset: 0
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.3)
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/DelayButton.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/DelayButton.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/DelayButton.qml
1970-01-01 01:00:00.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/DelayButton.qml
2018-03-03 10:54:13.000000000 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017 Marco Martin <[email protected]>
+ * Copyright 2017 The Qt Company Ltd.
+ *
+ * GNU Lesser General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU Lesser
+ * General Public License version 3 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.LGPLv3 included in the
+ * packaging of this file. Please review the following information to
+ * ensure the GNU Lesser General Public License version 3 requirements
+ * will be met: https://www.gnu.org/licenses/lgpl.html.
+ *
+ * GNU General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU
+ * General Public License version 2.0 or later as published by the Free
+ * Software Foundation and appearing in the file LICENSE.GPL included in
+ * the packaging of this file. Please review the following information to
+ * ensure the GNU General Public License version 2.0 requirements will be
+ * met: http://www.gnu.org/licenses/gpl-2.0.html.
+ */
+
+import QtQuick 2.6
+import QtQuick.Templates @QQC2_VERSION@ as T
+import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
+import org.kde.kirigami 2.2 as Kirigami
+
+T.DelayButton {
+ id: controlRoot
+ Kirigami.Theme.colorSet: Kirigami.Theme.Button
+ Kirigami.Theme.inherit: false
+
+ implicitWidth: background.implicitWidth
+ implicitHeight: background.implicitHeight
+
+ hoverEnabled: !Kirigami.Settings.isMobile
+
+ transition: Transition {
+ NumberAnimation {
+ duration: control.delay * (control.pressed ? 1.0 -
control.progress : 0.3 * control.progress)
+ }
+ }
+
+ contentItem: Item {}
+ background: StylePrivate.StyleItem {
+ id: styleitem
+ control: controlRoot
+ elementType: "button"
+ sunken: controlRoot.down || controlRoot.checked
+ raised: !(controlRoot.down || controlRoot.checked)
+ hover: controlRoot.hovered
+ text: controlRoot.text
+ hasFocus: controlRoot.activeFocus
+ activeControl: controlRoot.isDefault ? "default" : "f"
+
+ StylePrivate.StyleItem {
+ anchors {
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ margins: 3
+ }
+ elementType: "progressbar"
+
+ control: controlRoot
+ maximum: 100
+ minimum: 0
+ value: controlRoot.progress * 100
+ horizontal: true
+ enabled: controlRoot.enabled
+ }
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/org.kde.desktop/Dialog.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/Dialog.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/Dialog.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/Dialog.qml 2018-03-03
10:54:13.000000000 +0100
@@ -69,7 +69,7 @@
layer.effect: DropShadow {
transparentBorder: true
- radius: 8
+ radius: 16
samples: 16
horizontalOffset: 0
verticalOffset: 4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/org.kde.desktop/Menu.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/Menu.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/Menu.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/Menu.qml 2018-03-03
10:54:13.000000000 +0100
@@ -20,7 +20,7 @@
*/
-import QtQuick 2.6
+import QtQuick 2.7
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0
import QtQuick.Controls @QQC2_VERSION@
@@ -37,7 +37,37 @@
margins: 0
- contentItem: ColumnLayout {}
+@DISABLE_UNDER_QQC2_2_3@ delegate: MenuItem { }
+
+ contentItem: ListView {
+ implicitHeight: contentHeight
+ property bool hasCheckables: false
+ property bool hasIcons: false
+ model: control.contentModel
+
+ interactive: ApplicationWindow.window ? contentHeight >
ApplicationWindow.window.height : false
+ clip: true
+ currentIndex: control.currentIndex || 0
+ keyNavigationEnabled: true
+ keyNavigationWraps: true
+
+ ScrollBar.vertical: ScrollBar {}
+ }
+
+ Connections {
+ target: control.contentItem.contentItem
+ onChildrenChanged: {
+ for (var i in control.contentItem.contentItem.children) {
+ var child = control.contentItem.contentItem.children[i];
+ if (child.checkable) {
+ control.contentItem.hasCheckables = true;
+ }
+ if (child.icon && (child.icon.name.length > 0 ||
child.icon.source.length > 0)) {
+ control.contentItem.hasIcons = true;
+ }
+ }
+ }
+ }
enter: Transition {
NumberAnimation {
@@ -70,9 +100,9 @@
layer.effect: DropShadow {
transparentBorder: true
- radius: 4
+ radius: 8
samples: 8
- horizontalOffset: 2
+ horizontalOffset: 0
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.3)
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/MenuBarItem.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/MenuBarItem.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/MenuBarItem.qml
1970-01-01 01:00:00.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/MenuBarItem.qml
2018-03-03 10:54:13.000000000 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2017 Marco Martin <[email protected]>
+ * Copyright 2017 The Qt Company Ltd.
+ *
+ * GNU Lesser General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU Lesser
+ * General Public License version 3 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.LGPLv3 included in the
+ * packaging of this file. Please review the following information to
+ * ensure the GNU Lesser General Public License version 3 requirements
+ * will be met: https://www.gnu.org/licenses/lgpl.html.
+ *
+ * GNU General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU
+ * General Public License version 2.0 or later as published by the Free
+ * Software Foundation and appearing in the file LICENSE.GPL included in
+ * the packaging of this file. Please review the following information to
+ * ensure the GNU General Public License version 2.0 requirements will be
+ * met: http://www.gnu.org/licenses/gpl-2.0.html.
+ */
+
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.2
+import QtQuick.Templates @QQC2_VERSION@ as T
+import org.kde.kirigami 2.2 as Kirigami
+
+T.MenuBarItem {
+ id: controlRoot
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding +
rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding +
bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ Layout.fillWidth: true
+ padding: 3
+ hoverEnabled: true
+
+ contentItem: Label {
+ text: controlRoot.text
+ font: controlRoot.font
+ color: controlRoot.hovered && !controlRoot.pressed ?
Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
+ elide: Text.ElideRight
+ visible: controlRoot.text
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ background: Item {
+ anchors.fill: parent
+ implicitWidth: Kirigami.Units.gridUnit * 8
+
+ Rectangle {
+ anchors.fill: parent
+ color: Kirigami.Theme.highlightColor
+ opacity: controlRoot.hovered && !controlRoot.pressed ? 1 : 0
+ Behavior on opacity { NumberAnimation { duration: 150 } }
+ }
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/MenuItem.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/MenuItem.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/MenuItem.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/MenuItem.qml 2018-03-03
10:54:13.000000000 +0100
@@ -36,22 +36,49 @@
baselineOffset: contentItem.y + contentItem.baselineOffset
Layout.fillWidth: true
- padding: 3
- hoverEnabled: true
+ padding: 1
+ hoverEnabled: !Kirigami.Settings.isMobile
- contentItem: Label {
- leftPadding: !controlRoot.mirrored ? (controlRoot.indicator ?
controlRoot.indicator.width : 0) + controlRoot.spacing : 0
- rightPadding: controlRoot.mirrored ? (controlRoot.indicator ?
controlRoot.indicator.width : 0) + controlRoot.spacing : 0
-
- text: controlRoot.text
- font: controlRoot.font
- color: controlRoot.hovered && !controlRoot.pressed ?
Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
- elide: Text.ElideRight
- visible: controlRoot.text
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
+ contentItem: RowLayout {
+ Item {
+ Layout.preferredWidth: controlRoot.ListView.view.hasCheckables ||
controlRoot.checkable ? controlRoot.indicator.width : 0
+ }
+ Kirigami.Icon {
+ Layout.alignment: Qt.AlignVCenter
+ visible: controlRoot.ListView.view.hasIcons || (controlRoot.icon
!= undefined && (controlRoot.icon.name.length > 0 ||
controlRoot.icon.source.length > 0))
+ source: controlRoot.icon ? (controlRoot.icon.name ||
controlRoot.icon.source) : ""
+ color: controlRoot.icon ? controlRoot.icon.color : "transparent"
+ //hovered is for retrocompatibility
+ selected: (controlRoot.highlighted || controlRoot.hovered)
+ Layout.preferredHeight: Math.max(label.height,
Kirigami.Units.iconSizes.small)
+ Layout.preferredWidth: Layout.preferredHeight
+ }
+ Label {
+ id: label
+ Layout.alignment: Qt.AlignVCenter
+ Layout.fillWidth: true
+
+ text: controlRoot.text
+ font: controlRoot.font
+ color: (controlRoot.highlighted || controlRoot.hovered) ?
Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
+ elide: Text.ElideRight
+ visible: controlRoot.text
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ }
}
+//we can't use arrow: on old qqc2 releases
+@DISABLE_UNDER_QQC2_2_3@ arrow: Kirigami.Icon {
+@DISABLE_UNDER_QQC2_2_3@ x: controlRoot.mirrored ? controlRoot.padding
: controlRoot.width - width - controlRoot.padding
+@DISABLE_UNDER_QQC2_2_3@ y: controlRoot.topPadding +
(controlRoot.availableHeight - height) / 2
+@DISABLE_UNDER_QQC2_2_3@ source: controlRoot.mirrored ?
"go-next-symbolic-rtl" : "go-next-symbolic"
+@DISABLE_UNDER_QQC2_2_3@ selected: controlRoot.highlighted
+@DISABLE_UNDER_QQC2_2_3@ width: Math.max(label.height,
Kirigami.Units.iconSizes.small)
+@DISABLE_UNDER_QQC2_2_3@ height: width
+@DISABLE_UNDER_QQC2_2_3@ visible: controlRoot.subMenu
+@DISABLE_UNDER_QQC2_2_3@ }
+
indicator: CheckIndicator {
x: controlRoot.mirrored ? controlRoot.width - width -
controlRoot.rightPadding : controlRoot.leftPadding
y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2
@@ -68,7 +95,7 @@
Rectangle {
anchors.fill: parent
color: Kirigami.Theme.highlightColor
- opacity: controlRoot.hovered && !controlRoot.pressed ? 1 : 0
+ opacity: ((controlRoot.highlighted || controlRoot.hovered) ||
controlRoot.hovered) ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 150 } }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/RoundButton.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/RoundButton.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/RoundButton.qml
1970-01-01 01:00:00.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/RoundButton.qml
2018-03-03 10:54:13.000000000 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2018 Marco Martin <[email protected]>
+ * Copyright 2017 The Qt Company Ltd.
+ *
+ * GNU Lesser General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU Lesser
+ * General Public License version 3 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.LGPLv3 included in the
+ * packaging of this file. Please review the following information to
+ * ensure the GNU Lesser General Public License version 3 requirements
+ * will be met: https://www.gnu.org/licenses/lgpl.html.
+ *
+ * GNU General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU
+ * General Public License version 2.0 or later as published by the Free
+ * Software Foundation and appearing in the file LICENSE.GPL included in
+ * the packaging of this file. Please review the following information to
+ * ensure the GNU General Public License version 2.0 requirements will be
+ * met: http://www.gnu.org/licenses/gpl-2.0.html.
+ */
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.2
+import QtQuick.Templates @QQC2_VERSION@ as T
+import QtQuick.Controls @QQC2_VERSION@ as Controls
+import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
+import org.kde.kirigami 2.2 as Kirigami
+
+T.RoundButton {
+ id: controlRoot
+ Kirigami.Theme.colorSet: controlRoot.activeFocus ?
Kirigami.Theme.Selection : Kirigami.Theme.Button
+ Kirigami.Theme.inherit: false
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding +
rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding +
bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ hoverEnabled: !Kirigami.Settings.isMobile
+
+ transform: Translate {
+ x: controlRoot.down || controlRoot.checked ? 1 : 0
+ y: controlRoot.down || controlRoot.checked ? 1 : 0
+ }
+ contentItem: Item {
+ implicitWidth: mainLayout.implicitWidth
+ implicitHeight: mainLayout.implicitHeight
+ RowLayout {
+ id: mainLayout
+ anchors.centerIn: parent
+ Controls.Label {
+ text: controlRoot.text
+ }
+ }
+ }
+ background: Rectangle {
+ property color borderColor: Qt.tint(Kirigami.Theme.textColor,
Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g,
Kirigami.Theme.backgroundColor.b, 0.7))
+
+ implicitWidth: Kirigami.Units.iconSizes.large
+ implicitHeight: Kirigami.Units.iconSizes.large
+ radius: controlRoot.radius
+ color: (controlRoot.activeFocus && (controlRoot.hovered ||
controlRoot.highlighted)) || controlRoot.down || controlRoot.checked ?
Qt.lighter(borderColor, 1.1) : Kirigami.Theme.backgroundColor
+
+ border.color: (controlRoot.hovered || controlRoot.highlighted) ?
Qt.lighter(Kirigami.Theme.highlightColor, 1.2) : borderColor
+ border.width: 1
+
+ Rectangle {
+ radius: controlRoot.radius
+ anchors.fill: parent
+ visible: !controlRoot.flat
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(1, 1, 1, 0.13) }
+ GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.03) }
+ }
+ }
+ Rectangle {
+ z: -1
+ radius: controlRoot.radius
+ visible: !controlRoot.down && !controlRoot.checked &&
!controlRoot.flat
+ anchors {
+ topMargin: 1
+ bottomMargin: -1
+ fill: parent
+ }
+ color: Qt.rgba(0, 0, 0, 0.15)
+ }
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/org.kde.desktop/TabBar.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/TabBar.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/TabBar.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/TabBar.qml 2018-03-03
10:54:13.000000000 +0100
@@ -31,8 +31,9 @@
Kirigami.Theme.colorSet: Kirigami.Theme.Button
Kirigami.Theme.inherit: false
- implicitWidth: contentItem.implicitWidth
- implicitHeight: contentItem.implicitHeight
+ //Some QStyles seem to not return sensible pixelmetrics here
+ implicitWidth: Math.max(Kirigami.Units.gridUnit * 6,
contentItem.implicitWidth)
+ implicitHeight: Math.max(Kirigami.Units.gridUnit * 2,
contentItem.implicitHeight)
spacing: 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/TabButton.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/TabButton.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/TabButton.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/TabButton.qml 2018-03-03
10:54:13.000000000 +0100
@@ -77,7 +77,8 @@
"hasFrame" : true,
"orientation": orientation,
"tabpos": tabpos,
- "selectedpos": selectedpos
+ "selectedpos": selectedpos,
+ "icon": control.icon ? (control.icon.name || control.icon.source)
: ""
}
enabled: controlRoot.enabled
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/ToolBar.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/ToolBar.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/ToolBar.qml 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/ToolBar.qml 2018-03-03
10:54:13.000000000 +0100
@@ -34,7 +34,7 @@
contentHeight: contentChildren[0].implicitHeight
contentItem: Item {}
-
+position: is("header") ? ToolBar.Header : ToolBar.Footer
background: Rectangle {
implicitHeight: 40
color: Kirigami.Theme.backgroundColor
@@ -42,8 +42,8 @@
anchors {
left: parent.left
right: parent.right
- top: controlRoot.parent.footer && controlRoot.parent.footer ==
controlRoot ? parent.top : undefined
- bottom: controlRoot.parent.footer && controlRoot.parent.footer
== controlRoot ? undefined : parent.bottom
+ top: controlRoot.position == T.ToolBar.Footer ||
(controlRoot.parent.footer && controlRoot.parent.footer == controlRoot) ?
parent.top : undefined
+ bottom: controlRoot.position == T.ToolBar.Footer ||
(controlRoot.parent.footer && controlRoot.parent.footer == controlRoot) ?
undefined : parent.bottom
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qqc2-desktop-style-5.43.0/org.kde.desktop/ToolButton.qml
new/qqc2-desktop-style-5.44.0/org.kde.desktop/ToolButton.qml
--- old/qqc2-desktop-style-5.43.0/org.kde.desktop/ToolButton.qml
2018-02-05 09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/org.kde.desktop/ToolButton.qml
2018-03-03 10:54:13.000000000 +0100
@@ -47,5 +47,8 @@
text: controlRoot.text
hasFocus: false
activeControl: controlRoot.isDefault ? "default" : "f"
+ properties: {
+ "icon": controlRoot.icon ? (controlRoot.icon.name ||
controlRoot.icon.source) : ""
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/plugin/kquickstyleitem.cpp
new/qqc2-desktop-style-5.44.0/plugin/kquickstyleitem.cpp
--- old/qqc2-desktop-style-5.43.0/plugin/kquickstyleitem.cpp 2018-02-05
09:12:29.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/plugin/kquickstyleitem.cpp 2018-03-03
10:54:13.000000000 +0100
@@ -187,7 +187,13 @@
QStyleOptionButton *opt =
qstyleoption_cast<QStyleOptionButton*>(m_styleoption);
opt->text = text();
- opt->icon = m_properties[QStringLiteral("icon")].value<QIcon>();
+
+ const QVariant icon = m_properties[QStringLiteral("icon")];
+ if (icon.canConvert<QIcon>()) {
+ opt->icon = icon.value<QIcon>();
+ } else if (icon.canConvert<QString>()) {
+ opt->icon = m_theme->iconFromTheme(icon.value<QString>(),
m_properties[QStringLiteral("iconColor")].value<QColor>());
+ }
int e = qApp->style()->pixelMetric(QStyle::PM_ButtonIconSize,
m_styleoption, nullptr);
opt->iconSize = QSize(e, e);
opt->features = activeControl() == QLatin1String("default") ?
@@ -287,17 +293,20 @@
opt->state |= QStyle::State_AutoRaise;
opt->activeSubControls = QStyle::SC_ToolButton;
opt->text = text();
- opt->icon = m_properties[QStringLiteral("icon")].value<QIcon>();
+ const QVariant icon = m_properties[QStringLiteral("icon")];
+ if (icon.canConvert<QIcon>()) {
+ opt->icon = icon.value<QIcon>();
+ } else if (icon.canConvert<QString>()) {
+ opt->icon = m_theme->iconFromTheme(icon.value<QString>(),
m_properties[QStringLiteral("iconColor")].value<QColor>());
+ }
if (m_properties.value(QStringLiteral("menu")).toBool()) {
opt->subControls |= QStyle::SC_ToolButtonMenu;
opt->features = QStyleOptionToolButton::HasMenu;
}
- // For now icon only is displayed by default.
- opt->toolButtonStyle = Qt::ToolButtonIconOnly;
- if (opt->icon.isNull() && !opt->text.isEmpty())
- opt->toolButtonStyle = Qt::ToolButtonTextOnly;
+ // For now both text and icon
+ opt->toolButtonStyle = Qt::ToolButtonTextBesideIcon;
int e = qApp->style()->pixelMetric(QStyle::PM_ToolBarIconSize,
m_styleoption, nullptr);
opt->iconSize = QSize(e, e);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qqc2-desktop-style-5.43.0/tests/buttonIcons.qml
new/qqc2-desktop-style-5.44.0/tests/buttonIcons.qml
--- old/qqc2-desktop-style-5.43.0/tests/buttonIcons.qml 1970-01-01
01:00:00.000000000 +0100
+++ new/qqc2-desktop-style-5.44.0/tests/buttonIcons.qml 2018-03-03
10:54:13.000000000 +0100
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2017 Marco Martin <[email protected]>
+ *
+ * GNU Lesser General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU Lesser
+ * General Public License version 3 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.LGPLv3 included in the
+ * packaging of this file. Please review the following information to
+ * ensure the GNU Lesser General Public License version 3 requirements
+ * will be met: https://www.gnu.org/licenses/lgpl.html.
+ *
+ * GNU General Public License Usage
+ * Alternatively, this file may be used under the terms of the GNU
+ * General Public License version 2.0 or later as published by the Free
+ * Software Foundation and appearing in the file LICENSE.GPL included in
+ * the packaging of this file. Please review the following information to
+ * ensure the GNU General Public License version 2.0 requirements will be
+ * met: http://www.gnu.org/licenses/gpl-2.0.html.
+ */
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.2
+import QtQuick.Controls 2.3 as Controls
+import org.kde.kirigami 2.2 as Kirigami
+
+Kirigami.ApplicationWindow {
+ width: 600
+ height: 600
+ header: Controls.MenuBar {
+ Controls.Menu {
+ title: "&File"
+
+ Controls.MenuItem {
+ checkable: true
+ text: "Item1"
+ icon.name: "go-next"
+ icon.color: "red"
+ }
+ Controls.MenuItem {
+ text: "Item2"
+ icon.name: "folder-video"
+ }
+ Controls.MenuSeparator {
+ }
+ Controls.MenuItem {
+ checkable: true
+ text: "Item3"
+ }
+ Controls.Menu {
+ title: "Submenu"
+ Controls.MenuItem {
+ checkable: true
+ text: "Item1"
+ icon.name: "go-next"
+ icon.color: "red"
+ }
+ Controls.MenuItem {
+ text: "Item2"
+ icon.name: "folder-video"
+ }
+ Controls.MenuItem {
+ text: "Item3"
+ }
+ }
+ }
+ Controls.Menu {
+ title: "&Edit"
+
+ Controls.MenuItem {
+ text: "Item1"
+ icon.name: "go-next"
+ }
+ Controls.MenuItem {
+ text: "Item2"
+ icon.name: "go-next"
+ }
+ }
+ }
+ ColumnLayout {
+ anchors.centerIn: parent
+ Controls.Button {
+ id: coloredIconButton
+ text: "text"
+ icon.name: "go-previous"
+ }
+ RowLayout {
+ Controls.Label {
+ text: "RGB color for icon:"
+ }
+ Controls.SpinBox{
+ id: red
+ editable: true
+ from: 0
+ to: 255
+ onValueModified: {
+ coloredIconButton.icon.color = Qt.rgba(red.value/255,
green.value/255, blue.value/255, 1);
+ }
+ }
+ Controls.SpinBox{
+ id: green
+ editable: true
+ from: 0
+ to: 255
+ onValueModified: {
+ coloredIconButton.icon.color = Qt.rgba(red.value/255,
green.value/255, blue.value/255, 1);
+ }
+ }
+ Controls.SpinBox{
+ id: blue
+ editable: true
+ from: 0
+ to: 255
+ onValueModified: {
+ coloredIconButton.icon.color = Qt.rgba(red.value/255,
green.value/255, blue.value/255, 1);
+ }
+ }
+ }
+ Controls.ToolButton {
+ text: "text"
+ icon.name: "go-previous"
+ }
+ }
+}