From b67a961f8e8a0e8aaaf2cffdd1df538b5eef83ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Mon, 19 Dec 2022 23:20:56 +0100 Subject: [PATCH] PowerControl: Fix `MenuItemWithOptions` `delayTimer` --- PowerControl/Menu/MenuItemWithOptions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PowerControl/Menu/MenuItemWithOptions.cs b/PowerControl/Menu/MenuItemWithOptions.cs index 2818979..84a7d49 100644 --- a/PowerControl/Menu/MenuItemWithOptions.cs +++ b/PowerControl/Menu/MenuItemWithOptions.cs @@ -19,6 +19,14 @@ namespace PowerControl.Menu public MenuItemWithOptions() { this.Selectable = true; + + delayTimer.Tick += delegate (object? sender, EventArgs e) + { + if (delayTimer != null) + delayTimer.Stop(); + + onApply(); + }; } public override void Reset()