diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-12 12:26:23 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-12 12:26:23 +0100 |
commit | 421d4aae2e44baa73c03e5b5201583143fd38215 (patch) | |
tree | 6e7a874026f3d78119cf5277ef3611830fb3c74b /gtk2_ardour/ardour_button.cc | |
parent | 8496b85aceb81fac5e780bc53527c832138ba241 (diff) |
further ardourbutton ellipsis fixes
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 320a4305f7..fcc9f1088e 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -1094,8 +1094,11 @@ ArdourButton::set_layout_ellipsize_width (int w) if (!_layout) { return; } - if (_layout_ellipsize_width > 0) { - _layout->set_width (_layout_ellipsize_width); + if (_layout_ellipsize_width > 3 * PANGO_SCALE) { + _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); + } + if (is_realized ()) { + queue_resize (); } } @@ -1110,8 +1113,8 @@ ArdourButton::set_text_ellipsize (Pango::EllipsizeMode e) return; } _layout->set_ellipsize(_ellipsis); - if (_layout_ellipsize_width > 0) { - _layout->set_width (_layout_ellipsize_width); + if (_layout_ellipsize_width > 3 * PANGO_SCALE) { + _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); } if (is_realized ()) { queue_resize (); @@ -1125,8 +1128,8 @@ ArdourButton::ensure_layout () ensure_style (); _layout = Pango::Layout::create (get_pango_context()); _layout->set_ellipsize(_ellipsis); - if (_layout_ellipsize_width > 0) { - _layout->set_width (_layout_ellipsize_width); + if (_layout_ellipsize_width > 3 * PANGO_SCALE) { + _layout->set_width (_layout_ellipsize_width - 3* PANGO_SCALE); } } } |