X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Ftoggle.cpp;h=fe6518dda722b57fc6ffda3c2481d4e42ae63047;hp=451926956d12520de95ff4ba6aff7e9049556249;hb=d2d5b4c4dedf90a42dd2baff8334318b1d000f64;hpb=c8291177b545ec81930603a5915234a60296db51 diff --git a/source/toggle.cpp b/source/toggle.cpp index 4519269..fe6518d 100644 --- a/source/toggle.cpp +++ b/source/toggle.cpp @@ -17,21 +17,10 @@ Toggle::Toggle(const string &t): set_text(t); } -void Toggle::autosize() +void Toggle::autosize_special(const Part &part, Geometry &ageom) { - if(!style) - return; - - Widget::autosize(); - - if(const Part *text_part = style->get_part("text")) - { - const Sides &margin = text_part->get_margin(); - geom.w = max(geom.w, text.get_width()+margin.left+margin.right); - geom.h = max(geom.h, text.get_height()+margin.top+margin.bottom); - } - - rebuild(); + if(part.get_name()=="text") + text.autosize(part, ageom); } void Toggle::set_text(const string &t)