diff --git a/package/contents/ui/LunaIcon.qml b/package/contents/ui/LunaIcon.qml
index d43ed1034e1fba16dc5a1f61e359615471de4aca..d6bc208b2dfe82c751b31eed0259f6e0e6faab9f 100644
--- a/package/contents/ui/LunaIcon.qml
+++ b/package/contents/ui/LunaIcon.qml
@@ -19,6 +19,7 @@
*/
import QtQuick 2.1
+import QtGraphicalEffects 1.12
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
@@ -30,6 +31,8 @@ Item {
property int phaseNumber: 0
property int hemisphere: 0
property bool showShadow: true
+ property bool transparentShadow: true
+
property string lunarImage: ''
property color diskColour: '#ffffff'
property int lunarImageTweak: 0
@@ -58,12 +61,15 @@ Item {
// deal with northern <-> southern hemisphere
transformOrigin: Item.Center
rotation: (hemisphere == 0 ? 0 : 180) - lunarImageTweak
+ visible: !transparentShadow
}
Canvas {
id: shadow
width: lunaSvgItem.width
height: lunaSvgItem.height
+ visible: !transparentShadow
+
property int hemisphere: lunaIcon.hemisphere
property int theta: lunaIcon.theta
property bool showShadow: lunaIcon.showShadow
@@ -189,4 +195,12 @@ Item {
}
}
}
+
+ OpacityMask {
+ anchors.fill: lunaSvgItem
+ source: lunaSvgItem
+ maskSource: shadow
+ invert: true
+ visible: transparentShadow
+ }
}
diff --git a/package/contents/ui/configGeneral.qml b/package/contents/ui/configGeneral.qml
index ea03ca01c613ba84660510598844e1e342181589..c153c80479d1cbd31b39801a7d0c03793ec760aa 100644
--- a/package/contents/ui/configGeneral.qml
+++ b/package/contents/ui/configGeneral.qml
@@ -26,6 +26,7 @@ Item {
id: generalPage
property alias cfg_hemisphere: hemisphere.currentIndex // 0=North 1=South
+ property alias cfg_transparentShadow: transparentShadow.checked // boolean
property alias cfg_showBackground: showBackground.checked // boolean
property alias cfg_dateFormat: dateFormat.currentIndex // code: 0= 1= 2=...
property alias cfg_dateFormatString: dateFormatString.text
@@ -83,6 +84,7 @@ Item {
height: 200
hemisphere: cfg_hemisphere
showShadow: false
+ transparentShadow: false
lunarImage: cfg_lunarImage
lunarImageTweak: cfg_lunarImageTweak
diskColour: cfg_diskColour
@@ -188,6 +190,10 @@ Item {
visible: dateFormat.currentIndex == 4
}
+ QtControls.CheckBox {
+ id: transparentShadow
+ text: i18n("Transparent shadow")
+ }
QtControls.CheckBox {
id: showBackground
text: i18n("Show background")
diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml
index ff0e18f8292d89ed0f5d3fdf6766988fa9f9b64b..643041ad73a597ce769d98b95fdc8cef9e8cb8cc 100644
--- a/package/contents/ui/main.qml
+++ b/package/contents/ui/main.qml
@@ -39,6 +39,7 @@ Item {
property var currentPhase
property bool showBackground: Plasmoid.configuration.showBackground
+ property bool transparentShadow: Plasmoid.configuration.transparentShadow
property int hemisphere: Plasmoid.configuration.hemisphere
property int dateFormat: Plasmoid.configuration.dateFormat
property string dateFormatString: Plasmoid.configuration.dateFormatString
@@ -96,6 +97,7 @@ Item {
hemisphere: hemisphere
lunarImage: main.lunarImage
lunarImageTweak: main.lunarImageTweak
+ transparentShadow: main.transparentShadow
diskColour: main.diskColour
anchors.fill: parent