fix #6117 - fader prelight

This commit is contained in:
Robin Gareus 2015-01-28 02:22:52 +01:00
parent 36bbd14113
commit de85bfd857
4 changed files with 14 additions and 1 deletions

View File

@ -416,6 +416,8 @@ ARDOUR_UI::parameter_changed (std::string p)
}
} else if (p == "waveform-scale") {
ArdourCanvas::WaveView::set_global_logscaled (ARDOUR_UI::config()->get_waveform_scale() == Logarithmic);
} else if (p == "widget-prelight") {
CairoWidget::set_widget_prelight( config()->get_widget_prelight() );
} else if (p == "waveform-shape") {
ArdourCanvas::WaveView::set_global_shape (ARDOUR_UI::config()->get_waveform_shape() == Rectified
? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);

View File

@ -25,6 +25,7 @@
static const char* has_cairo_widget_background_info = "has_cairo_widget_background_info";
bool CairoWidget::_flat_buttons = false;
bool CairoWidget::_widget_prelight = true;
static void noop() { }
sigc::slot<void> CairoWidget::focus_handler (sigc::ptr_fun (noop));
@ -256,6 +257,12 @@ CairoWidget::set_flat_buttons (bool yn)
_flat_buttons = yn;
}
void
CairoWidget::set_widget_prelight (bool yn)
{
_widget_prelight = yn;
}
void
CairoWidget::set_focus_handler (sigc::slot<void> s)
{

View File

@ -73,6 +73,9 @@ public:
static void set_flat_buttons (bool yn);
static bool flat_buttons() { return _flat_buttons; }
static void set_widget_prelight (bool yn);
static bool widget_prelight() { return _widget_prelight; }
static void set_source_rgb_a( cairo_t* cr, Gdk::Color, float a=1.0 );
/* set_focus_handler() will cause all button-press events on any
@ -112,6 +115,7 @@ protected:
bool _need_bg;
static bool _flat_buttons;
static bool _widget_prelight;
bool _grabbed;
static sigc::slot<void> focus_handler;

View File

@ -325,7 +325,7 @@ PixFader::render (cairo_t *cr, cairo_rectangle_t* area)
Gtkmm2ext::rounded_rectangle (cr, CORNER_OFFSET, CORNER_OFFSET, w-CORNER_SIZE, h-CORNER_SIZE, CORNER_RADIUS);
cairo_set_source_rgba (cr, 0.505, 0.517, 0.525, 0.4);
cairo_fill (cr);
} else if (_hovering) {
} else if (_hovering && CairoWidget::widget_prelight()) {
Gtkmm2ext::rounded_rectangle (cr, CORNER_OFFSET, CORNER_OFFSET, w-CORNER_SIZE, h-CORNER_SIZE, CORNER_RADIUS);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.1);
cairo_fill (cr);