From 89e1fbff88eda4842e3758befb66bbcdd9ab489a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 24 Jul 2013 15:26:40 +0200 Subject: increase meterbridge with if scrollbar is not visible.. --- gtk2_ardour/meterbridge.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 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; -- cgit v1.2.3