summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui2.cc
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2006-01-06 15:06:33 +0000
committerDoug McLain <doug@nostar.net>2006-01-06 15:06:33 +0000
commit1186b1d881fac3d1d1b55954b84b958c988501c4 (patch)
treedaebae62a81cd7f88a4c04335a47c569d94d17ed /gtk2_ardour/ardour_ui2.cc
parentbd21c474e547d49338ea0efd452895de1e147cd5 (diff)
modified rgba_from_style() so that it can be used to retrieve any attribute from any style, return rgb or rgba, then used to to remove hard coding of colors in transport buttons and whole_file region names. Theme changes too
git-svn-id: svn://localhost/trunk/ardour2@245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui2.cc')
-rw-r--r--gtk2_ardour/ardour_ui2.cc49
1 files changed, 24 insertions, 25 deletions
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 804027092f..173f6c30a3 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -156,6 +156,7 @@ void
ARDOUR_UI::transport_stopped ()
{
stop_button.set_active (true);
+
roll_button.set_active (false);
play_selection_button.set_active (false);
auto_loop_button.set_active (false);
@@ -172,7 +173,6 @@ void
ARDOUR_UI::transport_rolling ()
{
stop_button.set_active (false);
-
if (session->get_play_range()) {
play_selection_button.set_active (true);
@@ -201,7 +201,7 @@ ARDOUR_UI::transport_rolling ()
void
ARDOUR_UI::transport_rewinding ()
{
- stop_button.set_active (false);
+ stop_button.set_active(false);
roll_button.set_active (true);
play_selection_button.set_active (false);
auto_loop_button.set_active (false);
@@ -236,22 +236,37 @@ ARDOUR_UI::setup_transport ()
transport_tearoff->Attach.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
static_cast<Widget*> (&transport_frame), 1));
+ shuttle_box.set_name ("TransportButton");
+ goto_start_button.set_name ("TransportButton");
+ goto_end_button.set_name ("TransportButton");
+ roll_button.set_name ("TransportButton");
+ stop_button.set_name ("TransportButton");
+ play_selection_button.set_name ("TransportButton");
+ rec_button.set_name ("TransportRecButton");
+ auto_loop_button.set_name ("TransportButton");
+ auto_return_button.set_name ("TransportButton");
+ auto_play_button.set_name ("TransportButton");
+ auto_input_button.set_name ("TransportButton");
+ punch_in_button.set_name ("TransportButton");
+ punch_out_button.set_name ("TransportButton");
+ click_button.set_name ("TransportButton");
+ time_master_button.set_name ("TransportButton");
+
vector<Gdk::Color> colors;
Gdk::Color c;
/* record button has 3 color states, so we set 2 extra here */
-
- c.set_rgb_p (0.91, 0.68, 0.68);
+ set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_PRELIGHT, false ));
colors.push_back (c);
- c.set_rgb_p (1, 0, 0);
+
+ set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false ));
colors.push_back (c);
+
rec_button.set_colors (colors);
-
colors.clear ();
-
+
/* other buttons get 2 color states, so add one here */
-
- c.set_rgb_p (0.66, 0.97, 0.18);
+ set_color(c, rgba_from_style ("TransportButton", 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
colors.push_back (c);
stop_button.set_colors (colors);
@@ -327,22 +342,6 @@ ARDOUR_UI::setup_transport ()
shuttle_box.set_events (shuttle_box.get_events() | Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::POINTER_MOTION_MASK);
shuttle_box.set_size_request (100, 15);
- shuttle_box.set_name ("TransportButton");
- goto_start_button.set_name ("TransportButton");
- goto_end_button.set_name ("TransportButton");
- roll_button.set_name ("TransportButton");
- stop_button.set_name ("TransportButton");
- play_selection_button.set_name ("TransportButton");
- rec_button.set_name ("TransportRecButton");
- auto_loop_button.set_name ("TransportButton");
- auto_return_button.set_name ("TransportButton");
- auto_play_button.set_name ("TransportButton");
- auto_input_button.set_name ("TransportButton");
- punch_in_button.set_name ("TransportButton");
- punch_out_button.set_name ("TransportButton");
- click_button.set_name ("TransportButton");
- time_master_button.set_name ("TransportButton");
-
goto_start_button.unset_flags (CAN_FOCUS);
goto_end_button.unset_flags (CAN_FOCUS);
roll_button.unset_flags (CAN_FOCUS);