X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhslider.cpp;h=1575072fe782cc16689ac2009e33a94f86b4846c;hb=3db68f2604b657e79f1b2b317c19c41c2d5a985b;hp=e9db05f16cf950860cccd69002e82356c79c71dd;hpb=30780ba31be92c977a68a2a9103eeba87747d530;p=libs%2Fgltk.git diff --git a/source/hslider.cpp b/source/hslider.cpp index e9db05f..1575072 100644 --- a/source/hslider.cpp +++ b/source/hslider.cpp @@ -23,10 +23,14 @@ HSlider::HSlider(const Resources &r): void HSlider::button_press(int x, int y, unsigned btn) { - if(geom.is_inside_relative(x, y) && max>min) + if(btn==1 && geom.is_inside_relative(x, y) && max>min) { int sx=static_cast((geom.w-slider_size)*(value-min)/(max-min)); - if(btn==1 && x>=sx && x(sx+slider_size)) + if(x=static_cast(sx+slider_size)) + set_value(value+step*10); + else start_drag(x); } }