Verified Commit ac313471 authored by dr460nf1r3's avatar dr460nf1r3 🐉
Browse files

Dropping wallpaper blur plugin for good, its broken on kde-git again

parent 1a45561b
......@@ -2,7 +2,7 @@
# Maintainer: Librewish <librewish@gmail.com>
pkgname=garuda-dr460nized
pkgver=2.0.5
pkgver=2.0.6
pkgrel=1
arch=('any')
url="https://gitlab.com/garuda-linux/themes-and-settings/settings/$pkgname"
......
......@@ -4,10 +4,7 @@ Timeout=20
[Greeter]
Theme=Sweet
WallpaperPlugin=com.github.zren.inactiveblur
[Greeter][Wallpaper][com.github.zren.inactiveblur][General]
Image=file:///usr/share/wallpapers/garuda-wallpapers/Ghosts.jpg
WallpaperPlugin=org.kde.image
[Greeter][Wallpaper][org.kde.image][General]
Image=/usr/share/wallpapers/garuda-wallpapers/Ghosts.jpg
......@@ -38,7 +38,7 @@ Theme=None
[kscreenlockerrc][Greeter]
WallpaperPlugin=com.github.zren.inactiveblur
[kscreenlockerrc][Greeter][Wallpaper][com.github.zren.inactiveblur][General]
[kscreenlockerrc][Greeter][Wallpaper][org.kde.image][General]
Image=file:///usr/share/wallpapers/garuda-wallpapers/Ghosts.jpg
[gtk-3.0/settings.ini][Settings]
......
......@@ -10,7 +10,7 @@ var layout = {
"formfactor": "0",
"immutability": "1",
"lastScreen": "0",
"wallpaperplugin": "com.github.zren.inactiveblur"
"wallpaperplugin": "org.kde.image"
},
"/ConfigDialog": {
"DialogHeight": "540",
......@@ -21,17 +21,12 @@ var layout = {
"ToolBoxButtonX": "720",
"ToolBoxButtonY": "24"
},
"/Wallpaper/com.github.zren.inactiveblur/General": {
"FillMode": "2",
"Image": "file:///usr/share/wallpapers/garuda-wallpapers/Ghosts.jpg",
"SlidePaths": "/usr/share/wallpapers"
},
"/Wallpaper/org.kde.image/General": {
"Image": "file:///usr/share/wallpapers/garuda-wallpapers/Ghosts.jpg",
"SlidePaths": "/usr/share/wallpapers"
}
},
"wallpaperPlugin": "com.github.zren.inactiveblur"
"wallpaperPlugin": "org.kde.image"
}
],
"panels": [
......
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name=""/>
<group name="General">
<!-- InactiveBlur -->
<entry name="BlurRadius" type="int">
<label>Blur radius</label>
<default>40</default>
</entry>
<entry name="AnimationDuration" type="int">
<label>How quickly the change takes effect.</label>
<default>400</default>
</entry>
<!-- Slideshow -->
<entry name="Slideshow" type="bool">
<default>false</default>
</entry>
<!-- Image+SlideShow -->
<entry name="Blur" type="bool">
<label>Blur background filling</label>
<default>false</default>
</entry>
<entry name="Color" type="Color">
<label>Color of the wallpaper</label>
<default>#000000</default>
</entry>
<entry name="Image" type="String">
<label>Wallpaper image path or wallpaper name</label>
<default></default>
</entry>
<entry name="FillMode" type="int">
<label>Sizing, cropping and positioning of the wallpaper image</label>
<default>0</default>
</entry>
<entry name="SlidePaths" type="StringList">
<label>Paths used for the slideshow</label>
<default></default>
</entry>
<entry name="SlideInterval" type="int">
<label>Interval between slides</label>
<default>10</default>
</entry>
<entry name="TransitionAnimationDuration" type="int">
<label>Fade Transition Animation (ms)</label>
<default>1000</default>
</entry>
<entry name="UncheckedSlides" type="StringList">
<label>Unchecked Slides</label>
<default></default>
</entry>
<entry name="SlideshowMode" type="int">
<label>Ordering mode for the slideshow</label>
<default>0</default>
</entry>
</group>
</kcfg>
import QtQuick 2.5
import QtGraphicalEffects 1.0
Item {
id: blurredImage
property alias fillMode: image.fillMode
property alias source: image.source
property alias sourceSize: image.sourceSize
property alias status: image.status
property alias blurRadius: blur.radius
property int animationDuration: 400
Image {
id: image
anchors.fill: parent
visible: false
// sourceSize: Qt.size(parent.width, parent.height)
smooth: true
asynchronous: true
cache: false
autoTransform: true //new API in Qt 5.5, do not backport into Plasma 5.4.
}
// http://doc.qt.io/qt-5/qml-qtgraphicaleffects-fastblur.html
FastBlur {
id: blur
anchors.fill: parent
source: image
Behavior on radius {
NumberAnimation { duration: animationDuration }
}
}
// Text {
// id: debugText
// anchors.fill: parent
// color: "#eee"
// text: "Blur Radius: " + blurredImage.blurRadius
// font.pixelSize: 24 * units.devicePixelRatio
// }
}
/*
SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
SPDX-FileCopyrightText: 2014 Kai Uwe Broulik <kde@privat.broulik.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.5
import QtQuick.Controls 2.1 as QQC2
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
import org.kde.plasma.core 2.0 as PlasmaCore
QQC2.StackView {
id: root
readonly property string modelImage: imageWallpaper.wallpaperPath
readonly property string configuredImage: wallpaper.configuration.Image
readonly property int fillMode: wallpaper.configuration.FillMode
readonly property string configColor: wallpaper.configuration.Color
readonly property bool blur: wallpaper.configuration.Blur
readonly property size sourceSize: Qt.size(root.width * Screen.devicePixelRatio, root.height * Screen.devicePixelRatio)
//public API, the C++ part will look for those
function setUrl(url) {
wallpaper.configuration.Image = url
imageWallpaper.addUsersWallpaper(url)
}
function action_next() {
imageWallpaper.nextSlide()
}
function action_open() {
Qt.openUrlExternally(modelImage)
}
//private
onConfiguredImageChanged: {
if (modelImage != configuredImage && configuredImage != "") {
imageWallpaper.addUrl(configuredImage)
}
}
function updateContextMenu() {
var action
action = wallpaper.action("open")
action.visible = wallpaper.configuration.Slideshow
action = wallpaper.action("next")
action.visible = wallpaper.configuration.Slideshow
}
Component.onCompleted: {
wallpaper.setAction("open", i18nd("plasma_wallpaper_org.kde.image", "Open Wallpaper Image"), "document-open")
wallpaper.setAction("next", i18nd("plasma_wallpaper_org.kde.image", "Next Wallpaper Image"), "user-desktop")
updateContextMenu()
}
readonly property bool isSlideshow: wallpaper.configuration.Slideshow
onIsSlideshowChanged: {
updateContextMenu()
// Warkaround to stop the slideshow timer
if (isSlideshow) {
imageWallpaper.slideTimer = Qt.binding(function(){ return wallpaper.configuration.SlideInterval })
} else {
imageWallpaper.slideTimer = -1
Qt.callLater(root.configuredImageChanged) // Doesn't always work
}
}
// Plasma 5.24 and below use Wallpaper.Image
// Plasma 5.25 uses Wallpaper.ImageBackend, see: https://github.com/Zren/plasma-wallpapers/issues/14
property var imageWallpaper: Wallpaper.ImageBackend {
id: imageWallpaper
//the oneliner of difference between image and slideshow wallpapers
renderingMode: wallpaper.configuration.Slideshow ? Wallpaper.ImageBackend.SlideShow : Wallpaper.ImageBackend.SingleImage
targetSize: Qt.size(root.width, root.height)
slidePaths: wallpaper.configuration.SlidePaths
slideTimer: wallpaper.configuration.SlideInterval
slideshowMode: wallpaper.configuration.SlideshowMode
uncheckedSlides: wallpaper.configuration.UncheckedSlides
}
onFillModeChanged: Qt.callLater(loadImage)
onModelImageChanged: {
Qt.callLater(loadImage)
wallpaper.configuration.Image = modelImage
}
onConfigColorChanged: Qt.callLater(loadImage)
onBlurChanged: Qt.callLater(loadImage)
onWidthChanged: Qt.callLater(loadImage)
onHeightChanged: Qt.callLater(loadImage)
function loadImage() {
var isFirst = (root.currentItem == undefined)
var pendingImage = root.baseImage.createObject(root, {
"source": root.modelImage,
"fillMode": root.fillMode,
"sourceSize": root.sourceSize,
"color": root.configColor,
"blur": root.blur,
"opacity": isFirst ? 1 : 0,
})
function replaceWhenLoaded() {
if (pendingImage.status != Image.Loading) {
root.replace(pendingImage, {},
isFirst ? QQC2.StackView.Immediate : QQC2.StackView.Transition) // don't animate first show
pendingImage.statusChanged.disconnect(replaceWhenLoaded)
}
}
pendingImage.statusChanged.connect(replaceWhenLoaded)
replaceWhenLoaded()
}
property Component baseImage: Component {
Image {
id: mainImage
property alias color: backgroundColor.color
property bool blur: false
asynchronous: true
cache: false
autoTransform: true
z: -1
QQC2.StackView.onRemoved: destroy()
Rectangle {
id: backgroundColor
anchors.fill: parent
visible: mainImage.status === Image.Ready && !blurLoader.active
z: -2
}
Loader {
id: blurLoader
anchors.fill: parent
z: -3
active: mainImage.blur && (mainImage.fillMode === Image.PreserveAspectFit || mainImage.fillMode === Image.Pad)
sourceComponent: Item {
Image {
id: blurSource
anchors.fill: parent
asynchronous: true
cache: false
autoTransform: true
fillMode: Image.PreserveAspectCrop
source: mainImage.source
sourceSize: mainImage.sourceSize
visible: false // will be rendered by the blur
}
GaussianBlur {
id: blurEffect
anchors.fill: parent
source: blurSource
radius: 32
samples: 65
visible: blurSource.status === Image.Ready
}
}
}
}
}
replaceEnter: Transition {
OpacityAnimator {
from: 0
to: 1
duration: wallpaper.configuration.TransitionAnimationDuration
}
}
// Keep the old image around till the new one is fully faded in
// If we fade both at the same time you can see the background behind glimpse through
replaceExit: Transition {
PauseAnimation {
duration: wallpaper.configuration.TransitionAnimationDuration
}
}
}
// Version 3
/*
SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2014 Kai Uwe Broulik <kde@privat.broulik.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.5
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Controls 2.3 as QtControls2
import QtQuick.Layouts 1.0
import QtQuick.Window 2.0 // for Screen
//We need units from it
import org.kde.plasma.core 2.0 as Plasmacore
import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
import org.kde.kquickcontrols 2.0 as KQuickControls
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kconfig 1.0 // for KAuthorized
import org.kde.draganddrop 2.0 as DragDrop
import org.kde.kcm 1.1 as KCM
import org.kde.kirigami 2.5 as Kirigami
ColumnLayout {
id: root
property alias cfg_Color: colorButton.color
property string cfg_Image
property int cfg_FillMode
property int cfg_SlideshowMode
property alias cfg_Blur: blurRadioButton.checked
property var cfg_SlidePaths: ""
property int cfg_SlideInterval: 0
property var cfg_UncheckedSlides: []
property alias cfg_Slideshow: slideshowCheckBox.checked
function saveConfig() {
imageWallpaper.commitDeletion();
}
SystemPalette {
id: syspal
}
Wallpaper.ImageBackend {
id: imageWallpaper
targetSize: {
if (typeof plasmoid !== "undefined") {
return Qt.size(plasmoid.width, plasmoid.height)
}
// Lock screen configuration case
return Qt.size(Screen.width, Screen.height)
}
onSlidePathsChanged: cfg_SlidePaths = slidePaths
onUncheckedSlidesChanged: cfg_UncheckedSlides = uncheckedSlides
onSlideshowModeChanged: cfg_SlideshowMode = slideshowMode
}
onCfg_SlidePathsChanged: {
imageWallpaper.slidePaths = cfg_SlidePaths
}
onCfg_UncheckedSlidesChanged: {
imageWallpaper.uncheckedSlides = cfg_UncheckedSlides
}
onCfg_SlideshowModeChanged: {
imageWallpaper.slideshowMode = cfg_SlideshowMode
}
property int hoursIntervalValue: Math.floor(cfg_SlideInterval / 3600)
property int minutesIntervalValue: Math.floor(cfg_SlideInterval % 3600) / 60
property int secondsIntervalValue: cfg_SlideInterval % 3600 % 60
//Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 }
Kirigami.FormLayout {
id: twinFormLayout
twinFormLayouts: parentLayout
QtControls2.ComboBox {
id: resizeComboBox
Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Positioning:")
model: [
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Scaled and Cropped"),
'fillMode': Image.PreserveAspectCrop
},
{
'label': i18nd("plasma_wallpaper_org.kde.image","Scaled"),
'fillMode': Image.Stretch
},
{
'label': i18nd("plasma_wallpaper_org.kde.image","Scaled, Keep Proportions"),
'fillMode': Image.PreserveAspectFit
},
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Centered"),
'fillMode': Image.Pad
},
{
'label': i18nd("plasma_wallpaper_org.kde.image","Tiled"),
'fillMode': Image.Tile
}
]
textRole: "label"
onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"]
Component.onCompleted: setMethod();
function setMethod() {
for (var i = 0; i < model.length; i++) {
if (model[i]["fillMode"] === wallpaper.configuration.FillMode) {
resizeComboBox.currentIndex = i;
var tl = model[i]["label"].length;
//resizeComboBox.textLength = Math.max(resizeComboBox.textLength, tl+5);
}
}
}
}
QtControls2.ButtonGroup { id: backgroundGroup }
QtControls2.RadioButton {
id: blurRadioButton
visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad
Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Background:")
text: i18nd("plasma_wallpaper_org.kde.image", "Blur")
QtControls2.ButtonGroup.group: backgroundGroup
}
RowLayout {
id: colorRow
visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad
QtControls2.RadioButton {
id: colorRadioButton
text: i18nd("plasma_wallpaper_org.kde.image", "Solid color")
checked: !cfg_Blur
QtControls2.ButtonGroup.group: backgroundGroup
}
KQuickControls.ColorButton {
id: colorButton
dialogTitle: i18nd("plasma_wallpaper_org.kde.image", "Select Background Color")
}
}
}
default property alias contentData: contentLayout.data
Kirigami.FormLayout {
id: contentLayout
twinFormLayouts: parentLayout
}
Kirigami.FormLayout {
id: slideshowRow
twinFormLayouts: parentLayout
QtControls2.CheckBox {
id: slideshowCheckBox
Kirigami.FormData.label: i18n("Slideshow:")
}
}
Component {
id: foldersComponent
ColumnLayout {
Connections {
target: root
onHoursIntervalValueChanged: hoursInterval.value = root.hoursIntervalValue
onMinutesIntervalValueChanged: minutesInterval.value = root.minutesIntervalValue
onSecondsIntervalValueChanged: secondsInterval.value = root.secondsIntervalValue
}
//FIXME: there should be only one spinbox: QtControls spinboxes are still too limited for it tough
Kirigami.FormLayout {
twinFormLayouts: parentLayout
QtControls2.ComboBox {
id: slideshowComboBox
visible: cfg_Slideshow
Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Order:")
model: [
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Random"),
'slideshowMode': Wallpaper.ImageBackend.Random
},
{
'label': i18nd("plasma_wallpaper_org.kde.image", "A to Z"),
'slideshowMode': Wallpaper.ImageBackend.Alphabetical
},
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Z to A"),
'slideshowMode': Wallpaper.ImageBackend.AlphabeticalReversed
},
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Date modified (newest first)"),
'slideshowMode': Wallpaper.ImageBackend.ModifiedReversed
},
{
'label': i18nd("plasma_wallpaper_org.kde.image", "Date modified (oldest first)"),
'slideshowMode': Wallpaper.ImageBackend.Modified
}
]
textRole: "label"
onCurrentIndexChanged: {
cfg_SlideshowMode = model[currentIndex]["slideshowMode"]
}
Component.onCompleted: setMethod();
function setMethod() {
for (var i = 0; i < model.length; i++) {