mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
fix #6117 - fader prelight
This commit is contained in:
parent
36bbd14113
commit
de85bfd857
4 changed files with 14 additions and 1 deletions
|
|
@ -416,6 +416,8 @@ ARDOUR_UI::parameter_changed (std::string p)
|
||||||
}
|
}
|
||||||
} else if (p == "waveform-scale") {
|
} else if (p == "waveform-scale") {
|
||||||
ArdourCanvas::WaveView::set_global_logscaled (ARDOUR_UI::config()->get_waveform_scale() == Logarithmic);
|
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") {
|
} else if (p == "waveform-shape") {
|
||||||
ArdourCanvas::WaveView::set_global_shape (ARDOUR_UI::config()->get_waveform_shape() == Rectified
|
ArdourCanvas::WaveView::set_global_shape (ARDOUR_UI::config()->get_waveform_shape() == Rectified
|
||||||
? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);
|
? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
static const char* has_cairo_widget_background_info = "has_cairo_widget_background_info";
|
static const char* has_cairo_widget_background_info = "has_cairo_widget_background_info";
|
||||||
|
|
||||||
bool CairoWidget::_flat_buttons = false;
|
bool CairoWidget::_flat_buttons = false;
|
||||||
|
bool CairoWidget::_widget_prelight = true;
|
||||||
|
|
||||||
static void noop() { }
|
static void noop() { }
|
||||||
sigc::slot<void> CairoWidget::focus_handler (sigc::ptr_fun (noop));
|
sigc::slot<void> CairoWidget::focus_handler (sigc::ptr_fun (noop));
|
||||||
|
|
@ -256,6 +257,12 @@ CairoWidget::set_flat_buttons (bool yn)
|
||||||
_flat_buttons = yn;
|
_flat_buttons = yn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CairoWidget::set_widget_prelight (bool yn)
|
||||||
|
{
|
||||||
|
_widget_prelight = yn;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CairoWidget::set_focus_handler (sigc::slot<void> s)
|
CairoWidget::set_focus_handler (sigc::slot<void> s)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,9 @@ public:
|
||||||
static void set_flat_buttons (bool yn);
|
static void set_flat_buttons (bool yn);
|
||||||
static bool flat_buttons() { return _flat_buttons; }
|
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 );
|
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
|
/* set_focus_handler() will cause all button-press events on any
|
||||||
|
|
@ -112,6 +115,7 @@ protected:
|
||||||
bool _need_bg;
|
bool _need_bg;
|
||||||
|
|
||||||
static bool _flat_buttons;
|
static bool _flat_buttons;
|
||||||
|
static bool _widget_prelight;
|
||||||
bool _grabbed;
|
bool _grabbed;
|
||||||
|
|
||||||
static sigc::slot<void> focus_handler;
|
static sigc::slot<void> focus_handler;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
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_set_source_rgba (cr, 0.505, 0.517, 0.525, 0.4);
|
||||||
cairo_fill (cr);
|
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);
|
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_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.1);
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue