X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fbutton_joiner.cc;h=a3ef36ac80327bd17bdc6a9ce612ef98cc1a6ca8;hb=80fa696564a2b261b6cf751ff61e4d885d3a2dc0;hp=0c60cba1db40f8cf79987a0383c6d5770c3c14c3;hpb=8c9749e42faf7808034ed8b7afce4a2fe6dc6f33;p=ardour.git diff --git a/gtk2_ardour/button_joiner.cc b/gtk2_ardour/button_joiner.cc index 0c60cba1db..a3ef36ac80 100644 --- a/gtk2_ardour/button_joiner.cc +++ b/gtk2_ardour/button_joiner.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,10 +27,12 @@ #include "gtkmm2ext/utils.h" #include "gtkmm2ext/rgb_macros.h" -#include "ardour_ui.h" #include "button_joiner.h" +#include "tooltips.h" +#include "ui_config.h" using namespace Gtk; +using namespace ARDOUR_UI_UTILS; ButtonJoiner::ButtonJoiner (const std::string& str, Gtk::Widget& lw, Gtk::Widget& rw, bool central_joiner) : left (lw) @@ -74,9 +76,9 @@ ButtonJoiner::ButtonJoiner (const std::string& str, Gtk::Widget& lw, Gtk::Widget uint32_t border_color; uint32_t r, g, b, a; - border_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: border end", name)); + border_color = UIConfiguration::instance().color (string_compose ("%1: border end", name)); UINT_TO_RGBA (border_color, &r, &g, &b, &a); - + border_r = r/255.0; border_g = g/255.0; border_b = b/255.0; @@ -102,7 +104,7 @@ void ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) { double h = get_height(); - + if (!get_active()) { cairo_set_source (cr, inactive_fill_pattern); } else { @@ -111,26 +113,26 @@ ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) if (!central_link) { /* outer rect */ - + Gtkmm2ext::rounded_top_rectangle (cr, 0, 0, get_width(), h, 8); cairo_fill_preserve (cr); - + /* outer edge */ - + cairo_set_line_width (cr, 1.5); cairo_set_source_rgb (cr, border_r, border_g, border_b); cairo_stroke (cr); - + /* inner "edge" */ - + Gtkmm2ext::rounded_top_rectangle (cr, 8, 8, get_width() - 16, h - 8, 6); cairo_stroke (cr); } else { if (get_active()) { Gtkmm2ext::rounded_top_rectangle (cr, 0, 0, (get_width() - 20.0)/2.0 , h, 8); cairo_fill_preserve (cr); - - Gtkmm2ext::rounded_top_rectangle (cr, (get_width() - 20.)/2.0 + 20.0, 0.0, + + Gtkmm2ext::rounded_top_rectangle (cr, (get_width() - 20.)/2.0 + 20.0, 0.0, (get_width() - 20.0)/2.0 , h, 8); cairo_fill_preserve (cr); @@ -144,7 +146,7 @@ ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) cairo_set_line_width (cr, 1.5); cairo_fill_preserve (cr); cairo_set_source_rgb (cr, border_r, border_g, border_b); - cairo_stroke (cr); + cairo_stroke (cr); } } } @@ -185,7 +187,7 @@ ButtonJoiner::set_related_action (Glib::RefPtr act) if (tact) { action_toggled (); tact->signal_toggled().connect (sigc::mem_fun (*this, &ButtonJoiner::action_toggled)); - } + } _action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &ButtonJoiner::action_sensitivity_changed)); _action->connect_property_changed ("visible", sigc::mem_fun (*this, &ButtonJoiner::action_visibility_changed)); @@ -201,7 +203,7 @@ ButtonJoiner::action_sensitivity_changed () } else { set_visual_state (Gtkmm2ext::VisualState (visual_state() | Gtkmm2ext::Insensitive)); } - + } void @@ -218,7 +220,7 @@ void ButtonJoiner::action_tooltip_changed () { std::string str = _action->property_tooltip().get_value(); - ARDOUR_UI::instance()->set_tip (*this, str); + set_tooltip (*this, str); } void @@ -229,7 +231,7 @@ ButtonJoiner::action_toggled () if (tact) { set_active (tact->get_active()); } -} +} void ButtonJoiner::set_active_state (Gtkmm2ext::ActiveState s) @@ -256,15 +258,15 @@ ButtonJoiner::set_colors () active_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()); inactive_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()); - start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start", name)); - end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end", name)); + start_color = UIConfiguration::instance().color (string_compose ("%1: fill start", name)); + end_color = UIConfiguration::instance().color (string_compose ("%1: fill end", name)); UINT_TO_RGBA (start_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0); UINT_TO_RGBA (end_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 1, r/255.0,g/255.0,b/255.0, a/255.0); - start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", name)); - end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", name)); + start_color = UIConfiguration::instance().color (string_compose ("%1: fill start active", name)); + end_color = UIConfiguration::instance().color (string_compose ("%1: fill end active", name)); UINT_TO_RGBA (start_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (active_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0); UINT_TO_RGBA (end_color, &r, &g, &b, &a);