]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/vslider.cpp
Remove obsolete inside checks
[libs/gltk.git] / source / vslider.cpp
index 6a21c5301ad6eb45a51d2ff201ababb271a02f21..e4c40d8123385ed283c1a1089a1c1346c627d946 100644 (file)
@@ -12,19 +12,14 @@ VSlider::VSlider():
        slider_size(1)
 { }
 
-void VSlider::autosize()
+void VSlider::autosize_special(const Part &part, Geometry &ageom)
 {
-       if(!style)
-               return;
-
-       Widget::autosize();
-
-       if(const Part *slider_part = style->get_part("slider"))
+       if(part.get_name()=="slider")
        {
-               const Sides &margin = slider_part->get_margin();
-               const Geometry &pgeom = slider_part->get_geometry();
-               geom.w = std::max(geom.w, pgeom.w+margin.left+margin.right);
-               geom.h = std::max(geom.h, pgeom.h*3/2+margin.top+margin.bottom);
+               const Sides &margin = part.get_margin();
+               const Geometry &pgeom = part.get_geometry();
+               ageom.w = std::max(ageom.w, pgeom.w+margin.left+margin.right);
+               ageom.h = std::max(ageom.h, pgeom.h*3/2+margin.top+margin.bottom);
        }
 }
 
@@ -49,9 +44,9 @@ void VSlider::rebuild_special(const Part &part)
        }
 }
 
-void VSlider::button_press(int x, int y, unsigned btn)
+void VSlider::button_press(int, int y, unsigned btn)
 {
-       if(btn==1 && geom.is_inside_relative(x, y) && max>min)
+       if(btn==1 && max>min)
        {
                int sy = static_cast<int>((geom.h-slider_size)*(value-min)/(max-min));
                if(y<sy)