summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-03 22:07:25 +0200
committerRobin Gareus <robin@gareus.org>2014-09-03 22:07:25 +0200
commita99bd28950d92c555927773d82e20c6dfe015b34 (patch)
tree8bf9fe8f59539bbe0eafefef15a8dfdcf2bbfdd1 /gtk2_ardour/ardour_button.cc
parenta2a399d6f9d013fba9afe36dcca88183237b3402 (diff)
add "close/cross" special button
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc14
1 files changed, 13 insertions, 1 deletions
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());