From 8e02b59f83384d8634fac0e6e37bd2371c5fb879 Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 18:24:14 +0100 Subject: [PATCH] clear status label on button exit --- uicomponents.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uicomponents.go b/uicomponents.go index 65e2d6b..6997570 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -281,6 +281,9 @@ func flowBoxButton(entry desktopEntry) *gtk.Button { button.Connect("enter-notify-event", func() { statusLabel.SetText(desc) }) + button.Connect("leave-notify-event", func() { + statusLabel.SetText("") + }) button.Connect("focus-in-event", func() { statusLabel.SetText(desc) }) @@ -317,6 +320,9 @@ func powerButton(iconPath, command string) *gtk.Button { button.Connect("enter-notify-event", func() { statusLabel.SetText(command) }) + button.Connect("leave-notify-event", func() { + statusLabel.SetText("") + }) button.Connect("focus-in-event", func() { statusLabel.SetText(command) })