X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fimage.cpp;h=5dcb2e3f5b84b8e727a98b3aa6180c3642b35a24;hb=707b59d45ae50b69c94918f8f74313283b304597;hp=2735ab611e6a059e73faccae8aa079a0c47e8876;hpb=319cde3c06181ba1c3619567525002926d8b4889;p=libs%2Fgltk.git diff --git a/source/image.cpp b/source/image.cpp index 2735ab6..5dcb2e3 100644 --- a/source/image.cpp +++ b/source/image.cpp @@ -15,29 +15,22 @@ Image::Image(const GL::Texture2D *i): focusable = false; } -void Image::autosize() +void Image::autosize_special(const Part &part, Geometry &ageom) const { - if(!style) - return; - - Widget::autosize(); - - if(const Part *image_part = style->get_part("image")) + if(part.get_name()=="image") { - const Sides &margin = image_part->get_margin(); + const Sides &margin = part.get_margin(); if(image) { - geom.w = max(geom.w, image->get_width()+margin.left+margin.right); - geom.h = max(geom.h, image->get_height()+margin.top+margin.bottom); + ageom.w = max(ageom.w, image->get_width()+margin.left+margin.right); + ageom.h = max(ageom.h, image->get_height()+margin.top+margin.bottom); } else { - geom.w = max(geom.w, margin.left+margin.right); - geom.h = max(geom.h, margin.top+margin.bottom); + ageom.w = max(ageom.w, margin.left+margin.right); + ageom.h = max(ageom.h, margin.top+margin.bottom); } } - - rebuild(); } void Image::set_image(const GL::Texture2D *i)