From b27513dc6697f21115cfc9a28f862e89e624d087 Mon Sep 17 00:00:00 2001 From: samuel <53528911+samuel-jimenez@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:02:09 -0600 Subject: [PATCH] Rework config UI --- .gitignore | 1 + package/README | 4 +- package/contents/config/config.qml | 14 +- package/contents/config/main.xml | 23 +- package/contents/ui/LunaIcon.qml | 19 +- package/contents/ui/LunaWidget.qml | 12 + package/contents/ui/configGeneral.qml | 400 +++++++++--------- package/contents/ui/configImage.qml | 245 +++++++++++ package/contents/ui/configPopup.qml | 100 +++++ package/contents/ui/main.qml | 14 +- ...ma_applet_org.kde.userbase.plasma.luna3.po | Bin 6498 -> 7276 bytes ...ma_applet_org.kde.userbase.plasma.luna3.po | Bin 6536 -> 7322 bytes ...ma_applet_org.kde.userbase.plasma.luna3.po | Bin 4716 -> 5528 bytes ...ma_applet_org.kde.userbase.plasma.luna3.po | Bin 4886 -> 5707 bytes ...a_applet_org.kde.userbase.plasma.luna3.pot | Bin 3977 -> 4662 bytes ...ma_applet_org.kde.userbase.plasma.luna3.po | Bin 5785 -> 6651 bytes src/shadow.frag | 7 +- 17 files changed, 614 insertions(+), 225 deletions(-) create mode 100644 package/contents/ui/configImage.qml create mode 100644 package/contents/ui/configPopup.qml diff --git a/.gitignore b/.gitignore index 5719913..b12187f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.kateproject.build *.zip *.plasmoid /build/ diff --git a/package/README b/package/README index a08f901..8e8459d 100644 --- a/package/README +++ b/package/README @@ -24,7 +24,7 @@ A. Command line, installs to ~/local/share/plasma/plasmoids Uninstall: $ plasmapkg2 -r org.kde.userbase.plasma.Luna3 - See README_TRANSLATIONS.txt (Step 4) for installing localisations. + See README_TRANSLATIONS.md (Step 4) for installing localizations. B. Command line, installs to /usr/local/share/plasma/plasmoids @@ -34,7 +34,6 @@ B. Command line, installs to /usr/local/share/plasma/plasmoids Uninstall: # plasmapkg2 -g -r org.kde.userbase.plasma.Luna3 - See README_TRANSLATIONS.txt (Step 4) for installing localisations. C. CMake, installs to /usr/local/share/plasma/plasmoids @@ -46,7 +45,6 @@ C. CMake, installs to /usr/local/share/plasma/plasmoids 3. Run: # cmake <path to source dir> 4. Run: # make install - See README_TRANSLATIONS.txt (Step 4) for installing localisations. Custom Date Formats ------------------- diff --git a/package/contents/config/config.qml b/package/contents/config/config.qml index 3010bcc..9f0727f 100644 --- a/package/contents/config/config.qml +++ b/package/contents/config/config.qml @@ -21,8 +21,20 @@ import org.kde.plasma.configuration ConfigModel { ConfigCategory { name: i18n("General") - icon: "preferences-desktop-user" + icon: "preferences-desktop-default-applications" source: "configGeneral.qml" } + ConfigCategory { + name: i18n("Custom Image") + icon: "preferences-desktop-color" + source: "configImage.qml" + } + + ConfigCategory { + name: i18n("Date Popup") + icon: "preferences-system-time" + source: "configPopup.qml" + } + } diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 028db03..483a32f 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -11,22 +11,43 @@ <entry name="showBackground" type="Bool"> <default>false</default> </entry> + <entry name="showGrid" type="Bool"> + <default>false</default> + </entry> + <entry name="showTycho" type="Bool"> + <default>false</default> + </entry> + <entry name="showCopernicus" type="Bool"> + <default>false</default> + </entry> <entry name="showShadow" type="Bool"> <default>true</default> </entry> <entry name="transparentShadow" type="Bool"> <default>false</default> </entry> + <entry name="shadowOpacity" type="double"> + <default>0.9</default> + </entry> <entry name="dateFormat" type="int"> <default>3</default> </entry> <entry name="dateFormatString" type="String"> <default>hh</default> </entry> + <entry name="currentPhase" type="int"> + <default>0</default> + </entry> + <entry name="currentPhaseText" type="String"> + <default>Processing</default> + </entry> + <entry name="currentPhaseSubText" type="String"> + <default>PROCESSING</default> + </entry> <entry name="lunarIndex" type="int"> <default>1</default> </entry> - <entry name="diskColor" type="String"> + <entry name="diskColor" type="Color"> <default>#ffff80</default> </entry> </group> diff --git a/package/contents/ui/LunaIcon.qml b/package/contents/ui/LunaIcon.qml index 90bdb7b..3332d07 100644 --- a/package/contents/ui/LunaIcon.qml +++ b/package/contents/ui/LunaIcon.qml @@ -34,6 +34,7 @@ Item { property int latitude: 90 //Degrees: 0=Equator, 90=North Pole, -90=South Pole property bool showShadow: true property bool transparentShadow: true + property real shadowOpacity: 0.9 property string lunarImage: '' property color diskColor: '#ffffff' property int lunarImageTweak: 0 @@ -86,6 +87,7 @@ Item { visible: true anchors.centerIn: parent preferredRendererType: Shape.CurveRenderer + antialiasing: true ShapePath { fillColor: diskColor @@ -94,8 +96,8 @@ Item { PathAngleArc { centerX: radius centerY: radius - radiusY: radius - radiusX: radius + radiusY: radius - 1 + radiusX: radius - 1 startAngle: 0 sweepAngle: 360 } @@ -212,8 +214,10 @@ Item { if (showShadow) { var cosTheta = Math.cos(theta / 180 * Math.PI); var counterclockwisep = (theta < 180); - context.globalAlpha = 0.9; + var scaleTweak = 1.001 + 0.003 * (1 - Math.abs(cosTheta)); //Qt distorts Canvas with scale(), causing a line of pixels to appear around the shadow. Tweak the scale until this gets fixed. + context.globalAlpha = 1; context.translate(radius, radius); + context.scale(scaleTweak, scaleTweak); if (theta != 180) { context.beginPath(); context.fillStyle = '#ffffff'; @@ -234,16 +238,18 @@ Item { } ShaderEffectSource { + id: lunaMask anchors.centerIn: parent width: lunaBackground.width height: lunaBackground.height visible: false - antialiasing: false + antialiasing: true sourceItem: Shape { opacity: 1 + antialiasing: true width: lunaBackground.width height: lunaBackground.height visible: true @@ -257,8 +263,8 @@ Item { PathAngleArc { centerX: radius centerY: radius - radiusY: radius - radiusX: radius + radiusY: radius - 1 + radiusX: radius - 1 startAngle: 0 sweepAngle: 360 } @@ -274,6 +280,7 @@ Item { property variant shadow: shadow property variant mask: lunaMask property int transparent: transparentShadow + property real shadow_Opacity: shadowOpacity opacity: 1 rotation: latitude - 90 diff --git a/package/contents/ui/LunaWidget.qml b/package/contents/ui/LunaWidget.qml index fc10ad8..3485c64 100644 --- a/package/contents/ui/LunaWidget.qml +++ b/package/contents/ui/LunaWidget.qml @@ -170,6 +170,10 @@ Item { icon.source: "go-previous" onClicked: showPreviousPhases() + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Previous Cycle") } PlasmaComponents.ToolButton { @@ -177,6 +181,10 @@ Item { icon.source: "go-jump-today" onClicked: showTodayPhases() + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Today's Cycle") } PlasmaComponents.ToolButton { @@ -184,6 +192,10 @@ Item { icon.source: "go-next" onClicked: showNextPhases() + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Next Cycle") } } diff --git a/package/contents/ui/configGeneral.qml b/package/contents/ui/configGeneral.qml index f2dca5c..ef3a418 100644 --- a/package/contents/ui/configGeneral.qml +++ b/package/contents/ui/configGeneral.qml @@ -23,8 +23,6 @@ import QtQuick import QtQuick.Controls as QtControls import QtQuick.Dialogs as QtDialogs import QtQuick.Layouts as QtLayouts -import "code/lunacalc.js" as LunaCalc -import "code/phases.js" as Phases import org.kde.kcmutils as KCM import org.kde.kirigami as Kirigami import org.kde.plasma.plasma5support as Plasma5Support @@ -32,28 +30,28 @@ import org.kde.plasma.plasma5support as Plasma5Support KCM.SimpleKCM { id: generalPage + property int cfg_currentPhase: 0 // Degrees: 0= new moon, 90= first quarter, 180= full moon, 270= third quarter property alias previewPhase: phase.value property alias cfg_latitudeAuto: latitudeAuto.checked // 0=Equator, +90=North Pole, -90=South Pole property alias cfg_latitude: latitude.value // 0=Equator, +90=North Pole, -90=South Pole property alias cfg_transparentShadow: transparentShadow.checked // boolean + property alias cfg_shadowOpacity: shadowOpacity.value // real in [0,1] property alias cfg_showBackground: showBackground.checked // boolean - property alias cfg_dateFormat: dateFormat.currentIndex // code: 0= 1= 2=... - property alias cfg_dateFormatString: dateFormatString.text - property alias cfg_diskColor: diskColor.color + property alias cfg_diskColor: lunaPreview.diskColor property int cfg_lunarIndex: 0 // index into imageChoices property string cfg_lunarImage: '' // filename (from imageChoices) property int cfg_lunarImageTweak: 0 // rotation angle adjustment for the image (from imageChoices) property alias cfg_showShadow: showShadow.checked - property alias cfg_showGrid: showGrid.checked - property alias cfg_showTycho: showTycho.checked - property alias cfg_showCopernicus: showCopernicus.checked + property bool cfg_showGrid: false + property bool cfg_showTycho: false + property bool cfg_showCopernicus: false onCfg_lunarIndexChanged: { cfg_lunarImage = imageChoices.get(cfg_lunarIndex).filename; cfg_lunarImageTweak = imageChoices.get(cfg_lunarIndex).tweak; } Component.onCompleted: { - previewPhase = LunaCalc.getCurrentPhase(true).terminator; + previewPhase = cfg_currentPhase; } PositionSource { @@ -64,7 +62,6 @@ KCM.SimpleKCM { updateInterval: 3600 * 1000 active: cfg_latitudeAuto onPositionChanged: { - // lbl_place.text = i18n(geoSource.data.location.country); cfg_latitude = Math.round(geoSource.position.coordinate.latitude); } } @@ -76,261 +73,248 @@ KCM.SimpleKCM { QtDialogs.ColorDialog { id: colorDialog - title: i18n("Pick a color for the moon") + options: QtDialogs.ColorDialog.ShowAlphaChannel + title: i18n("Moon color") visible: false - selectedColor: diskColor.color - onAccepted: diskColor.color = selectedColor + selectedColor: cfg_diskColor + onAccepted: cfg_diskColor = selectedColor } - QtLayouts.GridLayout { - columns: 2 - rowSpacing: 15 + QtLayouts.ColumnLayout { + spacing: 10 + QtLayouts.Layout.fillWidth: true - QtControls.Label { - text: i18n("Preview") - } - - QtLayouts.RowLayout { - spacing: 20 - - QtControls.Button { - id: previousButton + QtControls.Frame { + QtLayouts.Layout.fillWidth: true + QtLayouts.Layout.alignment: Qt.AlignTop - icon.source: "go-previous" - enabled: cfg_lunarIndex > 0 - onClicked: { - cfg_lunarIndex -= 1; + QtLayouts.GridLayout { + anchors.fill: parent + columns: 2 + rowSpacing: 0 + QtLayouts.Layout.alignment: Qt.AlignTop + + QtControls.Label { + text: i18n("Preview") + font.bold: true + QtLayouts.Layout.alignment: Qt.AlignTop } - } - - LunaIcon { - id: lunaPreview - - width: 200 - height: 200 - latitude: cfg_latitude - theta: previewPhase - showShadow: cfg_showShadow - transparentShadow: false - lunarImage: cfg_lunarImage - lunarImageTweak: cfg_lunarImageTweak - diskColor: cfg_diskColor - showGrid: cfg_showGrid - showTycho: cfg_showTycho - showCopernicus: cfg_showCopernicus - } - QtControls.Button { - id: nextButton + QtLayouts.RowLayout { + spacing: 20 + QtLayouts.Layout.alignment: Qt.AlignLeft + + QtControls.Button { + id: previousButton + + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Previous Image") + icon.source: "go-previous" + enabled: cfg_lunarIndex > 0 + onClicked: { + cfg_lunarIndex -= 1; + } + } + + LunaIcon { + id: lunaPreview + + width: 200 + height: 200 + latitude: cfg_latitude + theta: previewPhase + showShadow: cfg_showShadow + transparentShadow: cfg_transparentShadow + shadowOpacity: cfg_shadowOpacity + lunarImage: cfg_lunarImage + lunarImageTweak: cfg_lunarImageTweak + diskColor: cfg_diskColor + showGrid: cfg_showGrid + showTycho: cfg_showTycho + showCopernicus: cfg_showCopernicus + + MouseArea { + anchors.fill: parent + visible: cfg_lunarImage === "" + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: visible && hovered + QtControls.ToolTip.text: i18n("Pick Color") + onClicked: { + colorDialog.visible = true; + } + } + + } + + QtControls.Button { + id: nextButton + + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Next Image") + icon.source: "go-next" + enabled: cfg_lunarIndex < imageChoices.count - 1 + onClicked: { + cfg_lunarIndex += 1; + } + } + + QtLayouts.ColumnLayout { + spacing: 20 + + QtControls.CheckBox { + id: showShadow + + text: i18n("Show shadow") + } + + } - icon.source: "go-next" - enabled: cfg_lunarIndex < imageChoices.count - 1 - onClicked: { - cfg_lunarIndex += 1; } - } - QtLayouts.ColumnLayout { - spacing: 20 - - QtControls.CheckBox { - id: showShadow - - text: i18n("Show shadow") + QtControls.Label { + text: i18n("Phase Preview") + QtLayouts.Layout.preferredWidth: 85 + horizontalAlignment: Text.AlignRight } - QtControls.CheckBox { - id: showGrid + QtLayouts.RowLayout { + spacing: 20 - text: i18n("Show grid") - } + QtControls.Label { + id: lbl_phase - QtControls.CheckBox { - id: showTycho + text: phase.value + "º " + QtLayouts.Layout.preferredWidth: 40 + horizontalAlignment: Text.AlignRight + } - text: i18n("Tycho") - } + QtControls.Slider { + id: phase - QtControls.CheckBox { - id: showCopernicus + QtLayouts.Layout.fillWidth: true + from: 0 + to: 360 + stepSize: 1 + } - text: i18n("Copernicus") } } } - QtControls.Label { - text: i18n("Phase Preview") - QtLayouts.Layout.preferredWidth: 85 - horizontalAlignment: Text.AlignRight - } - - QtLayouts.RowLayout { - spacing: 20 + QtLayouts.GridLayout { + columns: 2 + rowSpacing: 10 + QtLayouts.Layout.fillWidth: true - QtControls.Label { - id: lbl_phase + QtLayouts.ColumnLayout { + spacing: 10 - text: Math.abs(phase.value) + "º " - QtLayouts.Layout.preferredWidth: 40 - horizontalAlignment: Text.AlignRight - } + QtControls.Label { + text: i18n("Shadow") + horizontalAlignment: Text.AlignCenter + font.bold: true + } - QtControls.Slider { - id: phase + QtControls.Label { + text: i18n("Opacity") + QtLayouts.Layout.preferredWidth: 85 + horizontalAlignment: Text.AlignRight + } - value: lunaPreview.theta - QtLayouts.Layout.fillWidth: true - from: 0 - to: 360 - stepSize: 1 } - } - - QtControls.Label { - text: i18n("Disk Color") - visible: cfg_lunarImage === "" - } - - Rectangle { - id: diskColor + QtLayouts.ColumnLayout { + spacing: 5 + QtLayouts.Layout.fillWidth: true - width: 50 - height: 50 - color: '#808040' - border.color: '#000000' - radius: height / 2 - visible: cfg_lunarImage === "" + QtControls.CheckBox { + id: transparentShadow - MouseArea { - anchors.fill: parent - onClicked: { - colorDialog.selectedColor = diskColor.color; - colorDialog.visible = true; + text: i18n("Transparent") } - } - } + QtLayouts.RowLayout { + spacing: 20 - QtControls.Label { - text: i18n("Latitude") - } - - QtLayouts.RowLayout { - spacing: 20 - - QtControls.Label { - id: lbl_latitude - - text: Math.abs(latitude.value) + "º " + (latitude.value < 0 ? "S" : "N") - QtLayouts.Layout.preferredWidth: 40 - horizontalAlignment: Text.AlignRight - } - - QtControls.Slider { - id: latitude - - QtLayouts.Layout.fillWidth: true - from: -90 - to: 90 - stepSize: 5 - enabled: !cfg_latitudeAuto - } + QtControls.Label { + id: lbl_shadowOpacity - } + text: Math.round(shadowOpacity.value * 100) + "%" + QtLayouts.Layout.preferredWidth: 40 + horizontalAlignment: Text.AlignRight + } - QtControls.Label { - } + QtControls.Slider { + id: shadowOpacity - QtLayouts.RowLayout { - spacing: 20 + QtLayouts.Layout.fillWidth: true + from: 0 + to: 1 + stepSize: 0.05 + } - QtControls.CheckBox { - id: latitudeAuto + } - text: i18n("Use current latitude") } QtControls.Label { - id: lbl_place - - QtLayouts.Layout.fillWidth: true - horizontalAlignment: Text.AlignRight + text: i18n("Latitude") + font.bold: true + lineHeight: 3 } - } + QtLayouts.ColumnLayout { + spacing: 5 - QtControls.Label { - text: i18n("Date Format") - } + QtLayouts.RowLayout { + spacing: 20 - QtControls.ComboBox { - id: dateFormat + QtControls.Label { + id: lbl_latitude - QtLayouts.Layout.fillWidth: true - textRole: "key" - - model: ListModel { - dynamicRoles: true - Component.onCompleted: { - append({ - "key": i18n("Text date"), - "value": 0 - }); - append({ - "key": i18n("Short date"), - "value": 1 - }); - append({ - "key": i18n("Long date"), - "value": 2 - }); - append({ - "key": i18n("ISO date"), - "value": 3 - }); - append({ - "key": i18n("Custom"), - "value": 4 - }); - } - } + text: Math.abs(latitude.value) + "º " + (latitude.value < 0 ? "S" : "N") + QtLayouts.Layout.preferredWidth: 40 + horizontalAlignment: Text.AlignRight + } - } + QtControls.Slider { + id: latitude - QtControls.Label { - text: i18n("Date Format String") - visible: dateFormat.currentIndex == 4 - } + QtLayouts.Layout.fillWidth: true + from: -90 + to: 90 + stepSize: 5 + onMoved: cfg_latitudeAuto = false + } - QtControls.TextField { - id: dateFormatString + } - maximumLength: 24 - visible: dateFormat.currentIndex == 4 - } + QtControls.CheckBox { + id: latitudeAuto - QtControls.Label { - text: i18n("Background") - } + text: i18n("Use current latitude") + } - QtControls.CheckBox { - id: showBackground + } - text: i18n("Show background") - } + QtControls.Label { + text: i18n("Background") + font.bold: true + } - QtControls.Label { - text: "" - } + QtControls.CheckBox { + id: showBackground - QtControls.CheckBox { - id: transparentShadow + text: i18n("Show background") + } - text: i18n("Transparent shadow") } } diff --git a/package/contents/ui/configImage.qml b/package/contents/ui/configImage.qml new file mode 100644 index 0000000..d93fc34 --- /dev/null +++ b/package/contents/ui/configImage.qml @@ -0,0 +1,245 @@ +/** + Copyright (C) 2024 Samuel Jimenez <therealsamueljimenez@gmail.com> + Ported the Luna Plasmoid to Plasma 6. + + Copyright 2016 Bill Binder <dxtwjb@gmail.com> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +import QtPositioning +import QtQuick +import QtQuick.Controls as QtControls +import QtQuick.Dialogs as QtDialogs +import QtQuick.Layouts as QtLayouts +import org.kde.kcmutils as KCM +import org.kde.kirigami as Kirigami +import org.kde.plasma.plasma5support as Plasma5Support + +KCM.SimpleKCM { + id: generalPage + + property int cfg_currentPhase: 0 // Degrees: 0= new moon, 90= first quarter, 180= full moon, 270= third quarter + property alias cfg_latitudeAuto: latitudeAuto.checked // 0=Equator, +90=North Pole, -90=South Pole + property alias cfg_latitude: latitude.value // 0=Equator, +90=North Pole, -90=South Pole + property bool cfg_transparentShadow: true // boolean + property real cfg_shadowOpacity: 0.9 // real in [0,1] + property alias cfg_diskColor: lunaPreview.diskColor + property int cfg_lunarIndex: 0 // index into imageChoices + property string cfg_lunarImage: '' // filename (from imageChoices) + property int cfg_lunarImageTweak: 0 // rotation angle adjustment for the image (from imageChoices) + property alias cfg_showShadow: showShadow.checked + property alias cfg_showGrid: showGrid.checked + property alias cfg_showTycho: showTycho.checked + property alias cfg_showCopernicus: showCopernicus.checked + + onCfg_lunarIndexChanged: { + cfg_lunarImage = imageChoices.get(cfg_lunarIndex).filename; + cfg_lunarImageTweak = imageChoices.get(cfg_lunarIndex).tweak; + } + + PositionSource { + id: geoSource + + readonly property bool locating: geoSource.active && geoSource.sourceError == PositionSource.NoError && !(geoSource.position.latitudeValid) + + updateInterval: 3600 * 1000 + active: cfg_latitudeAuto + onPositionChanged: { + cfg_latitude = Math.round(geoSource.position.coordinate.latitude); + } + } + + ImageChoices { + id: imageChoices + } + + QtDialogs.ColorDialog { + id: colorDialog + + options: QtDialogs.ColorDialog.ShowAlphaChannel + title: i18n("Moon color") + visible: false + selectedColor: cfg_diskColor + onAccepted: cfg_diskColor = selectedColor + } + + QtLayouts.ColumnLayout { + spacing: 5 + QtLayouts.Layout.fillWidth: true + + QtControls.Frame { + QtLayouts.Layout.fillWidth: true + QtLayouts.Layout.alignment: Qt.AlignTop + + QtLayouts.GridLayout { + anchors.fill: parent + columns: 2 + rowSpacing: 0 + QtLayouts.Layout.alignment: Qt.AlignTop + + QtControls.Label { + text: i18n("Preview") + font.bold: true + QtLayouts.Layout.alignment: Qt.AlignTop + } + + QtLayouts.RowLayout { + spacing: 20 + QtLayouts.Layout.alignment: Qt.AlignLeft + + QtControls.Button { + id: previousButton + + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Previous Image") + icon.source: "go-previous" + enabled: cfg_lunarIndex > 0 + onClicked: { + cfg_lunarIndex -= 1; + } + } + + LunaIcon { + id: lunaPreview + + width: 200 + height: 200 + latitude: cfg_latitude + theta: cfg_currentPhase + showShadow: cfg_showShadow + transparentShadow: cfg_transparentShadow + shadowOpacity: cfg_shadowOpacity + lunarImage: cfg_lunarImage + lunarImageTweak: cfg_lunarImageTweak + diskColor: cfg_diskColor + showGrid: cfg_showGrid + showTycho: cfg_showTycho + showCopernicus: cfg_showCopernicus + + MouseArea { + anchors.fill: parent + visible: cfg_lunarImage === "" + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: visible && hovered + QtControls.ToolTip.text: i18n("Pick Color") + onClicked: { + colorDialog.visible = true; + } + } + + } + + QtControls.Button { + id: nextButton + + QtControls.ToolTip.delay: 250 + QtControls.ToolTip.timeout: 5000 + QtControls.ToolTip.visible: hovered + QtControls.ToolTip.text: i18n("Next Image") + icon.source: "go-next" + enabled: cfg_lunarIndex < imageChoices.count - 1 + onClicked: { + cfg_lunarIndex += 1; + } + } + + QtLayouts.ColumnLayout { + spacing: 20 + + QtControls.CheckBox { + id: showShadow + + text: i18n("Show shadow") + } + + QtControls.CheckBox { + id: showGrid + + text: i18n("Show grid") + } + + QtControls.CheckBox { + id: showTycho + + text: i18n("Tycho") + } + + QtControls.CheckBox { + id: showCopernicus + + text: i18n("Copernicus") + } + + } + + } + + } + + } + + QtLayouts.GridLayout { + columns: 2 + rowSpacing: 15 + QtLayouts.Layout.fillWidth: true + + QtControls.Label { + text: i18n("Latitude") + font.bold: true + lineHeight: 3 + } + + QtLayouts.ColumnLayout { + spacing: 5 + + QtLayouts.RowLayout { + spacing: 20 + + QtControls.Label { + id: lbl_latitude + + text: Math.abs(latitude.value) + "º " + (latitude.value < 0 ? "S" : "N") + QtLayouts.Layout.preferredWidth: 40 + horizontalAlignment: Text.AlignRight + } + + QtControls.Slider { + id: latitude + + QtLayouts.Layout.fillWidth: true + from: -90 + to: 90 + stepSize: 5 + onMoved: cfg_latitudeAuto = false + } + + } + + QtControls.CheckBox { + id: latitudeAuto + + text: i18n("Use current latitude") + } + + } + + } + + } + +} diff --git a/package/contents/ui/configPopup.qml b/package/contents/ui/configPopup.qml new file mode 100644 index 0000000..e0c0864 --- /dev/null +++ b/package/contents/ui/configPopup.qml @@ -0,0 +1,100 @@ +/** + Copyright (C) 2024 Samuel Jimenez <therealsamueljimenez@gmail.com> + Ported the Luna Plasmoid to Plasma 6. + + Copyright 2016 Bill Binder <dxtwjb@gmail.com> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +import QtPositioning +import QtQuick +import QtQuick.Controls as QtControls +import QtQuick.Dialogs as QtDialogs +import QtQuick.Layouts as QtLayouts +import org.kde.kcmutils as KCM +import org.kde.kirigami as Kirigami +import org.kde.plasma.plasma5support as Plasma5Support + +KCM.SimpleKCM { + id: generalPage + + property alias cfg_dateFormat: dateFormat.currentIndex // code: 0= 1= 2=... + property alias cfg_dateFormatString: dateFormatString.text + + QtLayouts.ColumnLayout { + spacing: 5 + QtLayouts.Layout.fillWidth: true + + QtLayouts.GridLayout { + columns: 2 + rowSpacing: 15 + QtLayouts.Layout.fillWidth: true + + QtControls.Label { + text: i18n("Date Format") + font.bold: true + } + + QtControls.ComboBox { + id: dateFormat + + QtLayouts.Layout.fillWidth: true + textRole: "key" + + model: ListModel { + dynamicRoles: true + Component.onCompleted: { + append({ + "key": i18n("Text date"), + "value": 0 + }); + append({ + "key": i18n("Short date"), + "value": 1 + }); + append({ + "key": i18n("Long date"), + "value": 2 + }); + append({ + "key": i18n("ISO date"), + "value": 3 + }); + append({ + "key": i18n("Custom"), + "value": 4 + }); + } + } + + } + + QtControls.Label { + text: i18n("Date Format String") + visible: dateFormat.currentIndex == 4 + } + + QtControls.TextField { + id: dateFormatString + + maximumLength: 24 + visible: dateFormat.currentIndex == 4 + } + + } + + } + +} diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 4402909..060d744 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -40,9 +40,17 @@ PlasmoidItem { property int maximumHeight property int preferredWidth property int preferredHeight - property var currentPhase + property var currentPhase: { + terminator: + plasmoid.configuration.currentPhase; + text: + plasmoid.configuration.currentPhaseText; + subText: + plasmoid.configuration.currentPhaseSubText; + } property bool showBackground: plasmoid.configuration.showBackground property bool transparentShadow: plasmoid.configuration.transparentShadow + property real shadowOpacity: plasmoid.configuration.shadowOpacity property int latitude: plasmoid.configuration.latitude property int dateFormat: plasmoid.configuration.dateFormat property string dateFormatString: plasmoid.configuration.dateFormatString @@ -67,6 +75,7 @@ PlasmoidItem { function updateDetails() { // set the correct image for the moon currentPhase = LunaCalc.getCurrentPhase(true); + plasmoid.configuration.currentPhase = currentPhase.terminator; lunaIcon.phaseNumber = 13; //currentPhase.number; lunaIcon.theta = currentPhase.terminator; lunaIcon.latitude = latitude; @@ -98,12 +107,13 @@ PlasmoidItem { lunarImage: main.lunarImage lunarImageTweak: main.lunarImageTweak transparentShadow: main.transparentShadow + shadowOpacity: main.shadowOpacity diskColor: main.diskColor anchors.fill: parent MouseArea { anchors.fill: parent - onClicked: plasmoid.expanded = !plasmoid.expanded + onClicked: expanded = !expanded } } diff --git a/package/po/es/plasma_applet_org.kde.userbase.plasma.luna3.po b/package/po/es/plasma_applet_org.kde.userbase.plasma.luna3.po index 4e21b1542714eb52c5d72d14f24c5efb25b24f04..ac15503389271703f03c3e587a5bf5a6eacaa232 100644 GIT binary patch delta 837 zcmZXSy>HV{6vY(>qUza>ohGz=HM}OOx>UiR&vrqDCZQ6jMH#}vP|0dcu}I<&+f@^! z3~aF89q|VsgcQ0lBEiClgv11bts6+Nf$i4BCDW76yZ3jG?zvy3L;cmS)Qluz!B`c@ z_)qF}3VP{$(Lm)De9s>a2dLxj+AUnF`L5@5@Xe07Ye9xz3d&{+vKoKaP0zv&r|0)z ziz!0mG(Ucy9%ND)ETVid>Z&~Kv{yAL?$~miF5Yq4PCw|VP=+2>GLuR}hBxRICCZ^* zndqXRPnm1<tv%cE-6MM?1dj?BzN1A-QU0R_xOFrSkJ)NkRHKpA1X`7+(6_C9FUAI| zaJ@b*Z7$p48nElzduG?O;0s!!G$|a#CTK*18T#%yU6_J4?whWK;VoKEOOgO1<_;wh z_{gkLiU4QWZHh$J5->@S;2pa`1<%PTl1zZhZc~B|FZc~gRN*Io9iG#fM6;;L(4wm+ z6ax<E%SlC7;Rn6OL>Wd=DFmGCjroZ{ggCpVwGWrLIrx^vi3XxTp1YP5bTGLjGT6~e z?n<IUBk-HMnh*jPHNFX-bNslT8>L{FyI9u9^aA6+YlEG(bsYGITyaj<{&{p-=3v>y zVFhe53n6pCn7*AT;0OcHW)Go>&Zo;G3|+Kxc7%_Qzizt^a4o#m5(+<`uoqyQKNx>1 HJU#UnKB)wx delta 415 zcmaE3@yKYycSa5aO9ev<D?@|L{~5P1PJX~Dx;d7ml8xJvOIb%Dt+cADl56rxF{R1p z#B?Ta<x=3XG~miDPR~qHP@24v*OA%K)L^n5ZxoZM+2niyr^)=hyi8_BllKYeLzotm ze+k$DnS6X^Fl_-DiN&dt^;zU5Pv90{HZm}u{FOJ9$<So751$>Ak@@5vzBpb}Q<!R( z%;L$>JTA;e76y}f_}xJ2O8DcLj0`5b2)Y6d=3zEAHkmwC&=JJuH#W9_X$;QDFPgkS zP;4@bkSs)<iP2<TA&_H$dQ8kFmkU`#*gzlb6S9G_Ehn=HhfIFJE5vMUZaDc0&_;8M z$ua^Clh+6fY|av{W1Rd_^n@zN3km^6sb!g|<w{)2bqc^BDK05ePzuW|E=g1<0Ldgy u))e0<3|5q1TC9+no0y&oRy$c;R6zo)1r&;YsTC#2lJ|LJHs2JV%mM(^|9Msb diff --git a/package/po/fr/plasma_applet_org.kde.userbase.plasma.luna3.po b/package/po/fr/plasma_applet_org.kde.userbase.plasma.luna3.po index c47b2f4b5ca5918893c121c196c7b2fde3e4a9ea..c92551acd9be7d5e1e5c04c9a70ec6994f212491 100644 GIT binary patch delta 929 zcmaJ=J#W)c6jfp<$gv&QO({if^x{acpyc`aJ8DxPEfk@mAazGk<D?dGTxuJUM#_v} z0O@XQ3`k4}DPr%!(2WHF1A+xs_yvgAG{wl0x2JQ@x#zxj&wC_4H{ZO^oFx*%W({lO zPnlr`IBKqF(&fvj6C4~2Xvgc?Z6r1V&vzYk(`j`r_?W*qp$P?9otD>IzJ;3ZUa$vs zrU-|p`SC9Ga)#(=$L;%8-}kD4U7egeb~ox#x$pF9I+^OXT(>`=_T2r6zEU!cRGlfq z6S~=u<W!b~jl?yY`_=>74ZOb>5ovf)KydvG4@G9Sq$uhAWMJt9=&&1CBsG0NNtF}U zx2=c%iS6gY(y^^jBI&N04qs?{(ZGq0&E1w~AprUYMF<9$X=jNBADDVp!7$HW6Sedy z2`2EGT@!Ko1Vq;0CwnW44H)rvvyuv5`As-vX4rq5lyn(3b9eqjOn8;6#t}n>AGsAK zib=G8MS~S?BL-*~o^e;>fCAsRwK!lvC0~yLI)Pz6&d@bD%CE*46We)y8-@Zu)@Pq) zU{P2q>ss<Pr_pE(c6!!HG`LWB&d{ex-FDlp!6grcELdfh!}7A3Oj@+=s1^L87T~S$ p9T0tiDvuD<=<4|qI{sMews#LT!sLr|SajGT9L>EO|1LZ}^#{-FEm8mg delta 407 zcmbPb*<rll0wafkrGlY_m7&4r8;sSAlNGo`H~(W^%EoQUrL3cnR$5h6$u;?)n9}5D zV)~Oqc@&r|4JNB_2QZl$OcvqIWHL3I93l`nxqz3K-^_?Bw>UjBML{W~GC3oE@&#tO z$!B>5m<`P=CchJ~0jn`LgQ*F~NGwi;su5%|FrWN@H-*X2WU?Ed9g~sy<TgGhUQ<(; zVwcR~$$C8Q%tjUllV9=KgVcHRdovjsOg0mA1scr5Y;0^Yxn0l^%C?w%MbI9?HZhtk zFJuR0n@!FXf{Fv(zeUIvB5rCq`L9sO<Oy6t%*N)1lV|Y9GnrdV{>kq#d4Z_F=0xFs z#>rnruLy!%tPoI?T9%nwuEeEWr!aXwuiRvB@uR|E!Ti!<h0NT<^i+tPzNmtJodPsO j{8B4QkR*Yk#U(`wN<Qjf4GP7jnPrK2C7YQfX0QMN@3VU@ diff --git a/package/po/hr/plasma_applet_org.kde.userbase.plasma.luna3.po b/package/po/hr/plasma_applet_org.kde.userbase.plasma.luna3.po index 731fd2605be06a3abaf2e92fe17580b8ca8acb2e..c7b267253b2f7aae0b1c827be1887e47c3a81eb2 100644 GIT binary patch delta 801 zcmZXS&ubGw6vxRd6!%9qTU!*xgmJ4_u(Y$kW_PRB(xhTh>w;c{7P6$<Hk!CGn^n_8 z!JB8_r6&)97f*$N|Ai;PgGbMTo;)cyyEJ5UPXpiY=gqt~-}n8}(bePIrBkMXiN8$f zC@AfhAVo7ZUz%IMyXnEfQ0gXo?H#Pw(_|2L@kTe?i{Ph<8FqTsa>jNe97H&Xdub1d zTmvF#qfcmes^r2eai*46Ek5gZmR)mPaW9Ua;#S;=`>bLS`CdjU6VkWfow$w+E7SFf zZV+#LMbM9)x8pR)yMiToNib|X!!L5URh%Vgw_r=TDHu-v=sZU|R$=nZ=;h#K?%s42 zUZ^#}aLxa^H7GRYS@<okpYurJieNuXA`BnI>w;+#2;~RJr0`K*K{kP3@*_m^M#_^$ zOk%=Y<vwBun};_n3O|$%A|AZ1Y#_sd&y_X6;uOait_5{z^&iEDH<H6Eo&#T`6(!Fs zkH)63U2bp!C2(Bk32MWi@+wbwa96#-3G82v)N8yz;hXAm0(*A8atE54HoB~_ZF{d> zIP20vqV-{`!xF7#;2F;y`w!!taCjxbyj}IZ!iVRXWl#jY>9250JTJ^0VrYtZ;Sir} dbfcX-!S!qbb%~iwO$L3euf>l;oOz)x{RM<-_Z$EK delta 311 zcmbQC{YGVj2P21prGlY_m7&4r0LBc)$qzV0H^(xku}v1_7N2Y^DmK|iRAKTpHi5|> zxLGFGaPcr%8ccTKa%D0#n9Rr%!DMPS*@52yD8b8QW;D5%-xR{Mn0%h!4#ea$H{;4J zPR~qHPzuOMES`LTOP|@uz<lyXo?s?JlgVtnc1%X*liheDc}-1W3SBabC#!MWGaFeL zOg_l#4^n5um&0UaFj-Q-W%3<9UM6Fc$(aIn5T?cC%>oW!riszy{{prUrrBf<L2ED* z=+J&aa|qLN@+Cp<$s0I@n2pU1CokahWHPsy{F={cv#d}B<K!Zdy-GkgrYZy!rIux; amMd{7*C_xUUtCfIbbV23dQNJJ5*Gk5=vsUL diff --git a/package/po/nl/plasma_applet_org.kde.userbase.plasma.luna3.po b/package/po/nl/plasma_applet_org.kde.userbase.plasma.luna3.po index 7c9ed5f73f9e9cf07b4b2522f3d187a10a293eae..e80bdc16196d6a2759395b8511dc5e2c52906684 100644 GIT binary patch delta 819 zcmZXS-)qxQ6vs&dn@iIs>xB7Z#%s%_4|C@CO)A#e7KaWcOu<KqUAARwy|Za#9c(E6 z2?zWad=-lL;*+mF2@3uRf(-u!Z(>Vt$<u|;`JV4N_nh;7<=g7V26xWTk>=GjXZVo& z!ogR5LG{GyD%weoj|XBm-i@|VrJ2Ni(nSxt!EOjAa)rvu=S_PYZUy}i`Q$J;1Yc6& zji3xK3m;}U3_)o@&9c^Bbvrd|j58h)@)EU4hxBO18t=KOQkp0|6K;tcyl$qvI^nwJ zjxGFN_&Op<JnD+t2)bpZ`fH5d%zws@+HfYV3%Z?Ey}_t$Gxzn!;Zc87Vz!Ln*SrLZ zTo!a}q@{{XvV-ABe0I^*avuI(5Qhk`SQiXKgR{aGZ#ZyIs`HixZ>8tFlXb$F8JYoF zag(RdbQQyN;G`H8CUa;2QB<fY%e-zwptNXvGmMjtP53U}ogyAwEm$mZZFo_rOW6vu zO<4~7F0M1c(Eyk3u)u<Mr3MRJ_%Q|OgqG#oi~>7AWRC%~>}Poc?$0a3PfCxY!(F<7 zo!o+(gLWsRce0c!7hOCSJSE$~;ChUv;#WL3H~(yh|5dZ)Kk#$zl2AQG@OMtVd5T6S f-iqP_)J!k3BGMqGaleNuPuhFY{?0)sOep^cXL9<< delta 311 zcmX@DGfi!S6C;O#rGlY_m7&3AFUCELlh{NzuVr4&#%;-^tfP=tT2)oaHTkxv(j+mt z$v3$bm@Ew@U*&RVGBubygD0HH)NJx?e*4M%+`LR?Mw8VAOdw2)$r%E6ASS=L8CPy` zdS;4(Qb0yxaq8rHX1U4tcm$Y@49q8c@&+*(noOR{YsX|{KKU+hJg=!KOtnj9@#LM{ z4$MXt29x9Xyg}+t^JOv_8BE?J-~cq4huPTJWb!`&TPWLNvb&%Ygl%Fpc`BT3Hu<rj zHAEcfWGx{}DBE&!zL5Lm0&XE@V{^mFX8b-(<`$D%_+2KS77^HdOsI%)vV`bqL6DOb V0*X@0GE>WyxRmP@CJXWk0|2B8RdfIV diff --git a/package/po/plasma_applet_org.kde.userbase.plasma.luna3.pot b/package/po/plasma_applet_org.kde.userbase.plasma.luna3.pot index d8e1e18b6519ae3ccaed62ea443982a965544ca2..61e692e124bc444c82dff958ab21e3c5ea664f3a 100644 GIT binary patch delta 708 zcmeB_-=?x5laa&7P{F{`%D`-MA)^oD<VGf8QA@7e;`GcE1tsUw;*$Ja1<%~X^wh}{ zStZqy^YhX&)Ab>gUSV#Im9Z&Iu}fk}szN}1L1_U{sov&GOeU<1=93R{2}^<XgH@Xw z!BqR^=jSOTPhQ7m#AIm!QpJN%WobM)g2Rr<&=@4Hj1V_8uz+a~C`v8M%r7m5yG?HL z1ug+*LlYB_9tk8p#&F*RWF}8u&1K4LXbQGa9!Zg@G0b4U)QS>xL(PpqhVmk*H#46+ zgTqO{!T_c%AS1CjRbg@hhbgm>k-_A<oVH9xW|L*O?3hdpCdY6&F`0qwL^8w3z-aPg zE_)^*g=)BwvDsu5Zf_<7i^=Z1j!cH8le>70CokY;L(*($Zan!8hcSwX<zzWdePj^} z)5$TMCOqIM0f)Yc+2lfQQzQX1gUMUDjgbXRCV%Hf)&g|46%VosU|7`f7$IpfH=Ded z#{fwHXl)_4@ML~o<;f0w0-MkBYB5g!z$+tRZUzr5SmZfZCg-G1UdXE>Zeb3S49QPP ZtW+;nfXj(k!ebpAIS>g$e#uGvodB5d+{OR^ delta 360 zcmX|+%}&Bl5QWoQP$<1E)xBJeiN+20w!Qr^5e3~CNg%Q|22r6wEP@MPf%S1~;tLo} zYJ4mg#s`oR%VLtrH#6s)`P!aUJ|d;SLneZK!IKB2sbE~lqn#@!=c=2pgxYA@kFMEP zJL(Ntm-XVic*1Vy^*Fd;BeYgF!L%G+b)AG9tHm0T9M4*VNDl#Z(t#>G8&9<Q-v{`l zZrYo|_m=X5?i6Lcs@mMgM(KbE7Z;@(v3<Oh8tYPKizm@^$d2bJVC5^BwQ2_(ihh`0 zUFm1U=J=&@?m>y;LK<ldYB)hA(iy}P92vU{?AjS_#`k^Hjhz%zcbV<9)5>W2oG|%9 kS%w&y9xk;t)$s-1^*Zqb{OAtGRyj$`Jq6!Z5pUM)5AdR6asU7T diff --git a/package/po/ru/plasma_applet_org.kde.userbase.plasma.luna3.po b/package/po/ru/plasma_applet_org.kde.userbase.plasma.luna3.po index 45210149b97956ea5a44dc97b9a583220f00dffa..4d36e2ce87c2cc72f18eb19981b62d0b365ad549 100644 GIT binary patch delta 844 zcmZXS%WD%+6vml5pyAG=)1-_jG~8wuO3^Tn%&VXU69g*_DJqDdIHZ#rn{i?$QPV{i zy42lSb?3^*t{8-Z_y@R~tlW1Yf-6@p+&D8f_Lf;)?(clxIp^MU_AdP~_I;+HYeaQd zRBIA2uNioQN@W)-7fENdvopp)wAI}tmHH?eh5@-Acw0U^lWr!m;(}q$!VPcelUCRt z^<h;k!vj{Dh^%~?v0;NNl`~iMNzhxd^_gQm3?Gwr*b4`Vql#Q7Rr1G5*MRrfLz<ED z>M_?;C)ZqS;6Lq#qv&6I6%1!&8-Cy=RI8=#CCY8&pVsQOVNbZmYG&5MGNm?+T&<@6 zeE7dkM>gO)R*<cybp*<3*}!p~vyPfe(0b@aK7oCFht+iz-tivNEx^JRR8wJ1xQeW- z4Jw(g>ToEmqU1PPMK>%^#2ZLW9P>WXOgNZt!hP-(W!7v1BCdIYxDazTO&k+szQJb$ z%;r?Hpf9dbz*6C>=+mGEm*?)$z=02Qw<(Z(iXg4iz=E#yhyqF3L+LJT7o~|@{Kmj? zfln`rZRLM$HsboY-Sdw|e4!wwdfBmOTXiek^v35SlB(dBu$YDy-TcO6Q_NDqLFqTx z_#CV364=0|wo8syzR``gNj=@r3QmFvjfMkKiQmQ_<4@BUB>p^o8Go6+n*3Z4nZK0m B2vq<8 delta 384 zcmexuJX3c=DkF!1rGlY_m7&4rT*e;8$pWmRn=dkpv2$B;DeEYtl~z?%a!pQ>P@3E> zVLCaQQ(*E19swpxgUK1(iHxR`3;9GQujUPAGBun0Uchg1y#Nohp_$QSFF|uC+hTH` zpbLo2Z)k4Dm0O&inWCT+kdatCSyNng@&P_!CIj=yMSO`&h9;A*^4T#NnNJqwcj7fQ zg{gJPES@}z$Bo&@!eDYGzdcCZEq-q%BZJBJ1igR;^D-HmOg0fpg)l89FBOUfGfj*p z^9hGSm}Zmng?+(HQ-jGTgtH(_%gJ^kQ9vgMF&mp3PF5F4Wiki47U+w=A_ALNh+Jo! zyh8ktAke9)3IRo_WtpkvN?giy3X>K1^f!N$;9`^m@nAjzDabD^R>;gvOizWV+b3o& Q0axIcT2X>5slaOt00p6O3jhEB diff --git a/src/shadow.frag b/src/shadow.frag index 9f0e5d2..56a5cf5 100644 --- a/src/shadow.frag +++ b/src/shadow.frag @@ -5,6 +5,7 @@ layout(std140, binding = 0) uniform buf { mat4 qt_Matrix; float qt_Opacity; int transparent; + float shadow_Opacity; }; layout(binding = 1) uniform sampler2D source; @@ -13,12 +14,10 @@ layout(binding = 3) uniform sampler2D mask; void main() { fragColor = vec4( - ((1 - transparent)* texture(source, qt_TexCoord0) * (1- texture(shadow, qt_TexCoord0)) + ((1 - transparent) * texture(source, qt_TexCoord0) * (1 - shadow_Opacity * texture(shadow, qt_TexCoord0)) + transparent * texture(source, qt_TexCoord0)).rgb, texture(source, qt_TexCoord0).a) * texture(mask, qt_TexCoord0).a - * (1 - texture(shadow, qt_TexCoord0).a * transparent) + * (1 - shadow_Opacity * texture(shadow, qt_TexCoord0).a * transparent) * qt_Opacity ; } - - -- GitLab