From fc92544cb3530ecf60aa110339b5e198b25f9301 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 15 Feb 2024 15:08:00 +0200 Subject: [PATCH] plugins/overview: Allow switching between modes using shortcuts while already active Overview and Grid modes have shortcuts assigned to them. While they provide a way to toggle the overview effect between on and off state, in other words overview <-> off or grid <-> off, it's not possible to move between the modes by pressing those shortcuts, e.g. off -> overview -> grid -> overview -> grid -> ... -> off. The culprit seems to be that EffectTogglableState has two "inactive" states - Inactive and Stopped. It's counter-intuitive and needs a further cleanup. To make switching between overview modes work, this change makes EffectTogglableState::toggle() toggle the state based on the Active state. There's only one active state. CCBUG: 481335 --- src/effect/effecttogglablestate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/effect/effecttogglablestate.cpp b/src/effect/effecttogglablestate.cpp index 297233be98..c5086d25a1 100644 --- a/src/effect/effecttogglablestate.cpp +++ b/src/effect/effecttogglablestate.cpp @@ -111,7 +111,7 @@ void EffectTogglableState::partialDeactivate(qreal factor) void EffectTogglableState::toggle() { - if (m_status == Status::Inactive) { + if (m_status != Status::Active) { activate(); Q_EMIT activated(); } else {