From 95ef04e9c7b3b087fbf419fa815d44401bb648f8 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sat, 23 Dec 2023 16:52:27 -0800 Subject: [PATCH] still keep track of mouse/focus state when disabled but no refresh --- widget/slider.go | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/widget/slider.go b/widget/slider.go index 0918be700d..680d8f4c04 100644 --- a/widget/slider.go +++ b/widget/slider.go @@ -154,33 +154,30 @@ func (s *Slider) fireChangeEnded() { // // Since: 2.4 func (s *Slider) FocusGained() { - if s.disabled { - return - } s.focused = true - s.Refresh() + if !s.disabled { + s.Refresh() + } } // FocusLost is called when this item lost the focus. // // Since: 2.4 func (s *Slider) FocusLost() { - if s.disabled { - return - } s.focused = false - s.Refresh() + if !s.disabled { + s.Refresh() + } } // MouseIn is called when a desktop pointer enters the widget. // // Since: 2.4 func (s *Slider) MouseIn(_ *desktop.MouseEvent) { - if s.disabled { - return - } s.hovered = true - s.Refresh() + if !s.disabled { + s.Refresh() + } } // MouseMoved is called when a desktop pointer hovers over the widget. @@ -193,11 +190,10 @@ func (s *Slider) MouseMoved(_ *desktop.MouseEvent) { // // Since: 2.4 func (s *Slider) MouseOut() { - if s.disabled { - return - } s.hovered = false - s.Refresh() + if !s.disabled { + s.Refresh() + } } // TypedKey is called when this item receives a key event.