From 0cad084607013f487e0225d813139daf78a0fd65 Mon Sep 17 00:00:00 2001 From: wackyideas Date: Mon, 29 Jan 2024 23:41:27 +0100 Subject: [PATCH] Fix janky label toggling in SevenTasks --- .../contents/ui/main.qml | 24 +++++-------------- .../src/package/contents/ui/main.qml | 24 +++++-------------- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/Plasma/Plasma_Widgets/User/io.gitgud.wackyideas.seventasks/contents/ui/main.qml b/Plasma/Plasma_Widgets/User/io.gitgud.wackyideas.seventasks/contents/ui/main.qml index 29880e9..0cc5a46 100755 --- a/Plasma/Plasma_Widgets/User/io.gitgud.wackyideas.seventasks/contents/ui/main.qml +++ b/Plasma/Plasma_Widgets/User/io.gitgud.wackyideas.seventasks/contents/ui/main.qml @@ -64,24 +64,6 @@ MouseArea { signal activateWindowView(variant winIds) signal presentWindows(variant winIds) - states: State { - // When showing labels is toggled on/off, a weird bug happens where - // tasks switch up their dominant colors due to sudden reordering. - name: "iconsOnlyChanged"; when: iconsOnly - StateChangeScript { - script: taskList.updateHoverFunc(); - } - StateChangeScript { - script: LayoutManager.layout(taskRepeater); - } - PropertyChanges { - target: taskList; firstTimeHover: false // Prevents weird tooltip-related bugs from happening. - } - PropertyChanges { - target: tasks; needLayoutRefresh: true - } - - } onWidthChanged: { taskList.width = LayoutManager.layoutWidth(); @@ -389,6 +371,12 @@ MouseArea { Connections { target: plasmoid.configuration + function onLabelVisibleChanged() { + taskList.updateHoverFunc(); + LayoutManager.layout(taskRepeater); + taskList.firstTimeHover = false; + tasks.needsLayoutRefresh = true; + } function onLaunchersChanged() { tasksModel.launcherList = plasmoid.configuration.launchers } diff --git a/Plasma/Plasma_Widgets/User/seventasks_src/src/package/contents/ui/main.qml b/Plasma/Plasma_Widgets/User/seventasks_src/src/package/contents/ui/main.qml index 29880e9..0cc5a46 100755 --- a/Plasma/Plasma_Widgets/User/seventasks_src/src/package/contents/ui/main.qml +++ b/Plasma/Plasma_Widgets/User/seventasks_src/src/package/contents/ui/main.qml @@ -64,24 +64,6 @@ MouseArea { signal activateWindowView(variant winIds) signal presentWindows(variant winIds) - states: State { - // When showing labels is toggled on/off, a weird bug happens where - // tasks switch up their dominant colors due to sudden reordering. - name: "iconsOnlyChanged"; when: iconsOnly - StateChangeScript { - script: taskList.updateHoverFunc(); - } - StateChangeScript { - script: LayoutManager.layout(taskRepeater); - } - PropertyChanges { - target: taskList; firstTimeHover: false // Prevents weird tooltip-related bugs from happening. - } - PropertyChanges { - target: tasks; needLayoutRefresh: true - } - - } onWidthChanged: { taskList.width = LayoutManager.layoutWidth(); @@ -389,6 +371,12 @@ MouseArea { Connections { target: plasmoid.configuration + function onLabelVisibleChanged() { + taskList.updateHoverFunc(); + LayoutManager.layout(taskRepeater); + taskList.firstTimeHover = false; + tasks.needsLayoutRefresh = true; + } function onLaunchersChanged() { tasksModel.launcherList = plasmoid.configuration.launchers }