summaryrefslogtreecommitdiff
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
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
-rw-r--r--gtk2_ardour/ardour2_ui.rc165
-rw-r--r--gtk2_ardour/ardour_ui2.cc49
-rw-r--r--gtk2_ardour/editor_region_list.cc2
-rw-r--r--gtk2_ardour/utils.cc45
-rw-r--r--gtk2_ardour/utils.h4
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/stateful_button.h1
6 files changed, 145 insertions, 121 deletions
diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc
index 6503106204..5421c3082d 100644
--- a/gtk2_ardour/ardour2_ui.rc
+++ b/gtk2_ardour/ardour2_ui.rc
@@ -49,13 +49,13 @@ style "larger_bold_text"
style "plugin_name_text"
{
font_name = "sans bold 25"
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
}
style "plugin_maker_text"
{
font_name = "sans bold 14"
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
}
style "first_action_message"
@@ -80,11 +80,11 @@ style "time_axis_view_item_name"
style "default_base" = "medium_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
- fg[PRELIGHT] = { 0.98, 0.76, 0.14 }
- fg[INSENSITIVE] = { 0.80, 0.80, 0.70 }
- fg[SELECTED] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
+ fg[PRELIGHT] = { 0.50, 1.0, 1.0 }
+ fg[INSENSITIVE] = { 0.80, 0.80, 0.80 }
+ fg[SELECTED] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.40, 0.40, 0.40 }
bg[ACTIVE] = { 0.40, 0.40, 0.40 }
@@ -92,22 +92,22 @@ style "default_base" = "medium_text"
bg[INSENSITIVE] = { 0.10, 0.10, 0.10 }
bg[SELECTED] = { 0, 0.40, 0.60 }
- text[NORMAL] = { 0.80, 0.80, 0.70 }
- text[ACTIVE] = { 0.80, 0.80, 0.70 }
- text[PRELIGHT] = { 0.80, 0.80, 0.70 }
- text[INSENSITIVE] = { 0.80, 0.80, 0.70 }
+ text[NORMAL] = { 0.80, 0.80, 0.80 }
+ text[ACTIVE] = { 0.80, 0.80, 0.80 }
+ text[PRELIGHT] = { 0.80, 0.80, 0.80 }
+ text[INSENSITIVE] = { 0.80, 0.80, 0.80}
text[SELECTED] = { 1.0, 1.0, 1.0 }
base[ACTIVE] = "#2f272f"
base[NORMAL] = "#1c1e21"
- base[PRELIGHT] = "#2f272f"
+ base[PRELIGHT] = { 0.20, 0.20, 0.20 }
base[INSENSITIVE] = "#4c5159"
- base[SELECTED] = "#2f272f"
+ base[SELECTED] = { 0.25, 0.25, 0.25 }
}
style "base_frame"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.40, 0.40, 0.40 }
}
@@ -133,10 +133,10 @@ style "default_buttons_menus" = "default_base"
fg[ACTIVE] = { 0, 0, 0 }
bg[NORMAL] = { 0.35, 0.35, 0.35 }
- bg[ACTIVE] = { 0.98, 0.76, 0.14 }
- bg[PRELIGHT] = { 0.25, 0.25, 0.25 }
- bg[INSENSITIVE] = { 0.10, 0.10, 0.10 }
- bg[SELECTED] = { 0.06, 0.06, 0.06 }
+ bg[ACTIVE] = { 0.50, 1.0, 1.0 }
+ bg[PRELIGHT] = { 0.20, 0.20, 0.20 }
+ bg[INSENSITIVE] = { 0.20, 0.20, 0.20 }
+ bg[SELECTED] = { 0.20, 0.20, 0.20 }
}
style "very_small_button" = "default_buttons_menus"
@@ -227,16 +227,15 @@ style "time_button" = "default_buttons_menus"
font_name = "sans 8"
}
-style "transport_button" = "very_small_button"
+style "transport_button"
{
- bg[ACTIVE] = { 0.66, 0.97, 0.18 }
- bg[SELECTED] = { 1.0, 0.04, 0.04 }
+ bg[ACTIVE] = { 0.50, 1.0, 0.50 }
}
-style "transport_rec_button" = "very_small_button"
+style "transport_rec_button"
{
- bg[ACTIVE] = { 0.82, 0.02, 0.02 }
- bg[SELECTED] = { 1.0, 0.04, 0.04 }
+ bg[ACTIVE] = { 1.0, 0, 0 }
+ bg[PRELIGHT] = { 0.91, 0.68, 0.68 } #blinking rec button color
}
style "shuttle_control" = "very_small_text"
@@ -250,14 +249,14 @@ style "shuttle_control" = "very_small_text"
bg[NORMAL] = { 0.31, 0.31, 0.31 }
bg[PRELIGHT] = { 0.31, 0.31, 0.31 }
bg[INSENSITIVE] = { 0.31, 0.31, 0.31 }
- bg[ACTIVE] = { 0.66, 0.97, 0.18 }
+ bg[ACTIVE] = { 0.50, 1.0, 0.50 }
bg[SELECTED] = { 1.0, 0.04, 0.04 }
}
style "ardour_adjusters" = "default_buttons_menus"
{
bg[NORMAL] = { 0.60, 0.60, 0.60 }
- bg[PRELIGHT] = { 0.80, 0.80, 0.70 }
+ bg[PRELIGHT] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0.06, 0.06, 0.06 }
}
@@ -270,14 +269,14 @@ style "ardour_progressbars" = "default_buttons_menus"
style "options_window" = "default_base"
{
font_name = "sans 8"
- fg[PRELIGHT] = { 0.80, 0.80, 0.70 }
+ fg[PRELIGHT] = { 0.80, 0.80, 0.80 }
}
style "option_entry" = "default_base"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[ACTIVE] = { 0.98, 0.76, 0.14 }
- fg[INSENSITIVE] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[ACTIVE] = { 0.50, 1.0, 1.0 }
+ fg[INSENSITIVE] = { 0.80, 0.80, 0.80 }
base[INSENSITIVE] = { 0.12, 0.12, 0.12 }
@@ -287,10 +286,10 @@ style "option_entry" = "default_base"
style "red_when_active" = "medium_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.31, 0.31, 0.31 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 1.0, 0, 0}
}
@@ -320,7 +319,7 @@ style "menu_bar_base"
style "fatal_message" = "medium_text"
{
fg[ACTIVE] = { 1.0, 0, 1.0 }
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0,0,0 }
bg[NORMAL] = { 0,0,0 }
base[ACTIVE] = { 0,0,0 }
@@ -330,7 +329,7 @@ style "fatal_message" = "medium_text"
style "error_message" = "medium_text"
{
fg[ACTIVE] = { 1.0, 0, 0 }
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0,0,0 }
bg[NORMAL] = { 0,0,0 }
base[ACTIVE] = { 0,0,0 }
@@ -340,7 +339,7 @@ style "error_message" = "medium_text"
style "info_message" = "medium_text"
{
fg[ACTIVE] = { 1.0, 0, 0 }
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0,0,0 }
bg[NORMAL] = { 0,0,0 }
base[ACTIVE] = { 0,0,0 }
@@ -350,7 +349,7 @@ style "info_message" = "medium_text"
style "warning_message" = "medium_text"
{
fg[ACTIVE] = { 0.30,0.30, 1.0 }
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 0, 0, 0 }
bg[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 0, 0 }
@@ -359,9 +358,9 @@ style "warning_message" = "medium_text"
style "medium_entry" = "medium_text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[ACTIVE] = { 0.98, 0.76, 0.14 }
- fg[SELECTED] = { 0.66, 0.97, 0.18 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[ACTIVE] = { 0.50, 1.0, 1.0 }
+ fg[SELECTED] = { 0.50, 1.0, 0.50 }
bg[NORMAL] = { 0.40, 0.40, 0.40 }
@@ -372,7 +371,7 @@ style "medium_entry" = "medium_text"
style "medium_entry_noselection_fg" = "medium_entry"
{
- fg[SELECTED] = { 0.98, 0.76, 0.14 }
+ fg[SELECTED] = { 0.50, 1.0, 1.0 }
}
style "medium_entry_noselection_bg" = "medium_entry"
@@ -382,8 +381,8 @@ style "medium_entry_noselection_bg" = "medium_entry"
style "medium_bold_entry" = "medium_bold_text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[ACTIVE] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[ACTIVE] = { 0.50, 1.0, 1.0 }
bg[NORMAL] = { 0.40, 0.40, 0.40 }
@@ -395,8 +394,8 @@ style "medium_bold_entry" = "medium_bold_text"
style "small_entry" = "small_text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[ACTIVE] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[ACTIVE] = { 0.50, 1.0, 1.0 }
bg[NORMAL] = { 0.0, 0.0, 0.0 }
base[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 0, 0 }
@@ -411,8 +410,8 @@ style "red_active_small_entry" = "small_entry"
style "small_bold_entry" = "small_bold_text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[ACTIVE] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[ACTIVE] = { 0.50, 1.0, 1.0 }
bg[NORMAL] = { 0.40, 0.40, 0.40 }
@@ -440,7 +439,7 @@ style "transport_clock_display"
{
font_name = "sans bold 14"
- fg[NORMAL] = { 0.66, 0.97, 0.18 }
+ fg[NORMAL] = { 0.50, 1.0, 0.50 }
fg[ACTIVE] = { 1.0, 0, 0.0 }
fg[SELECTED] = { 1.0, 0, 0 }
fg[PRELIGHT] = { 1.0, 0, 0.0 }
@@ -466,7 +465,7 @@ style "tempo_meter_clock_display"
style "default_clock_display" = "medium text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 0.50 }
fg[ACTIVE] = { 1.0, 0.0, 0.0 }
fg[SELECTED] = { 1.0, 0, 0 }
base[NORMAL] = { 0, 0, 0 }
@@ -477,14 +476,14 @@ style "default_clock_display" = "medium text"
style "editor_time_ruler" = "small_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.09, 0.09, 0.09 }
}
style "audio_track_base" = "default_base"
{
font_name = "sans medium 8"
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.18, 0.18, 0.22 }
bg[ACTIVE] = { 0.20, 0.20, 0.20 }
bg[PRELIGHT] = { 0.20, 0.20, 0.20 }
@@ -502,8 +501,8 @@ style "audio_bus_base"
style "track_name_display"
{
font_name = "sans medium 8"
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
base[NORMAL] = { 0.06, 0.06, 0.06 }
base[ACTIVE] = { 0.26, 0.26, 0.26 }
@@ -574,16 +573,16 @@ style "edit_group_3"
style "region_list_display" = "small_bold_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
- fg[SELECTED] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
+ fg[SELECTED] = { 0.50, 1.0, 1.0 }
bg[NORMAL] = { 0, 0, 0 }
bg[ACTIVE] = { 0, 0, 0 }
bg[SELECTED] = { 0, 0, 0 }
base[NORMAL] = { 0, 0, 0 }
base[ACTIVE] = { 0, 1, 0 }
base[INSENSITIVE] = { 0, 0, 0 }
- base[SELECTED] = { 0.80, 0.80, 0.70 }
+ base[SELECTED] = { 0.80, 0.80, 0.80 }
}
style "main_canvas_area"
@@ -636,18 +635,18 @@ style "plugin_slider"
fg[SELECTED] = { 0.45, 0.45, 0.45 }
fg[PRELIGHT] = { 0.45, 0.45, 0.45 }
- text[NORMAL] = { 0.80, 0.80, 0.70 }
- text[ACTIVE] = { 0.80, 0.80, 0.70 }
- text[INSENSITIVE] = { 0.80, 0.80, 0.70 }
- text[SELECTED] = { 0.80, 0.80, 0.70 }
- text[PRELIGHT] = { 0.80, 0.80, 0.70 }
+ text[NORMAL] = { 0.80, 0.80, 0.80 }
+ text[ACTIVE] = { 0.80, 0.80, 0.80 }
+ text[INSENSITIVE] = { 0.80, 0.80, 0.80 }
+ text[SELECTED] = { 0.80, 0.80, 0.80 }
+ text[PRELIGHT] = { 0.80, 0.80, 0.80 }
}
style "track_list_display" = "small_bold_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
- fg[SELECTED] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
+ fg[SELECTED] = { 0.50, 1.0, 1.0 }
bg[NORMAL] = { 0, 0, 0 }
bg[ACTIVE] = { 0, 0, 0 }
bg[SELECTED] = { 0, 0, 0 }
@@ -676,8 +675,8 @@ style "wall_clock" = "medium_bold_text"
style "paler_red_when_active" = "medium_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
- fg[PRELIGHT] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[PRELIGHT] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.31, 0.31, 0.31 }
bg[PRELIGHT] = { 0.31, 0.31, 0.31 }
@@ -711,17 +710,17 @@ style "selected_strip_frame"
style "flashing_alert" = "very_small_text"
{
- fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.31, 0.31, 0.31 }
- fg[ACTIVE] = { 0.80, 0.80, 0.70 }
+ fg[ACTIVE] = { 0.80, 0.80, 0.80 }
bg[ACTIVE] = { 1.0, 0, 0}
}
style "selected_io_selector_port_list" = "medium_text"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
- fg[SELECTED] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
+ fg[SELECTED] = { 0.50, 1.0, 1.0 }
base[NORMAL] = { 0, 0, 0 }
base[SELECTED] = { 0, 0, 0 }
}
@@ -736,14 +735,16 @@ style "io_selector_port_list" = "medium_text"
style "io_selector_notebook" = "default_base"
{
- fg[NORMAL] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.50, 1.0, 1.0 }
font_name ="sans bold 8"
}
style "tearoff_arrow" = "medium_bold_entry"
{
- bg[NORMAL] = { 0.80, 0.80, 0.70 }
- bg[PRELIGHT] = { 0.98, 0.76, 0.14 }
+ fg[NORMAL] = { 0.80, 0.80, 0.80 }
+ fg[PRELIGHT] = { 0.80, 0.80, 0.80 }
+ bg[NORMAL] = { 0.80, 0.80, 0.80 }
+ bg[PRELIGHT] = { 0.80, 0.80, 0.80 }
}
style "meter_metrics_strip" = "default_base"
@@ -785,6 +786,11 @@ style "pan_slider"
text[PRELIGHT] = { 0.85, 0.92, 0.98 }
}
+style "region_list_whole_file"
+{
+ fg[NORMAL] = { 1.0, 0, 0 }
+}
+
#---------------------------------------------------------------
widget "*FirstActionMessage" style "first_action_message"
widget "*VerboseCanvasCursor" style "verbose_canvas_cursor"
@@ -1179,6 +1185,7 @@ widget "*PanningLinkDirectionButton" style "very_small_button"
widget "*PanningLinkDirectionButton.*" style "very_small_button"
widget "*ChannelCountSelector" style "medium_bold_entry"
widget "*ChannelCountSelector.GtkArrow" style "default_buttons_menus"
+widget "*RegionListWholeFile" style "region_list_whole_file"
class "GtkWidget" style "default_base"
class "GtkScrollbar" style "ardour_adjusters"
@@ -1206,7 +1213,7 @@ widget "*cWaveForm" style "cWaveForm"
style "cMutedWaveForm"
{
fg[NORMAL] = { 0.35, 0.35, 0.35 }
- #fg[NORMAL] = { 0.80, 0.80, 0.70 }
+ #fg[NORMAL] = { 0.80, 0.80, 0.80 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*cMutedWaveForm" style "cMutedWaveForm"
@@ -1251,35 +1258,35 @@ widget "*cAudioBusBase" style "cAudioBusBase"
style "cTempoBar"
{
- fg[NORMAL] = { 0.64, 0.64, 0.62 }
+ fg[NORMAL] = { 0.64, 0.64, 0.66 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*TempoBar" style "cTempoBar"
style "cMeterBar"
{
- fg[NORMAL] = { 0.75, 0.75, 0.73 }
+ fg[NORMAL] = { 0.75, 0.75, 0.80 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*cMeterBar" style "cMeterBar"
style "cMarkerBar"
{
- fg[NORMAL] = { 0.54, 0.54, 0.52 }
+ fg[NORMAL] = { 0.54, 0.54, 0.56 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*cMarkerBar" style "cMarkerBar"
style "cRangeMarkerBar"
{
- fg[NORMAL] = { 0.48, 0.48, 0.46 }
+ fg[NORMAL] = { 0.48, 0.48, 0.50 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*cRangeMarkerBar" style "cRangeMarkerBar"
style "cTransportMarkerBar"
{
- fg[NORMAL] = { 0.40, 0.40, 0.38 }
+ fg[NORMAL] = { 0.40, 0.40, 0.42 }
fg[ACTIVE] = { 1.0, 0, 0 }
}
widget "*cTransportMarkerBar" style "cTransportMarkerBar"
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);
diff --git a/gtk2_ardour/editor_region_list.cc b/gtk2_ardour/editor_region_list.cc
index 04f59944b8..034c20f7f0 100644
--- a/gtk2_ardour/editor_region_list.cc
+++ b/gtk2_ardour/editor_region_list.cc
@@ -112,7 +112,7 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
} else if (region->whole_file()) {
row = *(region_list_model->append());
- set_color(c, 65535, 0, 0);
+ set_color(c, rgba_from_style ("RegionListWholeFile", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false ));
row[region_list_columns.color_] = c;
if (region->source().name()[0] == '/') { // external file
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 012d184fef..1c4fc2a452 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -39,6 +39,7 @@
using namespace std;
using namespace Gtk;
using namespace sigc;
+using namespace Glib;
string
short_version (string orig, string::size_type target_length)
@@ -480,7 +481,7 @@ pane_handler (GdkEventButton* ev, Gtk::Paned* pane)
return FALSE;
}
uint32_t
-rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
+rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, string attr, int state, bool rgba)
{
/* In GTK+2, styles aren't set up correctly if the widget is not
attached to a toplevel window that has a screen pointer.
@@ -502,21 +503,39 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
GtkRcStyle* waverc = foo.get_style()->gobj()->rc_style;
if (waverc) {
- r = waverc->fg[Gtk::STATE_NORMAL].red / 257;
- g = waverc->fg[Gtk::STATE_NORMAL].green / 257;
- b = waverc->fg[Gtk::STATE_NORMAL].blue / 257;
-
- /* what a hack ... "a" is for "active" */
-
- a = waverc->fg[GTK_STATE_ACTIVE].red / 257;
-
+ if (attr == "fg") {
+ r = waverc->fg[state].red / 257;
+ g = waverc->fg[state].green / 257;
+ b = waverc->fg[state].blue / 257;
+ /* what a hack ... "a" is for "active" */
+ if (state == Gtk::STATE_NORMAL && rgba) {
+ a = waverc->fg[GTK_STATE_ACTIVE].red / 257;
+ }
+ } else if (attr == "bg") {
+ r = g = b = 0;
+ r = waverc->bg[state].red / 257;
+ g = waverc->bg[state].green / 257;
+ b = waverc->bg[state].blue / 257;
+ } else if (attr == "base") {
+ r = waverc->base[state].red / 257;
+ g = waverc->base[state].green / 257;
+ b = waverc->base[state].blue / 257;
+ } else if (attr == "text") {
+ r = waverc->text[state].red / 257;
+ g = waverc->text[state].green / 257;
+ b = waverc->text[state].blue / 257;
+ }
} else {
warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl;
}
window->remove ();
- return (uint32_t) RGBA_TO_UINT(r,g,b,a);
+ if (state == Gtk::STATE_NORMAL && rgba) {
+ return (uint32_t) RGBA_TO_UINT(r,g,b,a);
+ } else {
+ return (uint32_t) RGB_TO_UINT(r,g,b);
+ }
}
bool
@@ -526,9 +545,7 @@ canvas_item_visible (ArdourCanvas::Item* item)
}
void
-set_color (Gdk::Color& c, gint r, gint g, gint b)
+set_color (Gdk::Color& c, int rgb)
{
- c.set_red(65535);
- c.set_green(0);
- c.set_blue(0);
+ c.set_rgb((rgb >> 16)*256, ((rgb & 0xff00) >> 8)*256, (rgb & 0xff)*256);
}
diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h
index 2180e80fc4..221329727e 100644
--- a/gtk2_ardour/utils.h
+++ b/gtk2_ardour/utils.h
@@ -69,12 +69,12 @@ int channel_combo_get_channel_count (Gtk::ComboBoxText& combo);
Pango::FontDescription get_font_for_style (std::string widgetname);
gint pane_handler (GdkEventButton*, Gtk::Paned*);
-uint32_t rgba_from_style (std::string style, uint32_t, uint32_t, uint32_t, uint32_t);
+uint32_t rgba_from_style (std::string, uint32_t, uint32_t, uint32_t, uint32_t, std::string = "fg", int = Gtk::STATE_NORMAL, bool = true);
void decorate (Gtk::Window& w, Gdk::WMDecoration d);
bool canvas_item_visible (ArdourCanvas::Item* item);
-void set_color (Gdk::Color&, gint, gint, gint);
+void set_color (Gdk::Color&, int);
#endif /* __ardour_gtk_utils_h__ */
diff --git a/libs/gtkmm2ext/gtkmm2ext/stateful_button.h b/libs/gtkmm2ext/gtkmm2ext/stateful_button.h
index 227471fd01..f684903836 100644
--- a/libs/gtkmm2ext/gtkmm2ext/stateful_button.h
+++ b/libs/gtkmm2ext/gtkmm2ext/stateful_button.h
@@ -40,6 +40,7 @@ class StatefulButton : public Gtk::Button
void set_active (bool yn) {
set_state (yn ? 1 : 0);
}
+
protected:
std::vector<Gdk::Color> colors;