X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbutton.cpp;h=f6cf56c1f07ecbd8b0fa41a7b49e13d269b50156;hb=3db68f2604b657e79f1b2b317c19c41c2d5a985b;hp=20e0ed9241d616a36c2a1f154358931f8d92acf3;hpb=30780ba31be92c977a68a2a9103eeba87747d530;p=libs%2Fgltk.git diff --git a/source/button.cpp b/source/button.cpp index 20e0ed9..f6cf56c 100644 --- a/source/button.cpp +++ b/source/button.cpp @@ -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