]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/toggle.cpp
Cache widget parts in meshes
[libs/gltk.git] / source / toggle.cpp
index f2cf55202183f44d42cf132bb2d9746a165b096f..789ae37ecfec59fdd5987b9739fa0818dc98f8d9 100644 (file)
@@ -30,12 +30,15 @@ void Toggle::autosize()
                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();
 }
 
 void Toggle::set_text(const string &t)
 {
        text = t;
        signal_autosize_changed.emit();
+       rebuild();
 }
 
 void Toggle::set_exclusive(bool e)
@@ -67,10 +70,10 @@ void Toggle::set_value(bool v)
                clear_state(ACTIVE);
 }
 
-void Toggle::render_special(const Part &part) const
+void Toggle::rebuild_special(const Part &part, CachedPart &cache)
 {
        if(part.get_name()=="text")
-               text.render(part, geom);
+               text.build(part, geom, cache);
 }
 
 void Toggle::button_press(int, int, unsigned btn)