summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-04-07 23:58:59 +0200
committerRobin Gareus <robin@gareus.org>2015-04-08 00:00:23 +0200
commitc9f9bb263fc3f96e383216d515c62ac6706b56da (patch)
tree516fbed7c8ff1ca2c84c9a223c7ffda746ec3049
parent1c4fc896d0cc5efb88896958a123dc8ef85efc0c (diff)
more transport button caironizing.
-rw-r--r--gtk2_ardour/ardour_button.cc39
-rw-r--r--gtk2_ardour/ardour_ui2.cc6
2 files changed, 39 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index 074bbaa134..7ab1304fa5 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -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
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index f5f9f62b66..2abca97503 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -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);