summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-07-24 15:26:40 +0200
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-08 15:24:49 -0400
commit89e1fbff88eda4842e3758befb66bbcdd9ab489a (patch)
treebb129a03c86a899c77b13a11154986217e854cc9 /gtk2_ardour
parente7cef1629a2154fbde09c91e65455c7650a1c949 (diff)
increase meterbridge with if scrollbar is not visible..
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/meterbridge.cc16
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;