tweak button size request
authorRobin Gareus <robin@gareus.org>
Wed, 3 Sep 2014 20:06:45 +0000 (22:06 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 3 Sep 2014 20:06:45 +0000 (22:06 +0200)
gtk2_ardour/ardour_button.cc

index 21bc34e9646fa0765bbf943c13557246413fabed..c29f4568ce545421ec62a52951d802a9ebe7876d 100644 (file)
@@ -570,7 +570,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
                _text_height = 0;
        }
 
-       if (_pixbuf) {
+       if ((_elements & RecButton) || _pixbuf) {
                xpad = 6;
        }
 
@@ -598,11 +598,12 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
 
        if ((_elements & RecButton) && !_pixbuf) {
                assert(!(_elements & Text));
-               req->width += char_pixel_height();
-               req->height += char_pixel_height();
+               req->width += std::max(char_pixel_width(), char_pixel_height());
+               req->height += std::max(char_pixel_width(), char_pixel_height());
        }
 
        req->width += _corner_radius;
+       req->height += _corner_radius;
 
        if ((_tweaks & Square)==Square) {
                if (req->width < req->height)