]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/button.cpp
Jump 10 steps when slider trough is clicked
[libs/gltk.git] / source / button.cpp
index 20e0ed9241d616a36c2a1f154358931f8d92acf3..f6cf56c1f07ecbd8b0fa41a7b49e13d269b50156 100644 (file)
@@ -45,10 +45,15 @@ void Button::button_release(int x, int y, unsigned btn)
        }
 }
 
-void Button::pointer_leave()
+void Button::pointer_motion(int x, int y)
 {
-       Widget::pointer_leave();
-       state&=~ACTIVE;
+       if(pressed)
+       {
+               if(!geom.is_inside_relative(x, y))
+                       state&=~ACTIVE;
+               else
+                       state|=ACTIVE;
+       }
 }
 
 void Button::render_special(const Part &part) const