From 9dc301eed8b0ce10601bd62bd539ee8297423613 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sat, 9 Jan 2021 17:07:10 +0100 Subject: [PATCH] Fixed two issues with slider. Value was always set back to original value. Events were always handled by slider (handle). --- ui/slider.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/slider.go b/ui/slider.go index 89973d4..1c9c66f 100644 --- a/ui/slider.go +++ b/ui/slider.go @@ -110,7 +110,6 @@ func (s *Slider) DesiredSize(ctx Context, _ geom.PointF32) geom.PointF32 { } func (s *Slider) Handle(ctx Context, e Event) bool { - defer s.setValue(s.Value) if s.handle.Handle(ctx, e) { return true } @@ -166,11 +165,11 @@ func (h *sliderHandle) Handle(ctx Context, e Event) bool { h.ControlBase.Handle(ctx, e) if h.IsOver() { if h.Disabled { - return true + return false } ctx.Renderer().SetMouseCursor(MouseCursorPointer) } - return true + return false } func (h *sliderHandle) Render(ctx Context) {