diff --git a/containment/package/contents/ui/applet/AppletItemWrapper.qml b/containment/package/contents/ui/applet/AppletItemWrapper.qml index d87cbdb3b..76ca0f225 100644 --- a/containment/package/contents/ui/applet/AppletItemWrapper.qml +++ b/containment/package/contents/ui/applet/AppletItemWrapper.qml @@ -507,13 +507,11 @@ Item{ layer.enabled: true layer.effect: DropShadow { - radius: shadowSize + radius: root.appShadowSize samples: 2 * radius - color: "#ff080808" + color: root.appShadowColor verticalOffset: 2 - - property int shadowSize : Math.ceil(root.iconSize / 10) } Component.onCompleted: wrapper.zoomScale = 1.1 @@ -542,13 +540,13 @@ Item{ sourceComponent: DropShadow{ anchors.fill: parent - color: forcedShadow ? theme.backgroundColor : "#ff080808" + color: forcedShadow ? theme.backgroundColor : root.appShadowColor //"#ff080808" samples: 2 * radius source: container.fakeIconItem ? _wrapperContainer : container.applet radius: shadowSize verticalOffset: forcedShadow ? 1 : 2 - property int shadowSize : forcedShadow? 8 : Math.ceil(root.iconSize / 12) + property int shadowSize : forcedShadow? 8 : root.appShadowSize //Math.ceil(root.iconSize / 12) property bool forcedShadow: root.forceTransparentPanel && applet.pluginName !== root.plasmoidName ? true : false } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index f43ffdb03..710e729fb 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -136,7 +136,9 @@ DragDrop.DropArea { || (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel)) && !(disablePanelShadowMaximized && windowsModel.hasMaximizedWindow) - + property int appShadowOpacity: (plasmoid.configuration.shadowOpacity/100) * 255 + property int appShadowSize: (0.4*root.iconSize) * (plasmoid.configuration.shadowSize/100) + property string appShadowColor: "#" + decimalToHex(appShadowOpacity) + plasmoid.configuration.shadowColor property int totalPanelEdgeSpacing: 0 //this is set by PanelBox //FIXME: this is not needed any more probably @@ -782,6 +784,18 @@ DragDrop.DropArea { return dock.containmentActions(); } + function decimalToHex(d, padding) { + var hex = Number(d).toString(16); + padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding; + + while (hex.length < padding) { + hex = "0" + hex; + } + + return hex; + } + + function disableDirectRender(){ root.globalDirectRender = false; } diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 192ed61b6..c2712d7a9 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -181,6 +181,9 @@ Item { property real durationTime: latteDock ? latteDock.durationTime : plasmoid.configuration.durationTime property real zoomFactor: latteDock ? latteDock.zoomFactor : ( 1 + (plasmoid.configuration.zoomLevel / 20) ) + property int appShadowSize: latteDock ? latteDock.appShadowSize : Math.ceil(0.12*iconSize) + property string appShadowColor: latteDock ? latteDock.appShadowColor : "#ff080808" + property alias tasksCount: tasksModel.count property alias hoveredIndex: icList.hoveredIndex diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index 5c73cb153..38e215b28 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -254,13 +254,11 @@ MouseArea{ sourceComponent: DropShadow{ anchors.fill: parent - color: "#ff080808" + color: root.appShadowColor samples: 2 * radius source: separatorItem - radius: shadowSize + radius: root.appShadowSize verticalOffset: 2 - - property int shadowSize : Math.ceil(root.iconSize / 10) } } diff --git a/plasmoid/package/contents/ui/task/TaskIconItem.qml b/plasmoid/package/contents/ui/task/TaskIconItem.qml index a7ec40825..ed682a490 100644 --- a/plasmoid/package/contents/ui/task/TaskIconItem.qml +++ b/plasmoid/package/contents/ui/task/TaskIconItem.qml @@ -59,7 +59,7 @@ Item{ // property int shadowInterval: firstDrawed ? firstDrawedInterval : 250 property int shadowInterval: firstDrawed ? 1000 : 250 - property int shadowSize : Math.ceil(root.iconSize / 10) + property int shadowSize : root.appShadowSize readonly property bool smartLauncherEnabled: ((mainItemContainer.isStartup === false) && (root.smartLaunchersEnabled)) readonly property variant iconDecoration: decoration @@ -493,10 +493,10 @@ Item{ active: root.enableShadows sourceComponent: DropShadow{ - color: "#ff080808" + color: root.appShadowColor samples: 2 * radius source: taskNumber - radius: centralItem.shadowSize/2 + radius: root.appShadowSize/2 verticalOffset: 2 } } @@ -528,10 +528,10 @@ Item{ sourceComponent: DropShadow{ anchors.fill: parent - color: "#ff080808" + color: root.appShadowColor samples: 2 * radius source: iconGraphic - radius: centralItem.shadowSize + radius: root.appShadowSize verticalOffset: 2 } }