From bf4047d6f8a0e6c949067d6685e65f1f01f1c620 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 2 Jan 2017 19:42:43 +0200 Subject: [PATCH] expose plasmoid configuration through dock config --- containment/contents/config/main.xml | 14 ++++++ containment/contents/ui/main.qml | 12 +++-- plasmoid/contents/ui/GlowPoint.qml | 2 +- plasmoid/contents/ui/TaskDelegate.qml | 4 +- plasmoid/contents/ui/TaskGroupItem.qml | 4 +- plasmoid/contents/ui/TaskIconItem.qml | 2 +- plasmoid/contents/ui/main.qml | 8 +-- shell/contents/configuration/TasksConfig.qml | 52 ++++++++++++++++++++ 8 files changed, 85 insertions(+), 13 deletions(-) diff --git a/containment/contents/config/main.xml b/containment/contents/config/main.xml index bb75f60a4..ba0af6dcb 100644 --- a/containment/contents/config/main.xml +++ b/containment/contents/config/main.xml @@ -52,5 +52,19 @@ 1 + + + + true + + + false + + + false + + + false + diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index 8a322769e..e83086d30 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -98,8 +98,12 @@ DragDrop.DropArea { // TO BE DELETED, if not needed: property int counter:0; - ///BEGIN properties from nowDock - property bool reverseLinesPosition: nowDock ? nowDock.reverseLinesPosition : false + ///BEGIN properties provided to Latte Plasmoid + property bool enableShadows: plasmoid.configuration.shadows + property bool dotsOnActive: plasmoid.configuration.dotsOnActive + property bool reverseLinesPosition: plasmoid.configuration.reverseLinesPosition// nowDock ? nowDock.reverseLinesPosition : false + property bool showGlow: plasmoid.configuration.showGlow + property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows property int durationTime: nowDock ? nowDock.durationTime : 2 property int nowDockHoveredIndex: nowDock ? nowDock.hoveredIndex : -1 @@ -537,9 +541,9 @@ DragDrop.DropArea { } if (plasmoid.userConfiguring) { - // console.log("applets------"); + // console.log("applets------"); for (var i = 0; i < plasmoid.applets.length; ++i) { - // console.log("applet:"+i); + // console.log("applet:"+i); plasmoid.applets[i].expanded = false; } if (!dragOverlay) { diff --git a/plasmoid/contents/ui/GlowPoint.qml b/plasmoid/contents/ui/GlowPoint.qml index c10644b8f..9f0d46ba8 100644 --- a/plasmoid/contents/ui/GlowPoint.qml +++ b/plasmoid/contents/ui/GlowPoint.qml @@ -84,7 +84,7 @@ Item{ //color: "#cc222222" // cornerRadius: smallCircle.radius + glowRadius opacity: panel.showBarLine ? 0.25 : 0.45 - visible: panel.glow + visible: panel.showGlow } /* BrightnessContrast { diff --git a/plasmoid/contents/ui/TaskDelegate.qml b/plasmoid/contents/ui/TaskDelegate.qml index 0311bf029..becb3a410 100644 --- a/plasmoid/contents/ui/TaskDelegate.qml +++ b/plasmoid/contents/ui/TaskDelegate.qml @@ -275,9 +275,9 @@ MouseArea{ Loader{ id: firstIndicator active:( (((panel.position === PlasmaCore.Types.TopPositioned) || (panel.position === PlasmaCore.Types.LeftPositioned)) - && !plasmoid.configuration.reverseLinesPosition) + && !panel.reverseLinesPosition) || (((panel.position === PlasmaCore.Types.BottomPositioned) || (panel.position === PlasmaCore.Types.RightPositioned)) - && plasmoid.configuration.reverseLinesPosition) ) + && panel.reverseLinesPosition) ) sourceComponent: Component{ TaskGroupItem{} } diff --git a/plasmoid/contents/ui/TaskGroupItem.qml b/plasmoid/contents/ui/TaskGroupItem.qml index 40e2604f6..3bd62b24b 100644 --- a/plasmoid/contents/ui/TaskGroupItem.qml +++ b/plasmoid/contents/ui/TaskGroupItem.qml @@ -35,7 +35,7 @@ Item{ property color isActiveColor: theme.buttonFocusColor //property color isShownColor: plasmoid.configuration.threeColorsWindows ? panel.shownDotColor : isActiveColor property color isShownColor: isActiveColor - property color minimizedColor: plasmoid.configuration.threeColorsWindows ? panel.minimizedDotColor : isActiveColor + property color minimizedColor: panel.threeColorsWindows ? panel.minimizedDotColor : isActiveColor property color notActiveColor: mainItemContainer.hasMinimized ? minimizedColor : isShownColor /* Rectangle{ @@ -157,7 +157,7 @@ Item{ basicColor: ((mainItemContainer.hasActive)&&(!(mainItemContainer.hasMinimized))) ? state2Color : state1Color roundCorners: true - visible: ( mainItemContainer.isGroupParent && plasmoid.configuration.dotsOnActive ) + visible: ( mainItemContainer.isGroupParent && panel.dotsOnActive ) || (mainItemContainer.isGroupParent && !mainItemContainer.hasActive)? true: false //when there is no active window diff --git a/plasmoid/contents/ui/TaskIconItem.qml b/plasmoid/contents/ui/TaskIconItem.qml index 90fd2ee4e..dd02be0fc 100644 --- a/plasmoid/contents/ui/TaskIconItem.qml +++ b/plasmoid/contents/ui/TaskIconItem.qml @@ -202,7 +202,7 @@ Item{ ///Shadow in tasks Loader{ anchors.fill: iconImageBuffer - active: plasmoid.configuration.showShadows + active: panel.enableShadows sourceComponent: DropShadow{ anchors.fill: parent diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 4d7d7a764..da813f378 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -53,8 +53,6 @@ Item { property bool editMode: plasmoid.userConfiguring property bool disableRestoreZoom: false //blocks restore animation in rightClick property bool dropNewLauncher: false - property bool enableShadows: plasmoid.configuration.showShadows - property bool glow: plasmoid.configuration.showGlow property bool initializationStep: true property bool initializatedBuffers: noInitCreatedBuffers >= tasksStarting ? true : false property bool isHovered: false @@ -93,10 +91,14 @@ Item { property color minimizedDotColor: textColorLuma > 0.5 ? Qt.darker(theme.textColor, 1+ (1-textColorLuma)) : Qt.lighter(theme.textColor, 1+(1-textColorLuma)) //BEGIN Now Dock Panel properties + property bool enableShadows: nowDockPanel ? nowDockPanel.enableShadows > 0 : plasmoid.configuration.showShadows property bool forceHidePanel: false property bool disableLeftSpacer: false property bool disableRightSpacer: false - property bool reverseLinesPosition: plasmoid.configuration.reverseLinesPosition + property bool reverseLinesPosition: nowDockPanel ? nowDockPanel.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition + property bool dotsOnActive: nowDockPanel ? nowDockPanel.dotsOnActive : plasmoid.configuration.dotsOnActive + property bool showGlow: nowDockPanel ? nowDockPanel.showGlow : plasmoid.configuration.showGlow + property bool threeColorsWindows: nowDockPanel ? nowDockPanel.threeColorsWindows : plasmod.configuration.threeColorsWindows property int durationTime: plasmoid.configuration.durationTime property int iconSize: nowDockPanel ? nowDockPanel.iconSize : Math.max(plasmoid.configuration.iconSize, 16) diff --git a/shell/contents/configuration/TasksConfig.qml b/shell/contents/configuration/TasksConfig.qml index 72e6b0cab..dcd977345 100644 --- a/shell/contents/configuration/TasksConfig.qml +++ b/shell/contents/configuration/TasksConfig.qml @@ -16,5 +16,57 @@ PlasmaComponents.Page{ Column{ spacing: 1.5*theme.defaultFont.pointSize width: parent.width + Column{ + width:parent.width + spacing: 0.8*theme.defaultFont.pointSize + + Header{ + text: i18n("Appearance") + } + + PlasmaComponents.CheckBox { + id: showGlow + text: i18n("Show glow around windows points") + + onCheckedChanged: { + plasmoid.configuration.showGlow = checked; + } + + Component.onCompleted: checked = plasmoid.configuration.showGlow; + } + + PlasmaComponents.CheckBox { + id: threeColorsWindows + text: i18n("Different color for minimized windows") + + onCheckedChanged: { + plasmoid.configuration.threeColorsWindows = checked; + } + + Component.onCompleted: checked = plasmoid.configuration.threeColorsWindows; + } + + PlasmaComponents.CheckBox { + id: dotsOnActive + text: i18n("Dots on active window") + + onCheckedChanged: { + plasmoid.configuration.dotsOnActive = checked; + } + + Component.onCompleted: checked = plasmoid.configuration.dotsOnActive; + } + + PlasmaComponents.CheckBox { + id: reverseLinesPosition + text: i18n("Reverse position for lines and dots") + + onCheckedChanged: { + plasmoid.configuration.reverseLinesPosition = checked; + } + + Component.onCompleted: checked = plasmoid.configuration.reverseLinesPosition; + } + } } }