6 Toolbar::Toolbar(const string &name, unsigned w):
12 add(*(lbl_title = new GLtk::Label(name)));
14 add(*(btn_expand = new GLtk::Button));
15 btn_expand->set_size(15, 20);
16 btn_expand->set_style("arrow_left");
17 btn_expand->set_tooltip("Collapse toolbar");
18 btn_expand->signal_clicked.connect(sigc::mem_fun(this, &Toolbar::expand_clicked));
20 add(*(pnl_content = new GLtk::Panel));
21 pnl_content->set_size(content_width, 40);
22 pnl_content->set_style("group");
25 void Toolbar::expand(bool e)
28 btn_expand->set_style(expanded ? "arrow_left" : "arrow_right");
29 btn_expand->set_tooltip(expanded ? "Collapse toolbar" : "Expand toolbar");
30 pnl_content->set_visible(expanded);
32 unsigned w = lbl_title->get_geometry().w+40;
37 signal_expanded.emit(expanded);
40 void Toolbar::expand_clicked()
45 void Toolbar::on_style_change()
47 lbl_title->autosize();
48 const GLtk::Geometry &lbl_geom = lbl_title->get_geometry();
49 unsigned w = lbl_geom.w+40;
54 lbl_title->set_position(10, (geom.h-lbl_geom.h)/2);
55 btn_expand->set_position(lbl_geom.w+15, 10);
56 pnl_content->set_position(lbl_geom.w+35, 0);