Skip to content
Snippets Groups Projects
Unverified Commit ddf33cf5 authored by dxtwjb's avatar dxtwjb Committed by GitHub
Browse files

Merge pull request #8 from ismailof/transparent_shadow

Transparent shadow
parents 33ac0e76 1a03f9df
Branches
Tags
No related merge requests found
Showing with 29 additions and 3 deletions
......@@ -12,6 +12,9 @@
<entry name="showBackground" type="Bool">
<default>false</default>
</entry>
<entry name="transparentShadow" type="Bool">
<default>false</default>
</entry>
<entry name="dateFormat" type="int">
<default>3</default>
</entry>
......
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
No preview for this file type
No preview for this file type
No preview for this file type
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
......@@ -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
}
}
......@@ -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
......@@ -187,7 +189,9 @@ Item {
maximumLength: 24
visible: dateFormat.currentIndex == 4
}
QtControls.Label {
text: i18n("Background")
}
QtControls.CheckBox {
id: showBackground
text: i18n("Show background")
......@@ -195,6 +199,9 @@ Item {
QtControls.Label {
text: ""
}
QtControls.CheckBox {
id: transparentShadow
text: i18n("Transparent shadow")
}
}
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment