From 377b357afb3dbc2dff638ffa814cc0ffc12c68b4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 20 Dec 2016 18:46:43 +0100 Subject: Add Zoom/Expand icon --- libs/gtkmm2ext/ardour_icon.cc | 39 ++++++++++++++++++++++++++++++++++ libs/gtkmm2ext/gtkmm2ext/ardour_icon.h | 1 + 2 files changed, 40 insertions(+) (limited to 'libs') diff --git a/libs/gtkmm2ext/ardour_icon.cc b/libs/gtkmm2ext/ardour_icon.cc index 5e89e3bd6f..e46ee6a2b4 100644 --- a/libs/gtkmm2ext/ardour_icon.cc +++ b/libs/gtkmm2ext/ardour_icon.cc @@ -851,6 +851,42 @@ static void icon_zoom (cairo_t *cr, const enum Gtkmm2ext::ArdourIcon::Icon icon, } } +/** Toolbar icon - Mixbus Zoom Expand, rotated TimeAxisExpand */ +static void icon_zoom_expand (cairo_t *cr, const int width, const int height) +{ + const double x = width * .5; + const double y = height * .5; + const double wh = std::min (x, y) * .66; + const double ar = std::min (x, y) * .15; + const double tri = .7 * (wh - ar); + + cairo_rectangle (cr, x - wh, y - wh, 2 * wh, 2 * wh); + VECTORICONSTROKEFILL(.75); + + cairo_set_line_width (cr, 1.0); + + cairo_move_to (cr, x - wh + 0.5, y); + cairo_line_to (cr, x - ar - 0.5, y - tri); + cairo_line_to (cr, x - ar - 0.5, y + tri); + cairo_close_path (cr); + + cairo_set_source_rgba (cr, 1, 1, 1, .5); + cairo_stroke_preserve (cr); + cairo_set_source_rgba (cr, 0, 0, 0, 1.0); + cairo_fill (cr); + + cairo_move_to (cr, x + wh - 0.5, y); + cairo_line_to (cr, x + ar + 0.5, y - tri); + cairo_line_to (cr, x + ar + 0.5, y + tri); + cairo_close_path (cr); + + cairo_set_source_rgba (cr, 1, 1, 1, .5); + cairo_stroke_preserve (cr); + cairo_set_source_rgba (cr, 0, 0, 0, 1.0); + cairo_fill (cr); +} + + /***************************************************************************** * Misc buttons @@ -1042,6 +1078,9 @@ Gtkmm2ext::ArdourIcon::render (cairo_t *cr, case ZoomFull: icon_zoom (cr, icon, width, height, fg_color); break; + case ZoomExpand: + icon_zoom_expand (cr, width, height); + break; case TimeAxisShrink: icon_tav_shrink (cr, width, height); break; diff --git a/libs/gtkmm2ext/gtkmm2ext/ardour_icon.h b/libs/gtkmm2ext/gtkmm2ext/ardour_icon.h index df2fbbe9dc..255097d79a 100644 --- a/libs/gtkmm2ext/gtkmm2ext/ardour_icon.h +++ b/libs/gtkmm2ext/gtkmm2ext/ardour_icon.h @@ -26,6 +26,7 @@ namespace Gtkmm2ext { namespace ArdourIcon { ZoomIn, ZoomOut, ZoomFull, + ZoomExpand, TimeAxisShrink, TimeAxisExpand, ToolGrab, -- cgit v1.2.3