The new class 'Gtkmm2ext::EventBoxExt' needs to be exportable when building with...
[ardour.git] / libs / gtkmm2ext / ardour_icon.cc
index fce6ab6db0c666f7bcf9e8cfe5ba2da36c8da521..e46ee6a2b4512cf60349205deaafd7388041d748 100644 (file)
@@ -640,8 +640,8 @@ static void icon_transport_play (cairo_t *cr, const int width, const int height)
 /** Midi Panic "!" */
 static void icon_transport_panic (cairo_t *cr, const int width, const int height)
 {
-       const int wh = std::min (width, height) * .1;
-       const double xc = width * .5;
+       const int wh = ceil (std::min (width, height) * .1) - .5;
+       const double xc = rint (width * .5);
        const double yh = height;
        cairo_rectangle (cr,
                         xc - wh, yh *.19,
@@ -730,8 +730,8 @@ static void icon_transport_metronom (cairo_t *cr, const int width, const int hei
 {
        const double x  = width * .5;
        const double y  = height * .5;
-       const double wh = std::min (x, y);
-       const double h  = wh * .85;
+       const double wh = .95 * std::min (x, y);
+       const double h  = wh * .80;
        const double w  = wh * .55;
        const double lw = w  * .34;
 
@@ -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
@@ -912,15 +948,15 @@ static void icon_strip_width (cairo_t *cr, const int width, const int height, co
        const double x1 = width   * .8;
 
        const double y0 = height  * .25;
-       const double y1= height   * .75;
+       const double y1 = height  * .75;
 
-       const double ym= height   * .5;
+       const double ym = height  * .5;
 
        // arrow
-       const double xa0= height  * .39;
-       const double xa1= height  * .61;
-       const double ya0= height  * .35;
-       const double ya1= height  * .65;
+       const double xa0= width  * .39;
+       const double xa1= width  * .61;
+       const double ya0= height * .35;
+       const double ya1= height * .65;
 
        ardour_icon_set_source_rgba (cr, fg_color);
        cairo_set_line_width (cr, 1);
@@ -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;