expose user specified shadows to qml

pull/1/head
Michail Vourlakos 8 years ago
parent 98a4f2b253
commit 7d77ab5195

@ -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
}

@ -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;
}

@ -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

@ -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)
}
}

@ -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
}
}

Loading…
Cancel
Save