mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
one off, special case rec-en button for now. (circle may need tweaking)
In the long run we want a class hierarchy: CairoWidget -> ArdourWidget -> ArdourLabel -> ArdourButton -> SpecialArdourButton(s)
This commit is contained in:
parent
9cd0af6b51
commit
1592d04828
2 changed files with 19 additions and 0 deletions
|
|
@ -290,6 +290,17 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
|
||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // rec-en is exclusive to pixbuf (tape machine mode, rec-en)
|
||||||
|
if ((_elements & RecButton)) {
|
||||||
|
const double x = get_width() * .5;
|
||||||
|
const double y = get_height() * .5;
|
||||||
|
cairo_arc (cr, x, y, get_height () *.2 , 0, 2 * M_PI);
|
||||||
|
cairo_set_source_rgba (cr, .0, .0, .0, 1.);
|
||||||
|
cairo_set_line_width(cr, 1);
|
||||||
|
cairo_stroke_preserve (cr);
|
||||||
|
cairo_set_source_rgba (cr, .95, .44, .44, 1.); // #f46f6f
|
||||||
|
cairo_fill(cr);
|
||||||
|
}
|
||||||
|
|
||||||
int text_margin;
|
int text_margin;
|
||||||
if (get_width() < 75 || (_elements & Menu) ) {
|
if (get_width() < 75 || (_elements & Menu) ) {
|
||||||
|
|
@ -533,6 +544,13 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
|
||||||
if ((_elements & Menu)) {
|
if ((_elements & Menu)) {
|
||||||
req->width += _diameter + 4;
|
req->width += _diameter + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((_elements & RecButton) && !_pixbuf) {
|
||||||
|
assert(!(_elements & Text));
|
||||||
|
req->width += char_pixel_height();
|
||||||
|
req->height += char_pixel_height();
|
||||||
|
}
|
||||||
|
|
||||||
req->width += _corner_radius;
|
req->width += _corner_radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
|
||||||
unused = 0x10,
|
unused = 0x10,
|
||||||
Menu = 0x20,
|
Menu = 0x20,
|
||||||
Inactive = 0x40, // no _action is defined AND state is not used
|
Inactive = 0x40, // no _action is defined AND state is not used
|
||||||
|
RecButton = 0x80, // tenative, see commit message
|
||||||
};
|
};
|
||||||
|
|
||||||
static Element default_elements;
|
static Element default_elements;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue