From c2ed1bb0029fea482e8456ed4bdc09e3d979c685 Mon Sep 17 00:00:00 2001 From: nuttyartist Date: Thu, 24 Aug 2023 15:11:43 +0300 Subject: [PATCH] Make confetti optional in Kanban --- src/qml/TodoColumnDelegate.qml | 2 +- src/qml/kanbanMain.qml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/qml/TodoColumnDelegate.qml b/src/qml/TodoColumnDelegate.qml index b133b5fd..91245e50 100644 --- a/src/qml/TodoColumnDelegate.qml +++ b/src/qml/TodoColumnDelegate.qml @@ -44,7 +44,7 @@ MouseArea { pressAndHoldInterval: 200 function checkTasksForConfetti () { - if (numberOfCompletedTasks === tasksView.model.items.count) { + if (rootContainer.enableConfetti && numberOfCompletedTasks === tasksView.model.items.count) { rootContainer.showConfetti1 = true; rootContainer.emitConfetti = true; } diff --git a/src/qml/kanbanMain.qml b/src/qml/kanbanMain.qml index 9fa2cd8f..f587164c 100644 --- a/src/qml/kanbanMain.qml +++ b/src/qml/kanbanMain.qml @@ -38,6 +38,7 @@ Item { property bool alignKanbanToMiddleOfRoot: false property bool isMultipleNotesSelected: false property bool isProVersion: false + property bool enableConfetti: false property real parentWindowHeight property real parentWindowWidth @@ -706,6 +707,25 @@ Item { } } } + + Row { + OptionItemButton { + contentWidth: settingsPopup.rowWidth + displayText: qsTr("Enable Confetti") + displayFontFamily: root.bodyFontFamily + platform: root.platform + themeData: root.themeData + checked: root.enableConfetti + + onSwitched: { + root.enableConfetti = !root.enableConfetti; + } + + onUnswitched: { + root.enableConfetti = !root.enableConfetti; + } + } + } } }