From cc0037e82d32a02ef1db822d86b53711d45f55f2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 18 Nov 2017 10:47:08 +0200 Subject: [PATCH] add new glow configuration options --- containment/package/contents/config/main.xml | 20 ++- .../configuration/AppearanceConfig.qml | 144 ++++++++++++++++++ .../contents/configuration/TasksConfig.qml | 11 -- 3 files changed, 161 insertions(+), 14 deletions(-) diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml index 8ff18a756..4aaa52599 100644 --- a/containment/package/contents/config/main.xml +++ b/containment/package/contents/config/main.xml @@ -99,6 +99,23 @@ 080808 + + false + + + + + + + + 1 + + + false + + + 30 + @@ -161,9 +178,6 @@ false - - false - false diff --git a/shell/package/contents/configuration/AppearanceConfig.qml b/shell/package/contents/configuration/AppearanceConfig.qml index 8765ddeea..73b1ea5c8 100644 --- a/shell/package/contents/configuration/AppearanceConfig.qml +++ b/shell/package/contents/configuration/AppearanceConfig.qml @@ -806,6 +806,150 @@ PlasmaComponents.Page { } //! END: Shadows + //! BEGIN: Glow + ColumnLayout { + Layout.fillWidth: true + spacing: units.smallSpacing + visible: plasmoid.configuration.advanced + + Header { + text: i18n("Glow") + } + + RowLayout { + Layout.fillWidth: true + Layout.leftMargin: units.smallSpacing * 2 + Layout.rightMargin: units.smallSpacing * 2 + spacing: 2 + + ColumnLayout{ + Layout.leftMargin: units.smallSpacing * 2 + Layout.rightMargin: units.smallSpacing * 2 + + RowLayout { + Layout.fillWidth: true + spacing: 2 + + PlasmaComponents.CheckBox { + id: showGlowChk + text: i18nc("show glow","Show") + checked: plasmoid.configuration.showGlow + + onClicked: { + plasmoid.configuration.showGlow = checked + } + } + + PlasmaComponents.Label { + text: " | " + horizontalAlignment: Text.AlignLeft + opacity: 0.35 + enabled: showGlowChk.checked + } + + property int option: plasmoid.configuration.glowOption + + ExclusiveGroup { + id: glowGroup + onCurrentChanged: { + if (current.checked) + plasmoid.configuration.glowOption = current.option + } + } + + PlasmaComponents.Button { + Layout.fillWidth: true + text: i18nc("add glow only to active task/applet indicators","Only On Active") + checked: parent.option === option + checkable: true + enabled: showGlowChk.checked + exclusiveGroup: glowGroup + tooltip: i18n("Add glow only to active task/applet indicator and disable the active line") + + readonly property int option: 0 + } + PlasmaComponents.Button { + Layout.fillWidth: true + text: i18nc("Add glow to all task/applet indicators","All") + checked: parent.option === option + checkable: true + enabled: showGlowChk.checked + exclusiveGroup: glowGroup + tooltip: i18n("Add glow to all task/applet indicators") + + readonly property int option: 1 + } + } + + + + RowLayout{ + PlasmaComponents.Label { + enabled: showGlowChk.checked + text: i18n("Opacity: ") + horizontalAlignment: Text.AlignLeft + } + + PlasmaComponents.Slider { + id: glowOpacitySlider + Layout.fillWidth: true + enabled: showGlowChk.checked + + value: plasmoid.configuration.glowOpacity + minimumValue: 0 + maximumValue: 100 + stepSize: 5 + + function updateGlowOpacity() { + if (!pressed) + plasmoid.configuration.glowOpacity = value; + } + + onPressedChanged: { + updateGlowOpacity(); + } + + Component.onCompleted: { + valueChanged.connect(updateGlowOpacity); + } + + Component.onDestruction: { + valueChanged.disconnect(updateGlowOpacity); + } + } + + PlasmaComponents.Label { + enabled: showGlowChk.checked + text: glowOpacitySlider.value + " %" + horizontalAlignment: Text.AlignRight + Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 + } + + PlasmaComponents.Label { + text: " | " + horizontalAlignment: Text.AlignLeft + enabled: showGlowChk.checked + opacity: 0.35 + } + + PlasmaComponents.CheckBox { + id: showGlow3D + Layout.leftMargin: units.smallSpacing * 2 + text: " " + i18n("3D") + checked: plasmoid.configuration.glow3D + enabled: showGlowChk.checked + tooltip: i18n("Use a 3D style glow") + + onClicked: { + plasmoid.configuration.showGlow3D = checked + } + } + } + } + } + } + //! END: Glow + //! BEGIN: Length ColumnLayout { Layout.fillWidth: true diff --git a/shell/package/contents/configuration/TasksConfig.qml b/shell/package/contents/configuration/TasksConfig.qml index e38bfcd8e..6d6105221 100644 --- a/shell/package/contents/configuration/TasksConfig.qml +++ b/shell/package/contents/configuration/TasksConfig.qml @@ -51,17 +51,6 @@ PlasmaComponents.Page { text: i18n("Appearance") } - PlasmaComponents.CheckBox { - id: showGlow - Layout.leftMargin: units.smallSpacing * 2 - text: i18n("Show glow around windows points") - checked: plasmoid.configuration.showGlow - - onClicked: { - plasmoid.configuration.showGlow = checked - } - } - PlasmaComponents.CheckBox { id: threeColorsWindows Layout.leftMargin: units.smallSpacing * 2