more transport button caironizing.
authorRobin Gareus <robin@gareus.org>
Tue, 7 Apr 2015 21:58:59 +0000 (23:58 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 7 Apr 2015 22:00:23 +0000 (00:00 +0200)
gtk2_ardour/ardour_button.cc
gtk2_ardour/ardour_ui2.cc

index 074bbaa1349dab70afb5e33c0cb8ccf55b2109b9..7ab1304fa5db14228e63a721b713c718db4dc074 100644 (file)
@@ -525,17 +525,50 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
                        VECTORICONSTROKEFILL;
                }
 
-               cairo_move_to (cr,  x + wh, y);
-               cairo_line_to (cr,  x - wh, y - tri);
-               cairo_line_to (cr,  x - wh, y + tri);
+               if (_icon == BtnStart) {
+                       cairo_move_to (cr,  x - wh, y);
+                       cairo_line_to (cr,  x + wh, y - tri);
+                       cairo_line_to (cr,  x + wh, y + tri);
+               } else {
+                       cairo_move_to (cr,  x + wh, y);
+                       cairo_line_to (cr,  x - wh, y - tri);
+                       cairo_line_to (cr,  x - wh, y + tri);
+               }
+
                cairo_close_path (cr);
+               VECTORICONSTROKEFILL;
+       }
+       else if ((_elements & VectorIcon) && _icon == BtnLoop) {
+               const double x = get_width() * .5;
+               const double y = get_height() * .5;
+               const double r = std::min(x, y);
+
+               cairo_arc (cr, x, y, r * .6, 0, 2 * M_PI);
+               cairo_arc_negative (cr, x, y, r * .3, 2 * M_PI, 0);
 
                VECTORICONSTROKEFILL;
+#define ARCARROW(rad, ang) \
+               x + (rad) * sin((ang) * 2.0 * M_PI), y + (rad) * cos((ang) * 2.0 * M_PI)
+
+               cairo_move_to (cr, ARCARROW(r * .30, .72));
+               cairo_line_to (cr, ARCARROW(r * .08, .72));
+               cairo_line_to (cr, ARCARROW(r * .50, .60));
+               cairo_line_to (cr, ARCARROW(r * .73, .72));
+               cairo_line_to (cr, ARCARROW(r * .60, .72));
+
+               cairo_set_source_rgba (cr, 0, 0, 0, 1.0);
+               cairo_stroke_preserve(cr);
+               cairo_close_path (cr);
+               cairo_set_source_rgba (cr, 1, 1, 1, 1.0);
+               cairo_fill(cr);
+#undef ARCARROW
+
        }
        else if (_elements & VectorIcon) {
                // missing icon
                assert(0);
        }
+#undef VECTORICONSTROKEFILL
 
        const int text_margin = char_pixel_width();
        // Text, if any
index f5f9f62b6613ce3bb8f996126cf82707b00f3301..2abca97503a197deadfa586a378474a2fea5f2fd 100644 (file)
@@ -282,8 +282,8 @@ ARDOUR_UI::setup_transport ()
        stop_button.set_icon (ArdourButton::BtnStop);
        play_selection_button.set_elements ((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body|ArdourButton::VectorIcon));
        play_selection_button.set_icon (ArdourButton::BtnRange);
-
-       auto_loop_button.set_image (get_icon (X_("transport_loop")));
+       auto_loop_button.set_elements ((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body|ArdourButton::VectorIcon));
+       auto_loop_button.set_icon (ArdourButton::BtnLoop);
 
        rec_button.set_elements ((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body|ArdourButton::VectorIcon));
        rec_button.set_icon (ArdourButton::RecButton);
@@ -364,7 +364,7 @@ ARDOUR_UI::setup_transport ()
        transport_button_size_group->add_widget (roll_button);
        transport_button_size_group->add_widget (stop_button);
 
-       goto_start_button.set_size_request (-1, 40);
+       goto_start_button.set_size_request (28, 44);
 
        HBox* tbox1 = manage (new HBox);
        HBox* tbox2 = manage (new HBox);