ArdourButton: honor text-ellipsis width for size-request
authorRobin Gareus <robin@gareus.org>
Tue, 30 Jan 2018 15:27:18 +0000 (16:27 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 30 Jan 2018 15:27:18 +0000 (16:27 +0100)
libs/widgets/ardour_button.cc

index d3598794498d0f2b539e9ddd60658e04c0cc5531..7f16c242dd9ecf7adab366d58bda2c5b91395092 100644 (file)
@@ -618,6 +618,11 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
                         * of text.
                         */
 
+               } else if (_layout_ellipsize_width > 0 && _sizing_text.empty()) {
+
+                       req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0));
+                       req->width += _layout_ellipsize_width / PANGO_SCALE;
+
                } else /*if (!_text.empty() || !_sizing_text.empty()) */ {
 
                        req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0));