diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index c29f4568ce..95419179df 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -352,6 +352,18 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *) cairo_set_line_width(cr, 1); cairo_stroke(cr); } + else if (_elements & CloseCross) { + const double x = get_width() * .5; + const double y = get_height() * .5; + const double o = std::min(x, y) * .4; + ArdourCanvas::set_source_rgba (cr, text_color); + cairo_set_line_width(cr, 1); + cairo_move_to(cr, x-o, y-o); + cairo_line_to(cr, x+o, y+o); + cairo_move_to(cr, x+o, y-o); + cairo_line_to(cr, x-o, y+o); + cairo_stroke(cr); + } int text_margin; if (get_width() < 75 || (_elements & Menu) ) { @@ -596,7 +608,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req) req->width += _diameter + 4; } - if ((_elements & RecButton) && !_pixbuf) { + if ((_elements & (RecButton | CloseCross)) && !_pixbuf) { assert(!(_elements & Text)); req->width += std::max(char_pixel_width(), char_pixel_height()); req->height += std::max(char_pixel_width(), char_pixel_height()); diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index 53869c89bc..ce29cd27b5 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -42,6 +42,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable Inactive = 0x40, // no _action is defined AND state is not used RecButton = 0x80, // tentative, see commit message RecTapeMode = 0x100, // tentative + CloseCross = 0x200, // tentative }; static Element default_elements;