X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fgtkmm2ext%2Fardour_icon.cc;h=6a7cabe82934e1665fed1d8c2dd2cf8ad4706f66;hb=6a622d86dca2c8af8993d85be8bd8a44debc5b8c;hp=bed6c0ac92bc745f183a01fb34525eac86005b1e;hpb=45313f329f37448527ac83605686d157602941e2;p=ardour.git diff --git a/libs/gtkmm2ext/ardour_icon.cc b/libs/gtkmm2ext/ardour_icon.cc index bed6c0ac92..6a7cabe829 100644 --- a/libs/gtkmm2ext/ardour_icon.cc +++ b/libs/gtkmm2ext/ardour_icon.cc @@ -141,17 +141,19 @@ static void icon_tool_range (cairo_t *cr, const int width, const int height) const double lw = rint (wh / 6.0); // line width const double ar = wh * .6; // arrow - const double bw = rint (wh); + const double bw = ceil (wh) - .5; const double y0 = ceil (y); const double ym = rint (y0 - wh * .1) + .5; // arrow-horizontal; slightly to the top, on a px - const double x0 = rint(x - wh); // left arrow tip - const double x1 = rint(x + wh); // right arrow tip + const double x0 = rint (x) - bw; // left arrow tip + const double x1 = rint (x) + bw; // right arrow tip // left and right box - cairo_rectangle (cr, x0 - lw, y0 - bw, 2 * lw, 2 * bw); - VECTORICONSTROKEFILL(1.0); - cairo_rectangle (cr, x1 - lw, y0 - bw, 2 * lw, 2 * bw); - VECTORICONSTROKEFILL(1.0); + cairo_move_to (cr, x0, y0 - bw); + cairo_line_to (cr, x0, y0 + bw); + VECTORICONSTROKEOUTLINE(lw, 0xffffffff); + cairo_move_to (cr, x1, y0 - bw); + cairo_line_to (cr, x1, y0 + bw); + VECTORICONSTROKEOUTLINE(lw, 0xffffffff); // arrows cairo_move_to (cr, x0 + ar, ym - ar); @@ -168,10 +170,17 @@ static void icon_tool_range (cairo_t *cr, const int width, const int height) VECTORICONSTROKEOUTLINE(lw, 0xffffffff); cairo_set_source_rgba (cr, 1, 1, 1, 1.0); - cairo_rectangle (cr, x0 - lw, y0 - wh, 2 * lw, 2 * wh); - cairo_fill (cr); - cairo_rectangle (cr, x1 - lw, y0 - wh, 2 * lw, 2 * wh); - cairo_fill (cr); + cairo_set_line_width (cr, lw); + + cairo_move_to (cr, x0, y0 - bw); + cairo_line_to (cr, x0, y0 + bw); + cairo_stroke (cr); + + cairo_move_to (cr, x1, y0 - bw); + cairo_line_to (cr, x1, y0 + bw); + cairo_stroke (cr); + + } /** Grab/Object tool - 6x8em "hand", with 'em' wide index finger. */ @@ -513,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); @@ -534,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); @@ -571,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 @@ -840,7 +863,7 @@ static void icon_close_cross (cairo_t *cr, const int width, const int height, co const double y = height * .5; const double o = .5 + std::min (x, y) * .4; ardour_icon_set_source_rgba (cr, fg_color); - cairo_set_line_width (cr, 1); + cairo_set_line_width (cr, 1.0); cairo_move_to (cr, x-o, y-o); cairo_line_to (cr, x+o, y+o); cairo_move_to (cr, x+o, y-o); @@ -889,15 +912,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); @@ -968,7 +991,9 @@ Gtkmm2ext::ArdourIcon::render (cairo_t *cr, bool rv = true; cairo_save (cr); - assert (width > 5 && height > 5); + if (width < 6 || height < 6) { + return false; + } switch (icon) { case TransportStop: