├── .gitignore
├── installall
├── animatedhue
├── ReadMe.md
├── uninstall
├── package
│ ├── contents
│ │ ├── ui
│ │ │ ├── HslShiftedWallpaper.qml
│ │ │ ├── HslShiftedImage.qml
│ │ │ ├── main.qml
│ │ │ ├── WallpaperDelegate.qml
│ │ │ └── config.qml
│ │ └── config
│ │ │ └── main.xml
│ └── metadata.desktop
├── install
└── build
├── inactiveblur
├── ReadMe.md
├── uninstall
├── package
│ ├── metadata.desktop
│ └── contents
│ │ ├── ui
│ │ ├── main.qml
│ │ ├── BlurredWallpaper.qml
│ │ ├── WindowModel.qml
│ │ ├── config.qml
│ │ ├── WallpaperDelegate.qml
│ │ ├── ImageBaseMain.qml
│ │ └── ImageConfigPage.qml
│ │ └── config
│ │ └── main.xml
├── install
├── Changelog.md
└── build
└── ReadMe.md
/.gitignore:
--------------------------------------------------------------------------------
1 | *.qmlc
2 | *.jsc
3 |
4 | *.zip
5 |
6 | *.sublime-project
7 | *.sublime-workspace
8 |
--------------------------------------------------------------------------------
/installall:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | (cd animatedhue && sh ./install)
4 | (cd inactiveblur && sh ./install)
5 |
--------------------------------------------------------------------------------
/animatedhue/ReadMe.md:
--------------------------------------------------------------------------------
1 | # Animated Hue
2 |
3 | A wallpaper plugin for Plasma5 that changes the wallpaper hue smoothly every few seconds.
4 |
--------------------------------------------------------------------------------
/animatedhue/uninstall:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 2
3 |
4 | kpackagetool5 -t Plasma/Wallpaper -u package
5 | killall plasmashell
6 | kstart5 plasmashell
7 |
--------------------------------------------------------------------------------
/inactiveblur/ReadMe.md:
--------------------------------------------------------------------------------
1 | # Inactive Blur
2 |
3 | A wallpaper plugin for Plasma5 that blurs the wallpaper when there's an active window.
4 |
5 | Based on: https://www.reddit.com/r/unixporn/comments/791cw8/i3gaps_compton_playing_with_blurs_fading_effects/
6 |
--------------------------------------------------------------------------------
/inactiveblur/uninstall:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 2
3 |
4 | packageServiceType=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-ServiceTypes"`
5 |
6 | # Eg: kpackagetool5 -t Plasma/Applet -r package
7 | kpackagetool5 -t "${packageServiceType}" -r package
8 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/ui/HslShiftedWallpaper.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.5
2 |
3 | HslShiftedImage {
4 | id: shiftedImage
5 |
6 | property int animationDuration: 400
7 | property int tickInterval: 1000
8 | property double tickDelta: 0.05
9 | property alias running: timer.running
10 |
11 | Behavior on hue {
12 | NumberAnimation { duration: animationDuration }
13 | }
14 |
15 | Timer {
16 | id: timer
17 | interval: tickInterval
18 | running: true
19 | repeat: true
20 | onTriggered: {
21 | shiftedImage.hue += tickDelta
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ReadMe.md:
--------------------------------------------------------------------------------
1 | # Wallpaper Plugins
2 |
3 | ## Animated Hue
4 |
5 | Preview: https://streamable.com/u5fdg
6 |
7 | ## Inactive Blur
8 |
9 | Preview: https://streamable.com/8c2jg
10 |
11 |
12 | # Install All Wallpaper Plugins
13 |
14 | ```
15 | wget https://github.com/Zren/plasma-wallpapers/archive/master.zip
16 | unzip master.zip plasma-wallpapers-master/*
17 | (cd plasma-wallpapers-master && sh ./installall)
18 | ```
19 |
20 | # Official KDE Wallpaper Plugins
21 |
22 | * https://invent.kde.org/plasma/plasma-workspace/-/tree/master/wallpapers
23 | * https://invent.kde.org/plasma/kdeplasma-addons/-/tree/master/wallpapers
24 |
--------------------------------------------------------------------------------
/animatedhue/package/metadata.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Encoding=UTF-8
3 | Keywords=
4 | Icon=preferences-desktop-wallpaper
5 | Name=Animated Hue
6 |
7 | Type=Service
8 |
9 | X-KDE-ServiceTypes=Plasma/Wallpaper
10 | X-KDE-ParentApp=
11 | X-KDE-PluginInfo-Author=Chris Holland
12 | X-KDE-PluginInfo-Email=zrenfire@gmail.com
13 | X-KDE-PluginInfo-Name=com.github.zren.animatedhue
14 | X-KDE-PluginInfo-Version=1
15 | X-KDE-PluginInfo-Website=https://github.com/Zren/plasma-wallpapers/tree/master/animatedhue
16 | X-Plasma-MainScript=ui/main.qml
17 |
18 | MimeType=image/jpeg;image/png;image/svg+xml;image/svg+xml-compressed;image/bmp;
19 | X-Plasma-DropMimeTypes=image/jpeg,image/png,image/svg+xml,image/svg+xml-compressed,image/bmp
20 |
--------------------------------------------------------------------------------
/inactiveblur/package/metadata.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Encoding=UTF-8
3 | Keywords=
4 | Icon=preferences-desktop-wallpaper
5 | Name=Inactive Blur
6 |
7 | Type=Service
8 |
9 | X-KDE-ServiceTypes=Plasma/Wallpaper
10 | X-KDE-ParentApp=
11 | X-KDE-PluginInfo-Author=Chris Holland
12 | X-KDE-PluginInfo-Email=zrenfire@gmail.com
13 | X-KDE-PluginInfo-Name=com.github.zren.inactiveblur
14 | X-KDE-PluginInfo-Version=6
15 | X-KDE-PluginInfo-Website=https://github.com/Zren/plasma-wallpapers/tree/master/inactiveblur
16 | X-Plasma-MainScript=ui/main.qml
17 |
18 | MimeType=image/jpeg;image/png;image/svg+xml;image/svg+xml-compressed;image/bmp;
19 | X-Plasma-DropMimeTypes=image/jpeg,image/png,image/svg+xml,image/svg+xml-compressed,image/bmp
20 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/main.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.5
2 | import QtQuick.Controls 2.1 as QQC2
3 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
4 | import org.kde.plasma.core 2.0 as PlasmaCore
5 |
6 | import QtGraphicalEffects 1.0
7 |
8 | ImageBaseMain {
9 | WindowModel {
10 | id: windowModel
11 | // onNoWindowActiveChanged: console.log('noWindowActive', noWindowActive)
12 | }
13 |
14 | baseImage: Component {
15 | BlurredWallpaper {
16 | id: blurredWallpaper
17 | blurRadius: windowModel.noWindowActive ? 0 : wallpaper.configuration.BlurRadius
18 | animationDuration: wallpaper.configuration.AnimationDuration
19 |
20 | // property url source
21 | // property int fillMode
22 | // property rect sourceSize
23 | // property float opacity
24 | property bool blur: false // Blur negative space (Ignored)
25 | property bool color: false // Color for negative space (Ignored)
26 |
27 | QQC2.StackView.onRemoved: destroy() // Causes a memory leak without this
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/ui/HslShiftedImage.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.5
2 |
3 | import QtGraphicalEffects 1.0
4 |
5 | Item {
6 | id: shiftedImage
7 |
8 | property alias fillMode: image.fillMode
9 | property alias source: image.source
10 | property alias sourceSize: image.sourceSize
11 | property alias status: image.status
12 |
13 | property alias hue: hueSaturation.hue
14 |
15 | Image {
16 | id: image
17 | anchors.fill: parent
18 | visible: false
19 | // sourceSize: Qt.size(parent.width, parent.height)
20 | smooth: true
21 | asynchronous: true
22 | cache: false
23 | autoTransform: true //new API in Qt 5.5, do not backport into Plasma 5.4.
24 | }
25 |
26 | // http://doc.qt.io/qt-5/qml-qtgraphicaleffects-huesaturation.html
27 | HueSaturation {
28 | id: hueSaturation
29 | anchors.fill: parent
30 | source: image
31 | }
32 |
33 | // Text {
34 | // id: debugText
35 | // anchors.fill: parent
36 | // color: "#eee"
37 | // text: "Hue: " + hueSaturation.hue
38 | // font.pixelSize: 24 * units.devicePixelRatio
39 | // }
40 | }
41 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/BlurredWallpaper.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.5
2 |
3 | import QtGraphicalEffects 1.0
4 |
5 | Item {
6 | id: blurredImage
7 |
8 | property alias fillMode: image.fillMode
9 | property alias source: image.source
10 | property alias sourceSize: image.sourceSize
11 | property alias status: image.status
12 |
13 | property alias blurRadius: blur.radius
14 |
15 | property int animationDuration: 400
16 |
17 | Image {
18 | id: image
19 | anchors.fill: parent
20 | visible: false
21 | // sourceSize: Qt.size(parent.width, parent.height)
22 | smooth: true
23 | asynchronous: true
24 | cache: false
25 | autoTransform: true //new API in Qt 5.5, do not backport into Plasma 5.4.
26 | }
27 |
28 | // http://doc.qt.io/qt-5/qml-qtgraphicaleffects-fastblur.html
29 | FastBlur {
30 | id: blur
31 | anchors.fill: parent
32 | source: image
33 |
34 | Behavior on radius {
35 | NumberAnimation { duration: animationDuration }
36 | }
37 | }
38 |
39 | // Text {
40 | // id: debugText
41 | // anchors.fill: parent
42 | // color: "#eee"
43 | // text: "Blur Radius: " + blurredImage.blurRadius
44 | // font.pixelSize: 24 * units.devicePixelRatio
45 | // }
46 | }
47 |
--------------------------------------------------------------------------------
/animatedhue/install:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 4
3 |
4 | # This script detects if the widget is already installed.
5 | # If it is, it will use --upgrade instead and restart plasmashell.
6 |
7 | packageNamespace=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
8 | packageServiceType=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-ServiceTypes"`
9 | restartPlasmashell=false
10 |
11 | for arg in "$@"; do
12 | case "$arg" in
13 | -r) restartPlasmashell=true;;
14 | --restart) restartPlasmashell=true;;
15 | *) ;;
16 | esac
17 | done
18 |
19 | isAlreadyInstalled=false
20 | kpackagetool5 --type="${packageServiceType}" --show="$packageNamespace" &> /dev/null
21 | if [ $? == 0 ]; then
22 | isAlreadyInstalled=true
23 | fi
24 |
25 | if $isAlreadyInstalled; then
26 | # Eg: kpackagetool5 -t "Plasma/Applet" -u package
27 | kpackagetool5 -t "${packageServiceType}" -u package
28 | restartPlasmashell=true
29 | else
30 | # Eg: kpackagetool5 -t "Plasma/Applet" -i package
31 | kpackagetool5 -t "${packageServiceType}" -i package
32 | fi
33 |
34 | if $restartPlasmashell; then
35 | killall plasmashell
36 | kstart5 plasmashell
37 | fi
38 |
--------------------------------------------------------------------------------
/inactiveblur/install:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 4
3 |
4 | # This script detects if the widget is already installed.
5 | # If it is, it will use --upgrade instead and restart plasmashell.
6 |
7 | packageNamespace=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
8 | packageServiceType=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-ServiceTypes"`
9 | restartPlasmashell=false
10 |
11 | for arg in "$@"; do
12 | case "$arg" in
13 | -r) restartPlasmashell=true;;
14 | --restart) restartPlasmashell=true;;
15 | *) ;;
16 | esac
17 | done
18 |
19 | isAlreadyInstalled=false
20 | kpackagetool5 --type="${packageServiceType}" --show="$packageNamespace" &> /dev/null
21 | if [ $? == 0 ]; then
22 | isAlreadyInstalled=true
23 | fi
24 |
25 | if $isAlreadyInstalled; then
26 | # Eg: kpackagetool5 -t "Plasma/Applet" -u package
27 | kpackagetool5 -t "${packageServiceType}" -u package
28 | restartPlasmashell=true
29 | else
30 | # Eg: kpackagetool5 -t "Plasma/Applet" -i package
31 | kpackagetool5 -t "${packageServiceType}" -i package
32 | fi
33 |
34 | if $restartPlasmashell; then
35 | killall plasmashell
36 | kstart5 plasmashell
37 | fi
38 |
--------------------------------------------------------------------------------
/inactiveblur/Changelog.md:
--------------------------------------------------------------------------------
1 | ## v6 - October 15 2022
2 |
3 | * Plasma 5.25 bugfix as a class called Image was renamed to ImageBackend.
4 | * Implement upstream Slideshow exclude image, slideshow mode.
5 | * Code cleanup.
6 |
7 | ## v5 - October 2 2019
8 |
9 | * Update to the Plasma 5.16 Kirigami twinFormLayout config gui. Requires Plasma Frameworks v5.53, which is only available in Ubuntu 19.04 and later.
10 |
11 | ## v4 - October 2 2019
12 |
13 | * Fix parsing 400ms in the config spinbox. It previous only worked when using up/down arrows ever since updating to the QtQuickControls 2.0 spinboxes.
14 |
15 | ## v3 - March 20 2019
16 |
17 | * Fix memory leak introduced in the port to the slideshow API. It is easily reproduced with the slideshow reaching 2Gb of RAM in under an hour (switching wallpapers every 10 seconds). I forgot a single line that destroyed the old image.
18 |
19 | ## v2 - March 19 2019
20 |
21 | * Trigger blur event when a new window is created or a window is destroyed. It was previously only updating when you minimized a window or moved it (Issue #2).
22 | * Update to the new image wallpaper config GUI
23 | * Implement a simple toggle to enter slideshow mode (Issue #1).
24 |
25 | ## v1 - Jan 4 2018
26 |
27 | * Wallpaper that blurs when inactive with an animation.
28 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/config/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 | #000000
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 0
20 |
21 |
22 |
23 | 0
24 |
25 |
26 |
27 | 0
28 |
29 |
30 |
31 | 10000
32 |
33 |
34 |
35 | 0.05
36 |
37 |
38 |
39 | 400
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/config/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 40
10 |
11 |
12 |
13 | 400
14 |
15 |
16 |
17 |
18 | false
19 |
20 |
21 |
22 |
23 |
24 | false
25 |
26 |
27 |
28 | #000000
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 0
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 10
45 |
46 |
47 |
48 | 1000
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/ui/main.qml:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Marco Martin
3 | * Copyright 2014 Sebastian Kügler
4 | * Copyright 2014 Kai Uwe Broulik
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
19 | */
20 |
21 | import QtQuick 2.5
22 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
23 | import org.kde.plasma.core 2.0 as PlasmaCore
24 |
25 | import QtGraphicalEffects 1.0
26 |
27 | Item {
28 | id: root
29 |
30 | //public API, the C++ part will look for those
31 | function setUrl(url) {
32 | wallpaper.configuration.Image = url
33 | }
34 |
35 | Rectangle {
36 | id: backgroundColor
37 | anchors.fill: parent
38 | visible: shiftedImage.status === Image.Ready
39 | color: wallpaper.configuration.Color
40 | Behavior on color {
41 | ColorAnimation { duration: units.longDuration }
42 | }
43 | }
44 |
45 | HslShiftedWallpaper {
46 | id: shiftedImage
47 | anchors.fill: parent
48 |
49 | source: wallpaper.configuration.Image
50 | fillMode: wallpaper.configuration.FillMode
51 |
52 | animationDuration: Math.min(wallpaper.configuration.AnimationDuration, wallpaper.configuration.TickInterval)
53 | tickInterval: wallpaper.configuration.TickInterval
54 | tickDelta: wallpaper.configuration.TickDelta
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/WindowModel.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.1
2 | import QtQuick.Controls 1.0
3 | import QtQuick.Layouts 1.3
4 | import QtQuick.Window 2.1
5 | import org.kde.plasma.core 2.0 as PlasmaCore
6 |
7 | import org.kde.taskmanager 0.1 as TaskManager
8 |
9 | Item {
10 | property alias screenGeometry: tasksModel.screenGeometry
11 | property bool noWindowActive: true
12 | property bool currentWindowMaximized: false
13 | property bool isActiveWindowPinned: false
14 |
15 | TaskManager.VirtualDesktopInfo { id: virtualDesktopInfo }
16 | TaskManager.ActivityInfo { id: activityInfo }
17 | TaskManager.TasksModel {
18 | id: tasksModel
19 | sortMode: TaskManager.TasksModel.SortVirtualDesktop
20 | groupMode: TaskManager.TasksModel.GroupDisabled
21 |
22 | activity: activityInfo.currentActivity
23 | virtualDesktop: virtualDesktopInfo.currentDesktop
24 | screenGeometry: wallpaper.screenGeometry // Warns "Unable to assign [undefined] to QRect" during init, but works thereafter.
25 |
26 | filterByActivity: true
27 | filterByVirtualDesktop: true
28 | filterByScreen: true
29 |
30 | onActiveTaskChanged: {
31 | // console.log('tasksModel.onActiveTaskChanged')
32 | updateActiveWindowInfo()
33 | }
34 | onDataChanged: {
35 | // console.log('tasksModel.onDataChanged')
36 | updateActiveWindowInfo()
37 | }
38 | Component.onCompleted: {
39 | // console.log('tasksModel.Component.onCompleted')
40 | activeWindowModel.sourceModel = tasksModel
41 | }
42 | }
43 | PlasmaCore.SortFilterModel {
44 | id: activeWindowModel
45 | filterRole: 'IsActive'
46 | filterRegExp: 'true'
47 | onDataChanged: {
48 | // console.log('activeWindowModel.onDataChanged')
49 | updateActiveWindowInfo()
50 | }
51 | onCountChanged: {
52 | // console.log('activeWindowModel.onCountChanged')
53 | updateActiveWindowInfo()
54 | }
55 | }
56 |
57 |
58 | function activeTask() {
59 | return activeWindowModel.get(0) || {}
60 | }
61 |
62 | function updateActiveWindowInfo() {
63 | var actTask = activeTask()
64 | noWindowActive = activeWindowModel.count === 0 || actTask.IsActive !== true
65 | currentWindowMaximized = !noWindowActive && actTask.IsMaximized === true
66 | isActiveWindowPinned = actTask.VirtualDesktop === -1
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/config.qml:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-FileCopyrightText: 2013 Marco Martin
3 | SPDX-FileCopyrightText: 2014 Kai Uwe Broulik
4 |
5 | SPDX-License-Identifier: GPL-2.0-or-later
6 | */
7 |
8 | import QtQuick 2.5
9 | import QtQuick.Controls 1.0 as QtControls
10 | import QtQuick.Controls 2.3 as QtControls2
11 | import QtQuick.Layouts 1.0
12 | import QtQuick.Window 2.0 // for Screen
13 | //We need units from it
14 | import org.kde.plasma.core 2.0 as Plasmacore
15 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
16 | import org.kde.kquickcontrols 2.0 as KQuickControls
17 | import org.kde.kquickcontrolsaddons 2.0
18 | import org.kde.kconfig 1.0 // for KAuthorized
19 | import org.kde.draganddrop 2.0 as DragDrop
20 | import org.kde.kcm 1.1 as KCM
21 | import org.kde.kirigami 2.5 as Kirigami
22 |
23 | ImageConfigPage {
24 | id: root
25 |
26 | property int cfg_AnimationDuration: 400
27 | property int cfg_BlurRadius: 40
28 |
29 | Row {
30 | id: inactiveBlurRow
31 | spacing: units.largeSpacing / 2
32 | Kirigami.FormData.label: i18n("Blur:")
33 |
34 | QtControls2.Label {
35 | anchors.verticalCenter: blurRadiusSpinBox.verticalCenter
36 | text: i18n(" by ")
37 | }
38 | QtControls2.SpinBox {
39 | id: blurRadiusSpinBox
40 | value: cfg_BlurRadius
41 | onValueChanged: cfg_BlurRadius = value
42 | stepSize: 1
43 | from: 1
44 | to: 2000000000
45 | editable: true
46 | }
47 | QtControls2.Label {
48 | anchors.verticalCenter: blurRadiusSpinBox.verticalCenter
49 | text: i18n(" over ")
50 | }
51 | QtControls2.SpinBox {
52 | id: animationDurationSpinBox
53 | value: cfg_AnimationDuration
54 | onValueChanged: cfg_AnimationDuration = value
55 | from: 0
56 | to: 2000000000
57 | stepSize: 100
58 | editable: true
59 |
60 | textFromValue: function(value, locale) {
61 | return i18n("%1ms", value)
62 | }
63 | valueFromText: function(text, locale) {
64 | // Number.fromLocaleString() doesn't strip suffix and raises an error.
65 | // return Number.fromLocaleString(locale, text)
66 |
67 | // parseInt does seem to stip non-digit characters, but it probably
68 | // only works with ASCII digits?
69 | return parseInt(text, 10)
70 | }
71 | }
72 |
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/animatedhue/build:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 14
3 |
4 | ### User Variables
5 | qtMinVer="5.12"
6 | kfMinVer="5.68"
7 | plasmaMinVer="5.25"
8 | filenameTag="-plasma${plasmaMinVer}"
9 | packageExt="zip"
10 |
11 |
12 | ### Misc
13 | startDir=$PWD
14 |
15 | ### Check QML Versions
16 | # See https://zren.github.io/kde/versions/ for distro versions
17 | if [ -f checkimports.py ]; then
18 | python3 checkimports.py --qt="$qtMinVer" --kf="$kfMinVer" --plasma="$plasmaMinVer"
19 | if [ $? == 1 ]; then
20 | exit 1
21 | fi
22 | fi
23 |
24 | ### Translations
25 | if [ -d "package/translate" ]; then
26 | echo "[build] translate dir found, running merge."
27 | (cd package/translate && sh ./merge)
28 | (cd package/translate && sh ./build)
29 | if [ "$(git diff --stat .)" != "" ]; then
30 | echo "[build] Changed detected. Cancelling build."
31 | git diff --stat .
32 | exit 1
33 | fi
34 | fi
35 |
36 |
37 | ### Variables
38 | packageNamespace=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
39 | packageName="${packageNamespace##*.}" # Strip namespace (Eg: "org.kde.plasma.")
40 | packageVersion=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Version"`
41 | packageAuthor=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Author"`
42 | packageAuthorEmail=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Email"`
43 | packageWebsite=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"`
44 | packageComment=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="Comment"`
45 |
46 | ### metadata.desktop => metadata.json
47 | if command -v desktoptojson &> /dev/null ; then
48 | genOutput=`desktoptojson --serviceType="plasma-applet.desktop" -i "$PWD/package/metadata.desktop" -o "$PWD/package/metadata.json"`
49 | if [ "$?" != "0" ]; then
50 | exit 1
51 | fi
52 | # Tabify metadata.json
53 | sed -i '{s/ \{4\}/\t/g}' "$PWD/package/metadata.json"
54 | fi
55 |
56 |
57 | ### *.plasmoid
58 | filename="${packageName}-v${packageVersion}${filenameTag}.${packageExt}"
59 | rm ${packageName}-v*.${packageExt} # Cleanup
60 | (cd package \
61 | && zip -r $filename * \
62 | && mv $filename $startDir/$filename \
63 | )
64 | cd $startDir
65 | echo "[${packageExt}] md5: $(md5sum $filename | awk '{ print $1 }')"
66 | echo "[${packageExt}] sha256: $(sha256sum $filename | awk '{ print $1 }')"
67 |
68 |
69 | ### Done
70 | cd $startDir
71 |
72 |
--------------------------------------------------------------------------------
/inactiveblur/build:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Version 14
3 |
4 | ### User Variables
5 | qtMinVer="5.12"
6 | kfMinVer="5.68"
7 | plasmaMinVer="5.25"
8 | filenameTag="-plasma${plasmaMinVer}"
9 | packageExt="zip"
10 |
11 |
12 | ### Misc
13 | startDir=$PWD
14 |
15 | ### Check QML Versions
16 | # See https://zren.github.io/kde/versions/ for distro versions
17 | if [ -f checkimports.py ]; then
18 | python3 checkimports.py --qt="$qtMinVer" --kf="$kfMinVer" --plasma="$plasmaMinVer"
19 | if [ $? == 1 ]; then
20 | exit 1
21 | fi
22 | fi
23 |
24 | ### Translations
25 | if [ -d "package/translate" ]; then
26 | echo "[build] translate dir found, running merge."
27 | (cd package/translate && sh ./merge)
28 | (cd package/translate && sh ./build)
29 | if [ "$(git diff --stat .)" != "" ]; then
30 | echo "[build] Changed detected. Cancelling build."
31 | git diff --stat .
32 | exit 1
33 | fi
34 | fi
35 |
36 |
37 | ### Variables
38 | packageNamespace=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
39 | packageName="${packageNamespace##*.}" # Strip namespace (Eg: "org.kde.plasma.")
40 | packageVersion=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Version"`
41 | packageAuthor=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Author"`
42 | packageAuthorEmail=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Email"`
43 | packageWebsite=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"`
44 | packageComment=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="Comment"`
45 |
46 | ### metadata.desktop => metadata.json
47 | if command -v desktoptojson &> /dev/null ; then
48 | genOutput=`desktoptojson --serviceType="plasma-applet.desktop" -i "$PWD/package/metadata.desktop" -o "$PWD/package/metadata.json"`
49 | if [ "$?" != "0" ]; then
50 | exit 1
51 | fi
52 | # Tabify metadata.json
53 | sed -i '{s/ \{4\}/\t/g}' "$PWD/package/metadata.json"
54 | fi
55 |
56 |
57 | ### *.plasmoid
58 | filename="${packageName}-v${packageVersion}${filenameTag}.${packageExt}"
59 | rm ${packageName}-v*.${packageExt} # Cleanup
60 | (cd package \
61 | && zip -r $filename * \
62 | && mv $filename $startDir/$filename \
63 | )
64 | cd $startDir
65 | echo "[${packageExt}] md5: $(md5sum $filename | awk '{ print $1 }')"
66 | echo "[${packageExt}] sha256: $(sha256sum $filename | awk '{ print $1 }')"
67 |
68 |
69 | ### Done
70 | cd $startDir
71 |
72 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/WallpaperDelegate.qml:
--------------------------------------------------------------------------------
1 | // Version 3
2 |
3 | /*
4 | SPDX-FileCopyrightText: 2013 Marco Martin
5 | SPDX-FileCopyrightText: 2014 Kai Uwe Broulik
6 |
7 | SPDX-License-Identifier: GPL-2.0-or-later
8 | */
9 |
10 | import QtQuick 2.0
11 | import QtQuick.Controls.Private 1.0
12 | import QtQuick.Controls 2.3 as QtControls2
13 | import QtGraphicalEffects 1.0
14 | import org.kde.kquickcontrolsaddons 2.0
15 | import org.kde.plasma.components 2.0 as PlasmaComponents
16 | import org.kde.kirigami 2.4 as Kirigami
17 | import org.kde.kcm 1.1 as KCM
18 |
19 | KCM.GridDelegate {
20 | id: wallpaperDelegate
21 |
22 | property alias color: backgroundRect.color
23 | property bool selected: (wallpapersGrid.currentIndex === index)
24 | opacity: model.pendingDeletion ? 0.5 : 1
25 |
26 | text: model.display
27 |
28 | toolTip: model.author.length > 0 ? i18ndc("plasma_wallpaper_org.kde.image", " by ", "By %1", model.author) : ""
29 |
30 | hoverEnabled: true
31 |
32 | actions: [
33 | Kirigami.Action {
34 | icon.name: "document-open-folder"
35 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Containing Folder")
36 | onTriggered: imageModel.openContainingFolder(index)
37 | },
38 | Kirigami.Action {
39 | icon.name: "edit-undo"
40 | visible: model.pendingDeletion
41 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Restore wallpaper")
42 | onTriggered: imageModel.setPendingDeletion(index, !model.pendingDeletion)
43 | },
44 | Kirigami.Action {
45 | icon.name: "edit-delete"
46 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Remove Wallpaper")
47 | visible: model.removable && !model.pendingDeletion && !cfg_Slideshow
48 | onTriggered: {
49 | imageModel.setPendingDeletion(index, true);
50 | if (wallpapersGrid.currentIndex === index) {
51 | wallpapersGrid.currentIndex = (index + 1) % wallpapersGrid.rowCount();
52 | }
53 | }
54 | }
55 | ]
56 |
57 | thumbnail: Rectangle {
58 | id: backgroundRect
59 | color: cfg_Color
60 | anchors.fill: parent
61 |
62 | QIconItem {
63 | anchors.centerIn: parent
64 | width: units.iconSizes.large
65 | height: width
66 | icon: "view-preview"
67 | visible: !walliePreview.visible
68 | }
69 |
70 | QPixmapItem {
71 | id: blurBackgroundSource
72 | visible: cfg_Blur
73 | anchors.fill: parent
74 | smooth: true
75 | pixmap: model.screenshot
76 | fillMode: QPixmapItem.PreserveAspectCrop
77 | }
78 |
79 | FastBlur {
80 | visible: cfg_Blur
81 | anchors.fill: parent
82 | source: blurBackgroundSource
83 | radius: 4
84 | }
85 |
86 | QPixmapItem {
87 | id: walliePreview
88 | anchors.fill: parent
89 | visible: model.screenshot !== null
90 | smooth: true
91 | pixmap: model.screenshot
92 | fillMode: {
93 | if (cfg_FillMode == Image.Stretch) {
94 | return QPixmapItem.Stretch;
95 | } else if (cfg_FillMode == Image.PreserveAspectFit) {
96 | return QPixmapItem.PreserveAspectFit;
97 | } else if (cfg_FillMode == Image.PreserveAspectCrop) {
98 | return QPixmapItem.PreserveAspectCrop;
99 | } else if (cfg_FillMode == Image.Tile) {
100 | return QPixmapItem.Tile;
101 | } else if (cfg_FillMode == Image.TileVertically) {
102 | return QPixmapItem.TileVertically;
103 | } else if (cfg_FillMode == Image.TileHorizontally) {
104 | return QPixmapItem.TileHorizontally;
105 | }
106 | return QPixmapItem.PreserveAspectFit;
107 | }
108 | }
109 |
110 | // --- inactiveblur ---
111 | FastBlur {
112 | id: wallieBlurPreview
113 | anchors.fill: parent
114 | source: walliePreview
115 | visible: radius > 0
116 | radius: wallpaperDelegate.hovered ? cfg_BlurRadius : 0
117 |
118 | Behavior on radius {
119 | NumberAnimation { duration: cfg_AnimationDuration }
120 | }
121 | }
122 | // -------------------
123 |
124 | QtControls2.CheckBox {
125 | visible: cfg_Slideshow
126 | anchors.right: parent.right
127 | anchors.top: parent.top
128 | checked: visible ? model.checked : false
129 | onToggled: imageWallpaper.toggleSlide(model.path, checked)
130 | }
131 | }
132 |
133 | onClicked: {
134 | if (!cfg_Slideshow) {
135 | cfg_Image = model.path;
136 | }
137 | view.currentIndex = index;
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/ImageBaseMain.qml:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-FileCopyrightText: 2013 Marco Martin
3 | SPDX-FileCopyrightText: 2014 Sebastian Kügler
4 | SPDX-FileCopyrightText: 2014 Kai Uwe Broulik
5 |
6 | SPDX-License-Identifier: GPL-2.0-or-later
7 | */
8 |
9 | import QtQuick 2.5
10 | import QtQuick.Controls 2.1 as QQC2
11 | import QtQuick.Window 2.2
12 | import QtGraphicalEffects 1.0
13 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
14 | import org.kde.plasma.core 2.0 as PlasmaCore
15 |
16 | QQC2.StackView {
17 | id: root
18 |
19 | readonly property string modelImage: imageWallpaper.wallpaperPath
20 | readonly property string configuredImage: wallpaper.configuration.Image
21 | readonly property int fillMode: wallpaper.configuration.FillMode
22 | readonly property string configColor: wallpaper.configuration.Color
23 | readonly property bool blur: wallpaper.configuration.Blur
24 | readonly property size sourceSize: Qt.size(root.width * Screen.devicePixelRatio, root.height * Screen.devicePixelRatio)
25 |
26 | //public API, the C++ part will look for those
27 | function setUrl(url) {
28 | wallpaper.configuration.Image = url
29 | imageWallpaper.addUsersWallpaper(url)
30 | }
31 |
32 | function action_next() {
33 | imageWallpaper.nextSlide()
34 | }
35 |
36 | function action_open() {
37 | Qt.openUrlExternally(modelImage)
38 | }
39 |
40 | //private
41 |
42 | onConfiguredImageChanged: {
43 | if (modelImage != configuredImage && configuredImage != "") {
44 | imageWallpaper.addUrl(configuredImage)
45 | }
46 | }
47 |
48 | function updateContextMenu() {
49 | var action
50 | action = wallpaper.action("open")
51 | action.visible = wallpaper.configuration.Slideshow
52 | action = wallpaper.action("next")
53 | action.visible = wallpaper.configuration.Slideshow
54 | }
55 |
56 | Component.onCompleted: {
57 | wallpaper.setAction("open", i18nd("plasma_wallpaper_org.kde.image", "Open Wallpaper Image"), "document-open")
58 | wallpaper.setAction("next", i18nd("plasma_wallpaper_org.kde.image", "Next Wallpaper Image"), "user-desktop")
59 | updateContextMenu()
60 | }
61 |
62 | readonly property bool isSlideshow: wallpaper.configuration.Slideshow
63 | onIsSlideshowChanged: {
64 | updateContextMenu()
65 |
66 | // Warkaround to stop the slideshow timer
67 | if (isSlideshow) {
68 | imageWallpaper.slideTimer = Qt.binding(function(){ return wallpaper.configuration.SlideInterval })
69 | } else {
70 | imageWallpaper.slideTimer = -1
71 | Qt.callLater(root.configuredImageChanged) // Doesn't always work
72 | }
73 | }
74 |
75 | // Plasma 5.24 and below use Wallpaper.Image
76 | // Plasma 5.25 uses Wallpaper.ImageBackend, see: https://github.com/Zren/plasma-wallpapers/issues/14
77 | // Plasma 5.26 uses Wallpaper.MediaProxy, see: https://github.com/Zren/plasma-wallpapers/issues/15
78 | property var imageWallpaper: Wallpaper.ImageBackend {
79 | id: imageWallpaper
80 | //the oneliner of difference between image and slideshow wallpapers
81 | renderingMode: wallpaper.configuration.Slideshow ? Wallpaper.ImageBackend.SlideShow : Wallpaper.ImageBackend.SingleImage
82 | targetSize: Qt.size(root.width, root.height)
83 | slidePaths: wallpaper.configuration.SlidePaths
84 | slideTimer: wallpaper.configuration.SlideInterval
85 | slideshowMode: wallpaper.configuration.SlideshowMode
86 | uncheckedSlides: wallpaper.configuration.UncheckedSlides
87 | }
88 |
89 | onFillModeChanged: Qt.callLater(loadImage)
90 | onModelImageChanged: {
91 | Qt.callLater(loadImage)
92 | wallpaper.configuration.Image = modelImage
93 | }
94 | onConfigColorChanged: Qt.callLater(loadImage)
95 | onBlurChanged: Qt.callLater(loadImage)
96 | onWidthChanged: Qt.callLater(loadImage)
97 | onHeightChanged: Qt.callLater(loadImage)
98 |
99 | function loadImage() {
100 | var isFirst = (root.currentItem == undefined)
101 | var pendingImage = root.baseImage.createObject(root, {
102 | "source": root.modelImage,
103 | "fillMode": root.fillMode,
104 | "sourceSize": root.sourceSize,
105 | "color": root.configColor,
106 | "blur": root.blur,
107 | "opacity": isFirst ? 1 : 0,
108 | })
109 |
110 | function replaceWhenLoaded() {
111 | if (pendingImage.status != Image.Loading) {
112 | root.replace(pendingImage, {},
113 | isFirst ? QQC2.StackView.Immediate : QQC2.StackView.Transition) // don't animate first show
114 | pendingImage.statusChanged.disconnect(replaceWhenLoaded)
115 | }
116 | }
117 | pendingImage.statusChanged.connect(replaceWhenLoaded)
118 | replaceWhenLoaded()
119 | }
120 |
121 | property Component baseImage: Component {
122 | Image {
123 | id: mainImage
124 |
125 | property alias color: backgroundColor.color
126 | property bool blur: false
127 |
128 | asynchronous: true
129 | cache: false
130 | autoTransform: true
131 | z: -1
132 |
133 | QQC2.StackView.onRemoved: destroy()
134 |
135 | Rectangle {
136 | id: backgroundColor
137 | anchors.fill: parent
138 | visible: mainImage.status === Image.Ready && !blurLoader.active
139 | z: -2
140 | }
141 |
142 | Loader {
143 | id: blurLoader
144 | anchors.fill: parent
145 | z: -3
146 | active: mainImage.blur && (mainImage.fillMode === Image.PreserveAspectFit || mainImage.fillMode === Image.Pad)
147 | sourceComponent: Item {
148 | Image {
149 | id: blurSource
150 | anchors.fill: parent
151 | asynchronous: true
152 | cache: false
153 | autoTransform: true
154 | fillMode: Image.PreserveAspectCrop
155 | source: mainImage.source
156 | sourceSize: mainImage.sourceSize
157 | visible: false // will be rendered by the blur
158 | }
159 |
160 | GaussianBlur {
161 | id: blurEffect
162 | anchors.fill: parent
163 | source: blurSource
164 | radius: 32
165 | samples: 65
166 | visible: blurSource.status === Image.Ready
167 | }
168 | }
169 | }
170 | }
171 | }
172 |
173 | replaceEnter: Transition {
174 | OpacityAnimator {
175 | from: 0
176 | to: 1
177 | duration: wallpaper.configuration.TransitionAnimationDuration
178 | }
179 | }
180 | // Keep the old image around till the new one is fully faded in
181 | // If we fade both at the same time you can see the background behind glimpse through
182 | replaceExit: Transition {
183 | PauseAnimation {
184 | duration: wallpaper.configuration.TransitionAnimationDuration
185 | }
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/ui/WallpaperDelegate.qml:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Marco Martin
3 | * Copyright 2014 Sebastian Kügler
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
18 | */
19 |
20 | import QtQuick 2.0
21 | import QtQuick.Controls.Private 1.0
22 | import org.kde.kquickcontrolsaddons 2.0
23 | import org.kde.plasma.components 2.0 as PlasmaComponents
24 |
25 | MouseArea {
26 | id: wallpaperDelegate
27 |
28 | width: wallpapersGrid.cellWidth
29 | height: wallpapersGrid.cellHeight
30 |
31 | property alias color: backgroundRect.color
32 | property bool selected: (wallpapersGrid.currentIndex == index)
33 | opacity: model.pendingDeletion ? 0.5 : 1
34 |
35 | onSelectedChanged: {
36 | if (selected) {
37 | cfg_Image = model.path
38 | }
39 | }
40 |
41 | hoverEnabled: true
42 |
43 |
44 | //note: this *doesn't* use system colors since it represent a
45 | //skeymorphic photograph rather than a widget
46 | Rectangle {
47 | id: background
48 | color: "white"
49 | anchors {
50 | fill: parent
51 | margins: units.smallSpacing
52 | }
53 | opacity: 0.8
54 | Rectangle {
55 | id: backgroundRect
56 | color: cfg_Color
57 | anchors {
58 | fill: parent
59 | margins: units.smallSpacing * 2
60 | }
61 | QIconItem {
62 | anchors.centerIn: parent
63 | width: units.iconSizes.large
64 | height: width
65 | icon: "view-preview"
66 | visible: !walliePreview.visible
67 | }
68 | QPixmapItem {
69 | id: walliePreview
70 | anchors.fill: parent
71 | visible: model.screenshot != null
72 | smooth: true
73 | pixmap: model.screenshot
74 | fillMode: {
75 | if (cfg_FillMode == Image.Stretch) {
76 | return QPixmapItem.Stretch;
77 | } else if (cfg_FillMode == Image.PreserveAspectFit) {
78 | return QPixmapItem.PreserveAspectFit;
79 | } else if (cfg_FillMode == Image.PreserveAspectCrop) {
80 | return QPixmapItem.PreserveAspectCrop;
81 | } else if (cfg_FillMode == Image.Tile) {
82 | return QPixmapItem.Tile;
83 | } else if (cfg_FillMode == Image.TileVertically) {
84 | return QPixmapItem.TileVertically;
85 | } else if (cfg_FillMode == Image.TileHorizontally) {
86 | return QPixmapItem.TileHorizontally;
87 | }
88 | return QPixmapItem.Pad;
89 | }
90 | }
91 | PlasmaComponents.ToolButton {
92 | anchors {
93 | top: parent.top
94 | right: parent.right
95 | margins: units.smallSpacing
96 | }
97 | iconSource: "list-remove"
98 | tooltip: i18nd("plasma_applet_org.kde.image", "Remove wallpaper")
99 | flat: false
100 | visible: model.removable && !model.pendingDeletion
101 | onClicked: {
102 | imageWallpaper.wallpaperModel.setPendingDeletion(index, true);
103 | if (wallpapersGrid.currentIndex === index) {
104 | wallpapersGrid.currentIndex = (index + 1) % wallpapersGrid.count;
105 | }
106 | }
107 | opacity: wallpaperDelegate.containsMouse ? 1 : 0
108 | Behavior on opacity {
109 | PropertyAnimation {
110 | duration: units.longDuration
111 | easing.type: Easing.OutQuad
112 | }
113 | }
114 | }
115 |
116 | PlasmaComponents.ToolButton {
117 | anchors {
118 | top: parent.top
119 | right: parent.right
120 | margins: units.smallSpacing
121 | }
122 | iconSource: "edit-undo"
123 | tooltip: i18nd("plasma_applet_org.kde.image", "Restore wallpaper")
124 | flat: false
125 | visible: model.pendingDeletion
126 | onClicked: imageWallpaper.wallpaperModel.setPendingDeletion(index, !model.pendingDeletion)
127 | opacity: wallpaperDelegate.containsMouse ? 1 : 0
128 | Behavior on opacity {
129 | PropertyAnimation {
130 | duration: units.longDuration
131 | easing.type: Easing.OutQuad
132 | }
133 | }
134 | }
135 | }
136 | }
137 |
138 | Rectangle {
139 | opacity: selected ? 1.0 : 0
140 | anchors.fill: background
141 | border.width: units.smallSpacing * 2
142 | border.color: syspal.highlight
143 | color: "transparent"
144 | Behavior on opacity {
145 | PropertyAnimation {
146 | duration: units.longDuration
147 | easing.type: Easing.OutQuad
148 | }
149 | }
150 | }
151 |
152 |
153 | Timer {
154 | interval: 1000 // FIXME TODO: Use platform value for tooltip activation delay.
155 |
156 | running: wallpaperDelegate.containsMouse && !pressed && model.display
157 |
158 | onTriggered: {
159 | if (model.author) {
160 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY),
161 | i18nd("plasma_applet_org.kde.image", "%1 by %2", model.display, model.author));
162 | } else {
163 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY),
164 | model.display);
165 | }
166 | }
167 | }
168 |
169 | onClicked: {
170 | wallpapersGrid.currentIndex = index
171 | wallpapersGrid.forceActiveFocus();
172 | cfg_Image = model.path
173 | }
174 |
175 | onExited: Tooltip.hideText()
176 | }
177 |
--------------------------------------------------------------------------------
/inactiveblur/package/contents/ui/ImageConfigPage.qml:
--------------------------------------------------------------------------------
1 | // Version 3
2 |
3 | /*
4 | SPDX-FileCopyrightText: 2013 Marco Martin
5 | SPDX-FileCopyrightText: 2014 Kai Uwe Broulik
6 |
7 | SPDX-License-Identifier: GPL-2.0-or-later
8 | */
9 |
10 | import QtQuick 2.5
11 | import QtQuick.Controls 1.0 as QtControls
12 | import QtQuick.Controls 2.3 as QtControls2
13 | import QtQuick.Layouts 1.0
14 | import QtQuick.Window 2.0 // for Screen
15 | //We need units from it
16 | import org.kde.plasma.core 2.0 as Plasmacore
17 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
18 | import org.kde.kquickcontrols 2.0 as KQuickControls
19 | import org.kde.kquickcontrolsaddons 2.0
20 | import org.kde.kconfig 1.0 // for KAuthorized
21 | import org.kde.draganddrop 2.0 as DragDrop
22 | import org.kde.kcm 1.1 as KCM
23 | import org.kde.kirigami 2.5 as Kirigami
24 |
25 | ColumnLayout {
26 | id: root
27 | property alias cfg_Color: colorButton.color
28 | property string cfg_Image
29 | property int cfg_FillMode
30 | property int cfg_SlideshowMode
31 | property alias cfg_Blur: blurRadioButton.checked
32 | property var cfg_SlidePaths: ""
33 | property int cfg_SlideInterval: 0
34 | property var cfg_UncheckedSlides: []
35 |
36 | property alias cfg_Slideshow: slideshowCheckBox.checked
37 |
38 | function saveConfig() {
39 | imageWallpaper.commitDeletion();
40 | }
41 |
42 | Wallpaper.ImageBackend {
43 | id: imageWallpaper
44 | targetSize: {
45 | if (typeof plasmoid !== "undefined") {
46 | return Qt.size(plasmoid.width, plasmoid.height)
47 | }
48 | // Lock screen configuration case
49 | return Qt.size(Screen.width, Screen.height)
50 | }
51 | onSlidePathsChanged: cfg_SlidePaths = slidePaths
52 | onUncheckedSlidesChanged: cfg_UncheckedSlides = uncheckedSlides
53 | onSlideshowModeChanged: cfg_SlideshowMode = slideshowMode
54 | }
55 |
56 | onCfg_SlidePathsChanged: {
57 | imageWallpaper.slidePaths = cfg_SlidePaths
58 | }
59 | onCfg_UncheckedSlidesChanged: {
60 | imageWallpaper.uncheckedSlides = cfg_UncheckedSlides
61 | }
62 | onCfg_SlideshowModeChanged: {
63 | imageWallpaper.slideshowMode = cfg_SlideshowMode
64 | }
65 |
66 | property int hoursIntervalValue: Math.floor(cfg_SlideInterval / 3600)
67 | property int minutesIntervalValue: Math.floor(cfg_SlideInterval % 3600) / 60
68 | property int secondsIntervalValue: cfg_SlideInterval % 3600 % 60
69 |
70 | //Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 }
71 |
72 | Kirigami.FormLayout {
73 | id: twinFormLayout
74 | twinFormLayouts: parentLayout
75 | QtControls2.ComboBox {
76 | id: resizeComboBox
77 | Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Positioning:")
78 | model: [
79 | {
80 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Scaled and Cropped"),
81 | 'fillMode': Image.PreserveAspectCrop
82 | },
83 | {
84 | 'label': i18nd("plasma_wallpaper_org.kde.image","Scaled"),
85 | 'fillMode': Image.Stretch
86 | },
87 | {
88 | 'label': i18nd("plasma_wallpaper_org.kde.image","Scaled, Keep Proportions"),
89 | 'fillMode': Image.PreserveAspectFit
90 | },
91 | {
92 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Centered"),
93 | 'fillMode': Image.Pad
94 | },
95 | {
96 | 'label': i18nd("plasma_wallpaper_org.kde.image","Tiled"),
97 | 'fillMode': Image.Tile
98 | }
99 | ]
100 |
101 | textRole: "label"
102 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"]
103 | Component.onCompleted: setMethod();
104 |
105 | function setMethod() {
106 | for (var i = 0; i < model.length; i++) {
107 | if (model[i]["fillMode"] === wallpaper.configuration.FillMode) {
108 | resizeComboBox.currentIndex = i;
109 | var tl = model[i]["label"].length;
110 | //resizeComboBox.textLength = Math.max(resizeComboBox.textLength, tl+5);
111 | }
112 | }
113 | }
114 | }
115 |
116 | QtControls2.ButtonGroup { id: backgroundGroup }
117 |
118 | QtControls2.RadioButton {
119 | id: blurRadioButton
120 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad
121 | Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Background:")
122 | text: i18nd("plasma_wallpaper_org.kde.image", "Blur")
123 | QtControls2.ButtonGroup.group: backgroundGroup
124 | }
125 |
126 | RowLayout {
127 | id: colorRow
128 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad
129 | QtControls2.RadioButton {
130 | id: colorRadioButton
131 | text: i18nd("plasma_wallpaper_org.kde.image", "Solid color")
132 | checked: !cfg_Blur
133 | QtControls2.ButtonGroup.group: backgroundGroup
134 | }
135 | KQuickControls.ColorButton {
136 | id: colorButton
137 | dialogTitle: i18nd("plasma_wallpaper_org.kde.image", "Select Background Color")
138 | }
139 | }
140 | }
141 |
142 | default property alias contentData: contentLayout.data
143 | Kirigami.FormLayout {
144 | id: contentLayout
145 | twinFormLayouts: parentLayout
146 | }
147 |
148 | Kirigami.FormLayout {
149 | id: slideshowRow
150 | twinFormLayouts: parentLayout
151 | QtControls2.CheckBox {
152 | id: slideshowCheckBox
153 | Kirigami.FormData.label: i18n("Slideshow:")
154 | }
155 | }
156 |
157 | Component {
158 | id: foldersComponent
159 | ColumnLayout {
160 | Connections {
161 | target: root
162 | onHoursIntervalValueChanged: hoursInterval.value = root.hoursIntervalValue
163 | onMinutesIntervalValueChanged: minutesInterval.value = root.minutesIntervalValue
164 | onSecondsIntervalValueChanged: secondsInterval.value = root.secondsIntervalValue
165 | }
166 | //FIXME: there should be only one spinbox: QtControls spinboxes are still too limited for it tough
167 | Kirigami.FormLayout {
168 | twinFormLayouts: parentLayout
169 |
170 | QtControls2.ComboBox {
171 | id: slideshowComboBox
172 | visible: cfg_Slideshow
173 | Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image", "Order:")
174 | model: [
175 | {
176 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Random"),
177 | 'slideshowMode': Wallpaper.ImageBackend.Random
178 | },
179 | {
180 | 'label': i18nd("plasma_wallpaper_org.kde.image", "A to Z"),
181 | 'slideshowMode': Wallpaper.ImageBackend.Alphabetical
182 | },
183 | {
184 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Z to A"),
185 | 'slideshowMode': Wallpaper.ImageBackend.AlphabeticalReversed
186 | },
187 | {
188 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Date modified (newest first)"),
189 | 'slideshowMode': Wallpaper.ImageBackend.ModifiedReversed
190 | },
191 | {
192 | 'label': i18nd("plasma_wallpaper_org.kde.image", "Date modified (oldest first)"),
193 | 'slideshowMode': Wallpaper.ImageBackend.Modified
194 | }
195 | ]
196 | textRole: "label"
197 | onCurrentIndexChanged: {
198 | cfg_SlideshowMode = model[currentIndex]["slideshowMode"]
199 | }
200 | Component.onCompleted: setMethod();
201 | function setMethod() {
202 | for (var i = 0; i < model.length; i++) {
203 | if (model[i]["slideshowMode"] === wallpaper.configuration.SlideshowMode) {
204 | slideshowComboBox.currentIndex = i
205 | }
206 | }
207 | }
208 | }
209 |
210 | RowLayout {
211 | Kirigami.FormData.label: i18nd("plasma_wallpaper_org.kde.image","Change every:")
212 | QtControls2.SpinBox {
213 | id: hoursInterval
214 | value: root.hoursIntervalValue
215 | from: 0
216 | to: 24
217 | editable: true
218 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value
219 | }
220 | QtControls2.Label {
221 | text: i18nd("plasma_wallpaper_org.kde.image","Hours")
222 | }
223 | QtControls2.SpinBox {
224 | id: minutesInterval
225 | value: root.minutesIntervalValue
226 | from: 0
227 | to: 60
228 | editable: true
229 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value
230 | }
231 | QtControls2.Label {
232 | text: i18nd("plasma_wallpaper_org.kde.image","Minutes")
233 | }
234 | QtControls2.SpinBox {
235 | id: secondsInterval
236 | value: root.secondsIntervalValue
237 | from: root.hoursIntervalValue === 0 && root.minutesIntervalValue === 0 ? 1 : 0
238 | to: 60
239 | editable: true
240 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value
241 | }
242 | QtControls2.Label {
243 | text: i18nd("plasma_wallpaper_org.kde.image","Seconds")
244 | }
245 | }
246 | }
247 | Kirigami.Heading {
248 | text: i18nd("plasma_wallpaper_org.kde.image","Folders")
249 | level: 2
250 | }
251 | GridLayout {
252 | columns: 2
253 | Layout.fillWidth: true
254 | Layout.fillHeight: true
255 | columnSpacing: Kirigami.Units.largeSpacing
256 | QtControls2.ScrollView {
257 | id: foldersScroll
258 | Layout.fillHeight: true
259 | Layout.preferredWidth: 0.25 * parent.width
260 | Component.onCompleted: foldersScroll.background.visible = true;
261 | ListView {
262 | id: slidePathsView
263 | anchors.margins: 4
264 | model: imageWallpaper.slidePaths
265 | delegate: Kirigami.SwipeListItem {
266 | id: folderDelegate
267 | actions: [
268 | Kirigami.Action {
269 | iconName: "list-remove"
270 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Remove Folder")
271 | onTriggered: imageWallpaper.removeSlidePath(modelData)
272 | },
273 | Kirigami.Action {
274 | icon.name: "document-open-folder"
275 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Folder")
276 | onTriggered: imageWallpaper.openFolder(modelData)
277 | }
278 | ]
279 | QtControls2.Label {
280 | text: modelData.endsWith("/") ? modelData.split('/').reverse()[1] : modelData.split('/').pop()
281 | Layout.fillWidth: true
282 | QtControls2.ToolTip.text: modelData
283 | QtControls2.ToolTip.visible: folderDelegate.hovered
284 | QtControls2.ToolTip.delay: 1000
285 | QtControls2.ToolTip.timeout: 5000
286 | }
287 | width: slidePathsView.width
288 | height: paintedHeight;
289 | }
290 | }
291 | }
292 | Loader {
293 | sourceComponent: thumbnailsComponent
294 | Layout.fillWidth: true
295 | Layout.fillHeight: true
296 | anchors.fill: undefined
297 | }
298 | QtControls2.Button {
299 | Layout.alignment: Qt.AlignRight
300 | icon.name: "list-add"
301 | text: i18nd("plasma_wallpaper_org.kde.image","Add Folder...")
302 | onClicked: imageWallpaper.showAddSlidePathsDialog()
303 | }
304 | QtControls2.Button {
305 | Layout.alignment: Qt.AlignRight
306 | icon.name: "get-hot-new-stuff"
307 | text: i18nd("plasma_wallpaper_org.kde.image","Get New Wallpapers...")
308 | visible: KAuthorized.authorize("ghns")
309 | onClicked: imageWallpaper.getNewWallpaper(this);
310 | }
311 | }
312 | }
313 | }
314 |
315 | Component {
316 | id: thumbnailsComponent
317 | KCM.GridView {
318 | id: wallpapersGrid
319 | anchors.fill: parent
320 | property var imageModel: cfg_Slideshow ? imageWallpaper.slideFilterModel : imageWallpaper.wallpaperModel
321 | //that min is needed as the module will be populated in an async way
322 | //and only on demand so we can't ensure it already exists
323 | view.currentIndex: Math.min(imageModel.indexOf(cfg_Image), imageModel.rowCount()-1)
324 | //kill the space for label under thumbnails
325 | view.model: imageModel
326 | Component.onCompleted: {
327 | imageModel.usedInConfig = true
328 | }
329 | view.delegate: WallpaperDelegate {
330 | color: cfg_Color
331 | }
332 | }
333 | }
334 |
335 | DragDrop.DropArea {
336 | Layout.fillWidth: true
337 | Layout.fillHeight: true
338 |
339 | onDragEnter: {
340 | if (!event.mimeData.hasUrls) {
341 | event.ignore();
342 | }
343 | }
344 | onDrop: {
345 | event.mimeData.urls.forEach(function (url) {
346 | if (url.indexOf("file://") === 0) {
347 | var path = url.substr(7); // 7 is length of "file://"
348 | if (cfg_Slideshow) {
349 | imageWallpaper.addSlidePath(path);
350 | } else {
351 | imageWallpaper.addUsersWallpaper(path);
352 | }
353 | }
354 | });
355 | }
356 |
357 | Loader {
358 | anchors.fill: parent
359 | sourceComponent: cfg_Slideshow ? foldersComponent : thumbnailsComponent
360 | }
361 | }
362 |
363 | RowLayout {
364 | id: buttonsRow
365 | Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
366 | visible: !cfg_Slideshow
367 | QtControls2.Button {
368 | icon.name: "list-add"
369 | text: i18nd("plasma_wallpaper_org.kde.image","Add Image...")
370 | onClicked: imageWallpaper.showFileDialog();
371 | }
372 | QtControls2.Button {
373 | icon.name: "get-hot-new-stuff"
374 | text: i18nd("plasma_wallpaper_org.kde.image","Get New Wallpapers...")
375 | visible: KAuthorized.authorize("ghns")
376 | onClicked: imageWallpaper.getNewWallpaper(this);
377 | }
378 | }
379 | }
380 |
--------------------------------------------------------------------------------
/animatedhue/package/contents/ui/config.qml:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Marco Martin
3 | * Copyright 2014 Kai Uwe Broulik
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
18 | */
19 |
20 | import QtQuick 2.5
21 | import QtQuick.Controls 1.0 as QtControls
22 | import QtQuick.Dialogs 1.1 as QtDialogs
23 | import QtQuick.Layouts 1.0
24 | import QtQuick.Window 2.0 // for Screen
25 | //We need units from it
26 | import org.kde.plasma.core 2.0 as Plasmacore
27 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
28 | import org.kde.kquickcontrolsaddons 2.0
29 |
30 | ColumnLayout {
31 | id: root
32 | property alias cfg_Color: colorDialog.color
33 | property string cfg_Image
34 | property int cfg_FillMode
35 | property var cfg_SlidePaths: ""
36 | property int cfg_SlideInterval: 0
37 | property int cfg_AnimationDuration: 400
38 | property int cfg_TickInterval: 10000
39 | property double cfg_TickDelta: 0.05
40 |
41 | function saveConfig() {
42 | imageWallpaper.commitDeletion();
43 | }
44 |
45 | SystemPalette {
46 | id: syspal
47 | }
48 |
49 | Wallpaper.Image {
50 | id: imageWallpaper
51 | targetSize: {
52 | if (typeof plasmoid !== "undefined") {
53 | return Qt.size(plasmoid.width, plasmoid.height)
54 | }
55 | // Lock screen configuration case
56 | return Qt.size(Screen.width, Screen.height)
57 | }
58 | onSlidePathsChanged: cfg_SlidePaths = slidePaths
59 | }
60 |
61 | onCfg_SlidePathsChanged: {
62 | imageWallpaper.slidePaths = cfg_SlidePaths
63 | }
64 |
65 | property int hoursIntervalValue: Math.floor(cfg_SlideInterval / 3600)
66 | property int minutesIntervalValue: Math.floor(cfg_SlideInterval % 3600) / 60
67 | property int secondsIntervalValue: cfg_SlideInterval % 3600 % 60
68 |
69 | //Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 }
70 |
71 | TextMetrics {
72 | id: textMetrics
73 | text: "00"
74 | }
75 |
76 | Row {
77 | //x: formAlignment - positionLabel.paintedWidth
78 | spacing: units.largeSpacing / 2
79 | QtControls.Label {
80 | id: positionLabel
81 | width: formAlignment - units.largeSpacing
82 | anchors {
83 | verticalCenter: resizeComboBox.verticalCenter
84 | }
85 | text: i18nd("plasma_applet_org.kde.image", "Positioning:")
86 | horizontalAlignment: Text.AlignRight
87 | }
88 | QtControls.ComboBox {
89 | id: resizeComboBox
90 | property int textLength: 24
91 | width: theme.mSize(theme.defaultFont).width * textLength
92 | model: [
93 | {
94 | 'label': i18nd("plasma_applet_org.kde.image", "Scaled and Cropped"),
95 | 'fillMode': Image.PreserveAspectCrop
96 | },
97 | {
98 | 'label': i18nd("plasma_applet_org.kde.image","Scaled"),
99 | 'fillMode': Image.Stretch
100 | },
101 | {
102 | 'label': i18nd("plasma_applet_org.kde.image","Scaled, Keep Proportions"),
103 | 'fillMode': Image.PreserveAspectFit
104 | },
105 | {
106 | 'label': i18nd("plasma_applet_org.kde.image", "Centered"),
107 | 'fillMode': Image.Pad
108 | },
109 | {
110 | 'label': i18nd("plasma_applet_org.kde.image","Tiled"),
111 | 'fillMode': Image.Tile
112 | }
113 | ]
114 |
115 | textRole: "label"
116 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"]
117 | Component.onCompleted: setMethod();
118 |
119 | function setMethod() {
120 | for (var i = 0; i < model.length; i++) {
121 | if (model[i]["fillMode"] == wallpaper.configuration.FillMode) {
122 | resizeComboBox.currentIndex = i;
123 | var tl = model[i]["label"].length;
124 | //resizeComboBox.textLength = Math.max(resizeComboBox.textLength, tl+5);
125 | }
126 | }
127 | }
128 | }
129 | }
130 |
131 | QtDialogs.ColorDialog {
132 | id: colorDialog
133 | modality: Qt.WindowModal
134 | showAlphaChannel: false
135 | title: i18nd("plasma_applet_org.kde.image", "Select Background Color")
136 | }
137 |
138 | Row {
139 | id: colorRow
140 | spacing: units.largeSpacing / 2
141 | QtControls.Label {
142 | width: formAlignment - units.largeSpacing
143 | anchors.verticalCenter: colorButton.verticalCenter
144 | horizontalAlignment: Text.AlignRight
145 | text: i18nd("plasma_applet_org.kde.image", "Background Color:")
146 | }
147 | QtControls.Button {
148 | id: colorButton
149 | width: units.gridUnit * 3
150 | text: " " // needed to it gets a proper height...
151 | onClicked: colorDialog.open()
152 |
153 | Rectangle {
154 | id: colorRect
155 | anchors.centerIn: parent
156 | width: parent.width - 2 * units.smallSpacing
157 | height: theme.mSize(theme.defaultFont).height
158 | color: colorDialog.color
159 | }
160 | }
161 | }
162 |
163 |
164 | Component {
165 | id: thumbnailsComponent
166 | QtControls.ScrollView {
167 | anchors.fill: parent
168 |
169 | frameVisible: true
170 | highlightOnFocus: true;
171 |
172 | Component.onCompleted: {
173 | //replace the current binding on the scrollbar that makes it visible when content doesn't fit
174 |
175 | //otherwise we adjust gridSize when we hide the vertical scrollbar and
176 | //due to layouting that can make everything adjust which changes the contentWidth/height which
177 | //changes our scrollbars and we continue being stuck in a loop
178 |
179 | //looks better to not have everything resize anyway.
180 | //BUG: 336301
181 | __verticalScrollBar.visible = true
182 | }
183 |
184 | GridView {
185 | id: wallpapersGrid
186 | model: imageWallpaper.wallpaperModel
187 | currentIndex: -1
188 | focus: true
189 |
190 | cellWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 1))
191 | cellHeight: Math.round(cellWidth / (imageWallpaper.targetSize.width / imageWallpaper.targetSize.height))
192 |
193 | anchors.margins: 4
194 | boundsBehavior: Flickable.StopAtBounds
195 |
196 | delegate: WallpaperDelegate {
197 | color: cfg_Color
198 | }
199 |
200 | onContentHeightChanged: {
201 | wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image);
202 | wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible)
203 | }
204 |
205 | Keys.onPressed: {
206 | if (count < 1) {
207 | return;
208 | }
209 |
210 | if (event.key == Qt.Key_Home) {
211 | currentIndex = 0;
212 | } else if (event.key == Qt.Key_End) {
213 | currentIndex = count - 1;
214 | }
215 | }
216 |
217 | Keys.onLeftPressed: moveCurrentIndexLeft()
218 | Keys.onRightPressed: moveCurrentIndexRight()
219 | Keys.onUpPressed: moveCurrentIndexUp()
220 | Keys.onDownPressed: moveCurrentIndexDown()
221 |
222 | Connections {
223 | target: imageWallpaper
224 | onCustomWallpaperPicked: {
225 | wallpapersGrid.currentIndex = 0
226 | }
227 | }
228 |
229 | }
230 | }
231 | }
232 |
233 | RowLayout {
234 | Layout.fillWidth: true
235 | Layout.fillHeight: true
236 |
237 | Loader {
238 | Layout.fillWidth: true
239 | Layout.fillHeight: true
240 | sourceComponent: thumbnailsComponent
241 | }
242 |
243 | ColumnLayout {
244 | Layout.minimumWidth: parent.width / 3
245 | Layout.preferredWidth: parent.width / 3
246 | Layout.maximumWidth: parent.width * 2/3
247 | Layout.fillHeight: true
248 |
249 | RowLayout {
250 | QtControls.Label {
251 | text: i18n("Change hue by ")
252 | }
253 | QtControls.SpinBox {
254 | id: tickDeltaSpinBox
255 | value: cfg_TickDelta
256 | onValueChanged: cfg_TickDelta = value
257 | decimals: 2
258 | stepSize: 0.05
259 | minimumValue: 0.00 // No change
260 | maximumValue: 0.99 // "1" will also be no change, so prevent the user from selecting it.
261 | }
262 | QtControls.Label {
263 | text: i18n(" over ")
264 | }
265 | QtControls.SpinBox {
266 | id: animationDurationSpinBox
267 | value: cfg_AnimationDuration
268 | onValueChanged: cfg_AnimationDuration = value
269 | maximumValue: 2000000000
270 | stepSize: 100
271 | suffix: i18n("ms")
272 | }
273 | }
274 | RowLayout {
275 | QtControls.Label {
276 | text: i18n(" every ")
277 | }
278 | QtControls.SpinBox {
279 | decimals: cfg_TickInterval % 1000 == 0 ? 0 : 3
280 | value: cfg_TickInterval / 1000
281 | onValueChanged: cfg_TickInterval = value * 1000
282 | minimumValue: 1
283 | maximumValue: 2000000000
284 | stepSize: 1
285 | suffix: i18n("sec")
286 | }
287 | QtControls.Label {
288 | text: "("
289 | }
290 | QtControls.SpinBox {
291 | id: tickIntervalSpinBox
292 | value: cfg_TickInterval
293 | onValueChanged: cfg_TickInterval = value
294 | minimumValue: 1000
295 | maximumValue: 2000000000
296 | stepSize: 1000
297 | suffix: i18n("ms")
298 | }
299 | QtControls.Label {
300 | text: ")"
301 | }
302 | }
303 |
304 |
305 | HslShiftedWallpaper {
306 | id: previewImage
307 | Layout.fillWidth: true
308 | Layout.fillHeight: true
309 |
310 | source: cfg_Image
311 | fillMode: Image.PreserveAspectFit
312 | running: false
313 | }
314 |
315 | QtControls.Label {
316 | Layout.fillWidth: true
317 | text: i18n("Hue: %1", previewImage.hue)
318 | }
319 |
320 | QtControls.Slider {
321 | Layout.fillWidth: true
322 | // defaults to a real range of [0..1]
323 | // value: previewImage.hue
324 | onValueChanged: previewImage.hue = value
325 | }
326 | }
327 | }
328 |
329 | RowLayout {
330 | id: buttonsRow
331 | anchors {
332 | right: parent.right
333 | }
334 | QtControls.Button {
335 | iconName: "document-open-folder"
336 | text: i18nd("plasma_applet_org.kde.image","Open...")
337 | onClicked: imageWallpaper.showFileDialog();
338 | }
339 | QtControls.Button {
340 | iconName: "get-hot-new-stuff"
341 | text: i18nd("plasma_applet_org.kde.image","Get New Wallpapers...")
342 | onClicked: imageWallpaper.getNewWallpaper();
343 | }
344 | }
345 | }
346 |
--------------------------------------------------------------------------------