mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Canvas: some tidying in layout test app
This commit is contained in:
parent
240cb7b98f
commit
811a893583
1 changed files with 5 additions and 16 deletions
|
|
@ -57,7 +57,6 @@ main (int argc, char* argv[])
|
||||||
|
|
||||||
//#define FULL_PACKER
|
//#define FULL_PACKER
|
||||||
#define CBOX_PACKER
|
#define CBOX_PACKER
|
||||||
//#define BOX_PACKER
|
|
||||||
|
|
||||||
#ifdef FULL_PACKER
|
#ifdef FULL_PACKER
|
||||||
ConstraintPacker* packer = new ConstraintPacker (c->root());
|
ConstraintPacker* packer = new ConstraintPacker (c->root());
|
||||||
|
|
@ -139,8 +138,6 @@ main (int argc, char* argv[])
|
||||||
ci = vbox->pack_start (circle, PackOptions (PackExpand|PackFill));
|
ci = vbox->pack_start (circle, PackOptions (PackExpand|PackFill));
|
||||||
ci->add_constraint (ci->height() == 0.5 * hb1->height());
|
ci->add_constraint (ci->height() == 0.5 * hb1->height());
|
||||||
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
cBox* hbox2 = new cBox (c, Horizontal);
|
cBox* hbox2 = new cBox (c, Horizontal);
|
||||||
hbox2->name = "hbox2";
|
hbox2->name = "hbox2";
|
||||||
hbox2->set_fill (true);
|
hbox2->set_fill (true);
|
||||||
|
|
@ -148,28 +145,20 @@ main (int argc, char* argv[])
|
||||||
|
|
||||||
Text* txt = new Text (c);
|
Text* txt = new Text (c);
|
||||||
txt->name = "text";
|
txt->name = "text";
|
||||||
|
|
||||||
Pango::FontDescription font ("Sans");
|
Pango::FontDescription font ("Sans");
|
||||||
|
|
||||||
txt->set_font_description (font);
|
txt->set_font_description (font);
|
||||||
txt->set ("hello, world");
|
txt->set ("hello, world");
|
||||||
|
|
||||||
BoxConstrainedItem* ti = hbox2->pack_start (txt, PackExpand);
|
ConstrainedItem* ti = hbox2->pack_start (txt, PackExpand);
|
||||||
BoxConstrainedItem* hb2 = vbox->pack_start (hbox2, PackOptions (PackExpand|PackFill));
|
ti->add_constraint (ti->left() == 25);
|
||||||
|
|
||||||
// c1 == first hbox
|
vbox->pack_start (hbox2, PackOptions (PackExpand|PackFill));
|
||||||
// ci = circle
|
|
||||||
// hb2 == second hbox
|
|
||||||
// ti == text inside second hbox
|
|
||||||
|
|
||||||
//ti->add_constraint (ti->center_x() == hb2->center_x());
|
|
||||||
|
|
||||||
cerr << "hbox1 f = " << hbox1->fill() << " o " << hbox1->outline() << endl;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
win.show_all ();
|
win.show_all ();
|
||||||
|
|
||||||
// cerr << "\n\n\n text center @ " << c3->center_x().value() << " hbox center @ " << c1->center_x().value() << endl;
|
|
||||||
|
|
||||||
app.run ();
|
app.run ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue