]> git.tdb.fi Git - libs/gltk.git/commitdiff
Implement set_size and set_position in terms of set_geometry
authorMikko Rasa <tdb@tdb.fi>
Wed, 29 May 2013 20:20:26 +0000 (23:20 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 29 May 2013 20:20:26 +0000 (23:20 +0300)
source/widget.cpp

index bbd2e8877af608b1255d21eb10d9b23d2506fba4..e73e5cf56ef89630c0b36944792ed7a225018e58 100644 (file)
@@ -30,18 +30,12 @@ Widget::~Widget()
 
 void Widget::set_position(int x, int y)
 {
-       geom.x = x;
-       geom.y = y;
-       on_geometry_change();
-       rebuild();
+       set_geometry(Geometry(x, y, geom.w, geom.h));
 }
 
 void Widget::set_size(unsigned w, unsigned h)
 {
-       geom.w = w;
-       geom.h = h;
-       on_geometry_change();
-       rebuild();
+       set_geometry(Geometry(geom.x, geom.y, w, h));
 }
 
 void Widget::autosize()