summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-05 19:51:58 +0200
committerRobin Gareus <robin@gareus.org>2015-08-05 19:53:33 +0200
commit7aeead630aa9e293a0115ae448388acc3eeb87a8 (patch)
tree3bd2e0b4cf600bd8d98abec40d7ab96a2ae90233
parent8a8b5db2c333f9aba03369d1ad8df3e9245824d2 (diff)
adjust click box size - fixes #6499
-rw-r--r--libs/gtkmm2ext/click_box.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/click_box.cc b/libs/gtkmm2ext/click_box.cc
index 383fa6e583..7b2e67d8ab 100644
--- a/libs/gtkmm2ext/click_box.cc
+++ b/libs/gtkmm2ext/click_box.cc
@@ -88,6 +88,7 @@ void
ClickBox::set_label ()
{
char buf[32];
+ int width, height;
bool const h = _printer (buf, get_adjustment());
if (!h) {
@@ -96,7 +97,17 @@ ClickBox::set_label ()
}
layout->set_text (buf);
- layout->get_pixel_size (twidth, theight);
+ layout->get_pixel_size (width, height);
+
+ if (twidth < width && (width > 50)) {
+ /* override GenericPluginUI::build_control_ui()
+ * Gtkmm2ext::set_size_request_to_display_given_text ("g9999999")
+ * see http://tracker.ardour.org/view.php?id=6499
+ */
+ set_size_request (std::min (300, width + 6), height + 4);
+ }
+
+ twidth = width; theight = height;
queue_draw ();
}