From 9889994a0db9861e82dc29d3792d0c2f2e10b8f1 Mon Sep 17 00:00:00 2001 From: "Bouteiller [a2n] Alan" Date: Wed, 2 Oct 2024 01:23:31 +0200 Subject: [PATCH] v3.2.0 rel --- CHANGELOG | 3 +++ README.md | 5 ++-- a2n.blur/contents/ui/TasksModel.qml | 38 +++++++++++++++++++++++++++++ a2n.blur/contents/ui/main.qml | 19 +++++++++++++-- 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 a2n.blur/contents/ui/TasksModel.qml diff --git a/CHANGELOG b/CHANGELOG index 6f0752e..e19eb95 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +## V3.2 + - Unblur is now trigger when the user "unactive" a window + ## V3 - Port to KDE 6 🚀 diff --git a/README.md b/README.md index a842dab..88cced6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Blur the wallpaper if a windows is active. - add color and blur option in function of the positioning - give you the ability to deactivate the effect - give you the ability to change the blur radius and the animation delay -- `new` the slideshow wallpaper type is available too +- `new` the slideshow wallpaper type is available too ### history @@ -67,8 +67,7 @@ See the following file : ## Roadmap -- bug : the first time a user selects slideshow the wallpapers are not displayed -- related : make a kwin script to affect all types of wallpapers ([see that repo](https://github.com/bouteillerAlan/activeblur)) +- bug : see issue #25 for the desync when user switch between img and slideshow ## Want to participate? Have a bug or a request feature? diff --git a/a2n.blur/contents/ui/TasksModel.qml b/a2n.blur/contents/ui/TasksModel.qml new file mode 100644 index 0000000..0df556d --- /dev/null +++ b/a2n.blur/contents/ui/TasksModel.qml @@ -0,0 +1,38 @@ +import QtQuick +import QtQml.Models +import org.kde.taskmanager as TaskManager + +Item { + id: plasmaTasksItem + + readonly property bool existsWindowActive: root.activeTaskItem && tasksRepeater.count > 0 && activeTaskItem.isActive + property Item activeTaskItem: null + + TaskManager.TasksModel { + id: tasksModel + sortMode: TaskManager.TasksModel.SortVirtualDesktop + groupMode: TaskManager.TasksModel.GroupDisabled + activity: activityInfo.currentActivity + virtualDesktop: virtualDesktopInfo.currentDesktop + filterByVirtualDesktop: true + filterByActivity: true + } + + Item { + id: taskList + + Repeater { + id: tasksRepeater + model: tasksModel + + Item { + id: task + readonly property bool isActive: IsActive === true ? true : false + + onIsActiveChanged: { + if (isActive) plasmaTasksItem.activeTaskItem = task + } + } + } + } +} diff --git a/a2n.blur/contents/ui/main.qml b/a2n.blur/contents/ui/main.qml index 6725c29..2422312 100644 --- a/a2n.blur/contents/ui/main.qml +++ b/a2n.blur/contents/ui/main.qml @@ -10,7 +10,8 @@ import QtQuick import org.kde.plasma.core as PlasmaCore import org.kde.plasma.wallpapers.image as Wallpaper import org.kde.plasma.plasmoid - +import org.kde.taskmanager as TaskManager +import org.kde.activities as Activities // for FastBlur import Qt5Compat.GraphicalEffects import QtQml.Models @@ -18,7 +19,21 @@ import QtQml.Models WallpaperItem { id: root - property bool isAnyWindowActive: Application.active + //property bool isAnyWindowActive: Application.active + readonly property bool isAnyWindowActive: windowInfoLoader.item && !windowInfoLoader.item.existsWindowActive + property Item activeTaskItem: windowInfoLoader.item.activeTaskItem + + TaskManager.ActivityInfo { id: activityInfo } + TaskManager.VirtualDesktopInfo { id: virtualDesktopInfo } + + Loader { + id: windowInfoLoader + sourceComponent: tasksModel + Component { + id: tasksModel + TasksModel {} + } + } // used by WallpaperInterface for drag and drop onOpenUrlRequested: (url) => {