slightly improve color choice for meter metrics when more than one data type is present

git-svn-id: svn://localhost/ardour2/branches/3.0@9915 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-07-22 22:15:30 +00:00
parent 6ee0af19c5
commit 806ca0cbc0
2 changed files with 18 additions and 4 deletions

View file

@ -753,7 +753,11 @@ style "audio_bus_base" = "very_small_text"
style "send_strip_base" = "default"
{
font_name = "@FONT_SMALLER@"
# NORMAL is used for single-data type labels, or Audio
# ACTIVE is used for MIDI in the presence of multiple data type
fg[NORMAL] = @@COLPREFIX@_send_fg
fg[ACTIVE] = darker(@@COLPREFIX@_fg)
bg[NORMAL] = @@COLPREFIX@_send_bg
bg[ACTIVE] = @@COLPREFIX@_send_bg
bg[PRELIGHT] = @@COLPREFIX@_send_bg
@ -764,7 +768,11 @@ style "send_strip_base" = "default"
style "audio_track_base" = "default"
{
font_name = "@FONT_SMALLER@"
# NORMAL is used for single-data type labels, or Audio
# ACTIVE is used for MIDI in the presence of multiple data type
fg[NORMAL] = @@COLPREFIX@_fg
fg[ACTIVE] = darker(@@COLPREFIX@_fg)
bg[NORMAL] = @@COLPREFIX@_audio_track
bg[ACTIVE] = @@COLPREFIX@_bg
bg[PRELIGHT] = @@COLPREFIX@_bg
@ -775,7 +783,11 @@ style "audio_track_base" = "default"
style "midi_track_base" = "default"
{
font_name = "@FONT_SMALLER@"
# NORMAL is used for single-data type labels, or Audio
# ACTIVE is used for MIDI in the presence of multiple data type
fg[NORMAL] = @@COLPREFIX@_fg
fg[ACTIVE] = darker(@@COLPREFIX@_fg)
bg[NORMAL] = @@COLPREFIX@_midi_track
bg[ACTIVE] = @@COLPREFIX@_bg
bg[PRELIGHT] = @@COLPREFIX@_bg

View file

@ -911,21 +911,23 @@ GainMeter::render_metrics (Gtk::Widget& w, vector<DataType> types)
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
Glib::RefPtr<Gdk::GC> fg_gc (w.get_style()->get_fg_gc (Gtk::STATE_NORMAL));
Gdk::Color c;
if (types.size() > 1) {
/* we're overlaying more than 1 set of marks, so use different colours */
Gdk::Color c;
switch (*i) {
case DataType::AUDIO:
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
break;
case DataType::MIDI:
cairo_set_source_rgb (cr, 0.2, 0.2, 0.5);
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
break;
}
} else {
Gdk::Color c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
}