summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-12-20 18:46:43 +0100
committerRobin Gareus <robin@gareus.org>2016-12-20 18:48:10 +0100
commit377b357afb3dbc2dff638ffa814cc0ffc12c68b4 (patch)
tree9834a7406dbe55a4a3c7f7c57d205ab66bc82b67 /libs
parentbf75770939283e3bdaedb48d181c44143bb9b1a6 (diff)
Add Zoom/Expand icon
Diffstat (limited to 'libs')
-rw-r--r--libs/gtkmm2ext/ardour_icon.cc39
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/ardour_icon.h1
2 files changed, 40 insertions, 0 deletions
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,