diff options
author | Robin Gareus <robin@gareus.org> | 2013-07-24 15:26:40 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-07-24 15:48:03 +0200 |
commit | fd9c0a63fdaf689f60aa9f434a2bd148cb4fec2f (patch) | |
tree | d0e0039942ffd73fc7c0d7407f424abe630f5294 /gtk2_ardour/meterbridge.cc | |
parent | 6f72c8534458dccf1901a95f366280728eee58bd (diff) |
increase meterbridge with if scrollbar is not visible..
Diffstat (limited to 'gtk2_ardour/meterbridge.cc')
-rw-r--r-- | gtk2_ardour/meterbridge.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk2_ardour/meterbridge.cc b/gtk2_ardour/meterbridge.cc index a2bc047bdb..3042ba1d0e 100644 --- a/gtk2_ardour/meterbridge.cc +++ b/gtk2_ardour/meterbridge.cc @@ -338,9 +338,25 @@ Meterbridge::on_size_request (Gtk::Requisition* r) Gdk::Geometry geom; Gtk::Requisition mr = meterarea.size_request(); + geom.max_width = mr.width + metrics_left.get_width() + metrics_right.get_width(); geom.max_height = max_height; + const Gtk::Scrollbar * hsc = scroller.get_hscrollbar(); + Glib::RefPtr<Gdk::Screen> screen = get_screen (); + Gdk::Rectangle monitor_rect; + screen->get_monitor_geometry (0, monitor_rect); + const int scr_w = monitor_rect.get_width() - 44; + + if (cur_max_width < geom.max_width + && cur_max_width < scr_w + && !(scroller.get_hscrollbar_visible() && hsc)) { + int h = r->height; + *r = Gtk::Requisition(); + r->width = geom.max_width; + r->height = h; + } + if (cur_max_width != geom.max_width) { cur_max_width = geom.max_width; geom.height_inc = 16; |