mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 20:26:30 +01:00
add vector rendition of nudge icons.
This commit is contained in:
parent
ff5b1b0c99
commit
c5d7685741
2 changed files with 43 additions and 0 deletions
|
|
@ -218,6 +218,15 @@ render_vector_icon (cairo_t *cr,
|
||||||
cairo_set_source_rgba (cr, 1, 1, 1, (fillalpha)); \
|
cairo_set_source_rgba (cr, 1, 1, 1, (fillalpha)); \
|
||||||
cairo_fill(cr);
|
cairo_fill(cr);
|
||||||
|
|
||||||
|
#define VECTORICONSTROKEOUTLINE() \
|
||||||
|
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); \
|
||||||
|
cairo_set_line_width(cr, 3.0); \
|
||||||
|
cairo_set_source_rgba (cr, 0, 0, 0, 1.0); \
|
||||||
|
cairo_stroke_preserve(cr); \
|
||||||
|
ArdourCanvas::set_source_rgba (cr, fg_color); \
|
||||||
|
cairo_set_line_width(cr, 1.5); \
|
||||||
|
cairo_stroke(cr);
|
||||||
|
|
||||||
|
|
||||||
/* TODO separate these into dedicated class
|
/* TODO separate these into dedicated class
|
||||||
* it may also be efficient to render them only once for every size (image-surface) */
|
* it may also be efficient to render them only once for every size (image-surface) */
|
||||||
|
|
@ -544,6 +553,38 @@ render_vector_icon (cairo_t *cr,
|
||||||
cairo_fill(cr);
|
cairo_fill(cr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ArdourButton::NudgeLeft:
|
||||||
|
{
|
||||||
|
const double x = width * .5;
|
||||||
|
const double y = height * .5;
|
||||||
|
const double wh = std::min (x, y);
|
||||||
|
|
||||||
|
const double tri_x = .3 * wh;
|
||||||
|
const double tri_y = .6 * wh;
|
||||||
|
|
||||||
|
cairo_move_to (cr, x + tri_x, y - tri_y);
|
||||||
|
cairo_line_to (cr, x - tri_x, y);
|
||||||
|
cairo_line_to (cr, x + tri_x, y + tri_y);
|
||||||
|
VECTORICONSTROKEOUTLINE();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ArdourButton::NudgeRight:
|
||||||
|
{
|
||||||
|
|
||||||
|
const double x = width * .5;
|
||||||
|
const double y = height * .5;
|
||||||
|
const double wh = std::min (x, y);
|
||||||
|
|
||||||
|
const double tri_x = .3 * wh;
|
||||||
|
const double tri_y = .6 * wh;
|
||||||
|
|
||||||
|
cairo_move_to (cr, x - tri_x, y - tri_y);
|
||||||
|
cairo_line_to (cr, x + tri_x, y);
|
||||||
|
cairo_line_to (cr, x - tri_x, y + tri_y);
|
||||||
|
VECTORICONSTROKEOUTLINE();
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// missing icon
|
// missing icon
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
|
||||||
TransportEnd,
|
TransportEnd,
|
||||||
TransportPanic,
|
TransportPanic,
|
||||||
TransportMetronom,
|
TransportMetronom,
|
||||||
|
NudgeLeft,
|
||||||
|
NudgeRight,
|
||||||
};
|
};
|
||||||
|
|
||||||
static Element default_elements;
|
static Element default_elements;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue