diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-20 18:47:24 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-20 18:48:10 +0100 |
commit | b9e8b5940ba0505d35fceb93e4a09daba1c94ee7 (patch) | |
tree | 5c6a873be5b01740209a7173b3fc1eddbb7100e2 /gtk2_ardour/ardour_button.cc | |
parent | 377b357afb3dbc2dff638ffa814cc0ffc12c68b4 (diff) |
Fix Dropdown w/icon size and alignment
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 5ebddc23cc..5522f01bcd 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -193,9 +193,13 @@ ArdourButton::set_text_internal () { void ArdourButton::set_text (const std::string& str, bool markup) { + if (!(_elements & Text)) { + return; + } if (_text == str && _markup == markup) { return; } + _text = str; _markup = markup; if (!is_realized()) { @@ -366,7 +370,12 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *) } else /* VectorIcons are exclusive to Pixbuf Icons */ if (_elements & VectorIcon) { - Gtkmm2ext::ArdourIcon::render (cr, _icon, get_width(), get_height(), active_state(), text_color); + int vw = get_width(); + int vh = get_height(); + if (_elements & Menu) { + vw -= _diameter + 4; + } + Gtkmm2ext::ArdourIcon::render (cr, _icon, vw, vh, active_state(), text_color); } const int text_margin = char_pixel_width(); @@ -1033,6 +1042,7 @@ ArdourButton::setup_led_rect () void ArdourButton::set_image (const RefPtr<Gdk::Pixbuf>& img) { + _elements = (ArdourButton::Element) (_elements & ~ArdourButton::Text); _pixbuf = img; if (is_realized()) { queue_resize (); |