+ cairo_restore(cr);
+ }
+ else if (_elements & RecButton) {
+ const double x = get_width() * .5;
+ const double y = get_height() * .5;
+ const double r = std::min(10., std::min(x, y) * .55); // TODO we need a better way to limit max. radius.
+ cairo_arc (cr, x, y, r, 0, 2 * M_PI);
+ if (active_state() == Gtkmm2ext::ExplicitActive)
+ cairo_set_source_rgba (cr, .95, .1, .1, 1.);
+ else
+ cairo_set_source_rgba (cr, .95, .44, .44, 1.); // #f46f6f
+ cairo_fill_preserve(cr);
+ cairo_set_source_rgba (cr, .0, .0, .0, .8);
+ 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 = .5 + 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);
+ }
+
+ const int text_margin = char_pixel_width();
+ // Text, if any
+ if (!_pixbuf && ((_elements & Text)==Text) && !_text.empty()) {
+ assert(_layout);
+#if 0 // DEBUG style (print on hover)
+ if (_hovering || (_elements & Inactive)) {
+ bool layout_font = true;
+ Pango::FontDescription fd = _layout->get_font_description();
+ if (fd.gobj() == NULL) {
+ layout_font = false;
+ fd = get_pango_context()->get_font_description();
+ }
+ printf("%s: f:%dx%d aw:%.3f bh:%.0f t:%dx%d (%dx%d) %s\"%s\"\n",
+ get_name().c_str(),
+ char_pixel_width(), char_pixel_height(), char_avg_pixel_width(),
+ ceil(char_pixel_height() * BASELINESTRETCH),
+ _text_width, _text_height,
+ get_width(), get_height(),
+ layout_font ? "L:" : "W:",
+ fd.to_string().c_str());
+ }
+#endif
+
+ cairo_save (cr);
+ cairo_rectangle (cr, 2, 1, get_width() - 4, get_height() - 2);
+ cairo_clip(cr);
+
+ cairo_new_path (cr);
+ ArdourCanvas::set_source_rgba (cr, text_color);
+ const double text_ypos = (get_height() - _text_height) * .5;
+
+ if (_elements & Menu) {
+ // always left align (dropdown)
+ cairo_move_to (cr, text_margin, text_ypos);
+ pango_cairo_show_layout (cr, _layout->gobj());
+ } else if ( (_elements & Indicator) == Indicator) {
+ // left/right align depending on LED position