ArdourButton::Element ArdourButton::just_led_default_elements = ArdourButton::Element (ArdourButton::Edge|ArdourButton::Body|ArdourButton::Indicator);
ArdourButton::ArdourButton (Element e)
- : _elements (e)
+ : _sizing_text("")
+ , _elements (e)
, _icon (Gtkmm2ext::ArdourIcon::NoIcon)
, _tweaks (Tweaks (0))
, _char_pixel_width (0)
, _ellipsis (Pango::ELLIPSIZE_NONE)
, _update_colors (true)
, _pattern_height (0)
- , _sizing_text("")
{
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
/* This is not provided by gtkmm */
}
ArdourButton::ArdourButton (const std::string& str, Element e)
- : _elements (e)
+ : _sizing_text("")
+ , _elements (e)
, _tweaks (Tweaks (0))
, _char_pixel_width (0)
, _char_pixel_height (0)
, _ellipsis (Pango::ELLIPSIZE_NONE)
, _update_colors (true)
, _pattern_height (0)
- , _sizing_text("")
{
set_text (str);
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
req->width = req->height;
if (req->height < req->width)
req->height = req->width;
- } else if (_text_width > 0 && !(_elements & (Menu | Indicator))) {
+ } else if (_sizing_text.empty() && _text_width > 0 && !(_elements & (Menu | Indicator))) {
// properly centered text for those elements that are centered
// (no sub-pixel offset)
if ((req->width - _text_width) & 1) { ++req->width; }
{
_update_colors = true;
CairoWidget::set_dirty ();
+ _char_pixel_width = 0;
+ _char_pixel_height = 0;
+ if (is_realized()) {
+ queue_resize ();
+ }
}
void