change the peak display widget from Gtkmm2ext::FocusEntry to ArdourButton, since...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 21 Oct 2014 20:01:23 +0000 (16:01 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 21 Oct 2014 20:01:31 +0000 (16:01 -0400)
This adds a new button name and corresponding colors in default_ui_config which requires a theme reset

gtk2_ardour/canvas_vars.h
gtk2_ardour/default_ui_config.in
gtk2_ardour/gain_meter.cc
gtk2_ardour/gain_meter.h

index f61508da8aa3e91ba8b8c3067328cd1b6f413f17..3f729596b3e11f70249bce606f28a13aa21cf167 100644 (file)
@@ -235,6 +235,7 @@ BUTTON_VARS(MixerStripNameButton, "mixer strip name button")
 BUTTON_VARS(MidiInputButton, "midi input button")
 BUTTON_VARS(LockButton, "lock button")
 BUTTON_VARS(GenericButton, "generic button")
+BUTTON_VARS(PeakDisplayButton, "peak display")
 
 #define CLOCK_VARS(root,name) \
        CANVAS_VARIABLE(canvasvar_ ## root ## Background, name ": background") \
index 126eb125c0902b03874bf569f893344caa73b674..beaa007930abd17be56455b64310c0b17b42a227 100644 (file)
     <Option name="monitor solo exclusive: led active" value="ffa500ff"/>
     <Option name="monitor solo exclusive: text" value="c7c7d8ff"/>
     <Option name="monitor solo exclusive: text active" value="c8c8d9ff"/>
+    <Option name="peak display: fill" value="000000ff"/>
+    <Option name="peak display: fill active" value="e21b1bff"/>
+    <Option name="peak display: led" value="00000000"/>
+    <Option name="peak display: led active" value="00000000"/>
+    <Option name="peak display: text" value="ffffffff"/>
+    <Option name="peak display: text active" value="000000ff"/>
     <Option name="rude solo: fill" value="684d4dff"/>
     <Option name="rude solo: fill active" value="e21b1bff"/>
     <Option name="rude solo: led" value="00000000"/>
index 53af7df9f73770b8cb9cb9e014f14609a0dd7f66..ecec4027845903c23323b05a8c8848c1b19efaab 100644 (file)
@@ -101,12 +101,11 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
        gain_display.signal_focus_out_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
        gain_display.set_alignment(0.5);
 
-       peak_display.set_name ("MixerStripPeakDisplay");
+       peak_display.set_name ("peak display");
        set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */
        max_peak = minus_infinity();
        peak_display.set_text (_("-inf"));
-       peak_display.unset_flags (Gtk::CAN_FOCUS);
-       peak_display.set_alignment(0.5);
+       peak_display.set_alignment (0.5, 0.5);
 
        gain_automation_style_button.set_name ("mixer strip button");
        gain_automation_state_button.set_name ("mixer strip button");
@@ -365,7 +364,7 @@ GainMeterBase::reset_peak_display ()
        level_meter->clear_meters();
        max_peak = -INFINITY;
        peak_display.set_text (_("-inf"));
-       peak_display.set_name ("MixerStripPeakDisplay");
+       peak_display.set_active (false);
 }
 
 void
@@ -860,8 +859,9 @@ GainMeterBase::update_meters()
                        peak_display.set_text (buf);
                }
        }
+
        if (mpeak >= Config->get_meter_peak()) {
-               peak_display.set_name ("MixerStripPeakDisplayPeak");
+               peak_display.set_active (true);
        }
 }
 
index 4c4b0735d35d76448e6bdad9a5e399c31001c726..57215b48b5051fcbc2d6674dd2f5630ded35241c 100644 (file)
@@ -111,8 +111,7 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
        Gtkmm2ext::SliderController *gain_slider;
        Gtk::Adjustment              gain_adjustment;
        Gtkmm2ext::FocusEntry        gain_display;
-       Gtkmm2ext::FocusEntry        peak_display;
-//     Gtk::Button                  peak_display;
+       ArdourButton                 peak_display;
        Gtk::DrawingArea             meter_metric_area;
        Gtk::DrawingArea             meter_ticks1_area;
        Gtk::DrawingArea             meter_ticks2_area;