diff --git a/src/declarativeimports/plasmacomponents3/CheckIndicator.qml b/src/declarativeimports/plasmacomponents3/CheckIndicator.qml index 42a6784ef..8710ec044 100644 --- a/src/declarativeimports/plasmacomponents3/CheckIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/CheckIndicator.qml @@ -1,68 +1,68 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private PlasmaCore.FrameSvgItem { id: root property Item control imagePath: "widgets/button" prefix: "normal" - implicitWidth: units.gridUnit - implicitHeight: units.gridUnit + implicitWidth: units.iconSizes.small + implicitHeight: implicitWidth opacity: control.enabled ? 1 : 0.6 PlasmaCore.SvgItem { svg: PlasmaCore.Svg { id: checkmarkSvg imagePath: "widgets/checkmarks" } elementId: "checkbox" opacity: { if (typeof control.checkState !== "undefined") { switch (control.checkState) { case Qt.Checked: return 1; case Qt.PartiallyChecked: return 0.5; default: return 0; } } else { return control.checked ? 1 : 0; } } anchors { fill: parent } Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } Private.ButtonShadow { z: -1 anchors.fill: parent state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "shadow") } } diff --git a/src/declarativeimports/plasmacomponents3/RadioButton.qml b/src/declarativeimports/plasmacomponents3/RadioButton.qml index bf495688b..955e7bf6a 100644 --- a/src/declarativeimports/plasmacomponents3/RadioButton.qml +++ b/src/declarativeimports/plasmacomponents3/RadioButton.qml @@ -1,60 +1,62 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Templates @QQC2_VERSION@ as T import QtQuick.Controls @QQC2_VERSION@ import org.kde.plasma.core 2.0 as PlasmaCore T.RadioButton { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: units.gridUnit * 1.6 + implicitHeight: Math.max(background ? background.implicitHeight : 0, + Math.max(contentItem.implicitHeight, + indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) baselineOffset: contentItem.y + contentItem.baselineOffset padding: 1 spacing: Math.round(units.gridUnit / 8) hoverEnabled: true indicator: RadioIndicator { LayoutMirroring.enabled: control.mirrored LayoutMirroring.childrenInherit: true anchors { left: parent.left verticalCenter: parent.verticalCenter } control: control } contentItem: Label { leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 opacity: control.enabled ? 1 : 0.6 text: control.text font: control.font color: PlasmaCore.ColorScope.textColor elide: Text.ElideRight visible: control.text horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/declarativeimports/plasmacomponents3/RadioIndicator.qml b/src/declarativeimports/plasmacomponents3/RadioIndicator.qml index 61b47cb5a..79697168d 100644 --- a/src/declarativeimports/plasmacomponents3/RadioIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/RadioIndicator.qml @@ -1,59 +1,59 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private PlasmaCore.SvgItem { property Item control svg: PlasmaCore.Svg { id: buttonSvg imagePath: "widgets/actionbutton" } elementId: "normal" opacity: control.enabled ? 1 : 0.6 implicitWidth: implicitHeight - implicitHeight: units.gridUnit + implicitHeight: units.iconSizes.small PlasmaCore.SvgItem { id: checkmark svg: PlasmaCore.Svg { id: checkmarkSvg imagePath: "widgets/checkmarks" } elementId: "radiobutton" opacity: control.checked ? 1 : 0 anchors { fill: parent } Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } Private.RoundShadow { anchors.fill: parent z: -1 state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "shadow") } } diff --git a/src/declarativeimports/plasmastyle/CheckBoxStyle.qml b/src/declarativeimports/plasmastyle/CheckBoxStyle.qml index dc8aa20f1..7d4373bfa 100644 --- a/src/declarativeimports/plasmastyle/CheckBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/CheckBoxStyle.qml @@ -1,84 +1,84 @@ /* * Copyright 2014 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import "private" as Private QtQuickControlStyle.CheckBoxStyle { id: checkboxStyle label: PlasmaComponents.Label { text: control.text Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.bottom height: 1 * units.devicePixelRatio color: theme.highlightColor visible: control.activeFocus } } background: Item {} spacing: units.smallSpacing indicator: PlasmaCore.FrameSvgItem { imagePath: "widgets/button" prefix: "normal" - width: theme.mSize(theme.defaultFont).height + margins.left - height: theme.mSize(theme.defaultFont).height + margins.top + width: units.iconSizes.small + height: width opacity: control.enabled ? 1 : 0.6 PlasmaCore.SvgItem { svg: PlasmaCore.Svg { id: checkmarkSvg imagePath: "widgets/checkmarks" } elementId: "checkbox" opacity: { switch (control.checkedState) { case Qt.Checked: return 1; case Qt.PartiallyChecked: return 0.5; default: return 0; } } anchors { fill: parent } Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } Private.ButtonShadow { z: -1 anchors.fill: parent state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "shadow") } } } diff --git a/src/declarativeimports/plasmastyle/RadioButtonStyle.qml b/src/declarativeimports/plasmastyle/RadioButtonStyle.qml index 0468c4c14..a225c4161 100644 --- a/src/declarativeimports/plasmastyle/RadioButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/RadioButtonStyle.qml @@ -1,81 +1,81 @@ /* * Copyright 2014 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import "private" as Private QtQuickControlStyle.RadioButtonStyle { id: radiobuttonStyle label: PlasmaComponents.Label { text: control.text Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.bottom height: 1 * units.devicePixelRatio color: theme.highlightColor visible: control.activeFocus } } //Not needed? background: Item {} spacing: units.smallSpacing indicator: PlasmaCore.SvgItem { svg: PlasmaCore.Svg { id: buttonSvg imagePath: "widgets/actionbutton" } elementId: "normal" opacity: control.enabled ? 1 : 0.6 - width: height - height: theme.mSize(theme.defaultFont).height * 1.6 + width: units.iconSizes.small + height: width PlasmaCore.SvgItem { id: checkmark svg: PlasmaCore.Svg { id: checkmarkSvg imagePath: "widgets/checkmarks" } elementId: "radiobutton" opacity: control.checked ? 1 : 0 anchors { fill: parent } Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } Private.RoundShadow { anchors.fill: parent z: -1 state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "shadow") } } } diff --git a/src/desktoptheme/breeze/widgets/actionbutton.svg b/src/desktoptheme/breeze/widgets/actionbutton.svg index 11f8e11f1..04f98d801 100644 --- a/src/desktoptheme/breeze/widgets/actionbutton.svg +++ b/src/desktoptheme/breeze/widgets/actionbutton.svg @@ -1,556 +1,94 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - + + + + + + - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/src/desktoptheme/breeze/widgets/checkmarks.svg b/src/desktoptheme/breeze/widgets/checkmarks.svg index c62b6296b..f97028e0f 100644 --- a/src/desktoptheme/breeze/widgets/checkmarks.svg +++ b/src/desktoptheme/breeze/widgets/checkmarks.svg @@ -1,207 +1,51 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - + + + + + + - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +