The new class 'Gtkmm2ext::EventBoxExt' needs to be exportable when building with...
[ardour.git] / libs / gtkmm2ext / ardour_icon.cc
index b99aa32de1e5c05db5b1e45e7275bf202fc1a807..e46ee6a2b4512cf60349205deaafd7388041d748 100644 (file)
@@ -522,10 +522,15 @@ static void icon_rec_enable (cairo_t *cr, const int width, const int height, con
        const double y = height * .5;
        const double r = std::min (x, y) * .55;
        cairo_arc (cr, x, y, r, 0, 2 * M_PI);
-       if (state == Gtkmm2ext::ExplicitActive)
-               cairo_set_source_rgba (cr, 0.95, 0.10, 0.10, 1.0);
-       else
-               cairo_set_source_rgba (cr, 0.95, 0.44, 0.44, 1.0); // #f46f6f
+       if (state == Gtkmm2ext::ExplicitActive) {
+               cairo_set_source_rgba (cr, 1.0, .1, .1, 1.0);
+       }
+       else if (state == Gtkmm2ext::ImplicitActive) {
+               cairo_set_source_rgba (cr, .9, .3, .3, 1.0);
+       }
+       else {
+               cairo_set_source_rgba (cr, .4, .3, .3, 1.0);
+       }
        cairo_fill_preserve (cr);
        cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.8); // outline
        cairo_set_line_width (cr, 1);
@@ -543,9 +548,13 @@ static void icon_rec_tape (cairo_t *cr, const int width, const int height, const
 
        cairo_arc (cr, 0, 0, r, 0, 2 * M_PI);
        if (state == Gtkmm2ext::ExplicitActive) {
-               cairo_set_source_rgba (cr, .95, .1, .1, 1.);
-       } else {
-               cairo_set_source_rgba (cr, .95, .44, .44, 1.); // #f46f6f
+               cairo_set_source_rgba (cr, 1.0, .1, .1, 1.0);
+       }
+       else if (state == Gtkmm2ext::ImplicitActive) {
+               cairo_set_source_rgba (cr, .9, .3, .3, 1.0);
+       }
+       else {
+               cairo_set_source_rgba (cr, .4, .3, .3, 1.0);
        }
        cairo_fill_preserve (cr);
        cairo_set_source_rgba (cr, .0, .0, .0, .5);
@@ -580,10 +589,15 @@ static void icon_rec_tape (cairo_t *cr, const int width, const int height, const
        cairo_restore (cr);
 
        cairo_arc (cr, 0, 0, r * .3, 0, 2 * M_PI);
-       if (state == Gtkmm2ext::ExplicitActive)
-               cairo_set_source_rgba (cr, .95, .1, .1, 1.);
-       else
-               cairo_set_source_rgba (cr, .95, .44, .44, 1.); // #f46f6f
+       if (state == Gtkmm2ext::ExplicitActive) {
+               cairo_set_source_rgba (cr, 1.0, .1, .1, 1.0);
+       }
+       else if (state == Gtkmm2ext::ImplicitActive) {
+               cairo_set_source_rgba (cr, .9, .3, .3, 1.0);
+       }
+       else {
+               cairo_set_source_rgba (cr, .4, .3, .3, 1.0);
+       }
        cairo_fill (cr);
        cairo_set_source_rgba (cr, .0, .0, .0, 1.0);
        cairo_arc (cr, 0, 0, r *.15, 0, 2 * M_PI); // hole in the middle
@@ -626,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,
@@ -716,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;
 
@@ -837,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
@@ -898,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);
@@ -1028,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;