Skip to content

Commit

Permalink
still keep track of mouse/focus state when disabled but no refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Dec 24, 2023
1 parent 3600f77 commit 95ef04e
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions widget/slider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 95ef04e

Please sign in to comment.