various tweaks to get clicks on processor "buttons" to work right and to keep track of processor state and position, hopefully
git-svn-id: svn://localhost/ardour2/branches/3.0@10349 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a423a42d9b
commit
25949e9d83
@ -423,19 +423,33 @@ ArdourButton::on_button_release_event (GdkEventButton *ev)
|
||||
if ((_elements & Indicator) && _distinct_led_click) {
|
||||
|
||||
/* if within LED, emit signal */
|
||||
|
||||
|
||||
float text_margin;
|
||||
int top = lrint (_height/2.0 - _diameter/2.0);
|
||||
int bottom = lrint (_height/2.0 + _diameter/2.0);
|
||||
int left;
|
||||
int right;
|
||||
if (_led_left) {
|
||||
left = 4;
|
||||
right = left + _diameter;
|
||||
|
||||
if (_width < 75) {
|
||||
text_margin = 3;
|
||||
} else {
|
||||
left = lrint (_width - 4 - _diameter/2.0);
|
||||
right = left + _diameter;
|
||||
text_margin = 10;
|
||||
}
|
||||
|
||||
top = _height/2.0;
|
||||
|
||||
if (_elements & Text) {
|
||||
if (_led_left) {
|
||||
left = text_margin;
|
||||
} else {
|
||||
left = _width - ((_diameter/2.0) + 4.0);
|
||||
}
|
||||
} else {
|
||||
left = _width/2.0 - _diameter/2.0;
|
||||
}
|
||||
|
||||
right = left + _diameter;
|
||||
|
||||
if (ev->x >= left && ev->x <= right && ev->y <= bottom && ev->y >= top) {
|
||||
signal_led_clicked(); /* EMIT SIGNAL */
|
||||
return true;
|
||||
@ -528,3 +542,9 @@ ArdourButton::action_toggled ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ArdourButton::on_style_changed (const RefPtr<Style>&)
|
||||
{
|
||||
set_colors ();
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ class ArdourButton : public CairoWidget
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
bool on_button_press_event (GdkEventButton*);
|
||||
bool on_button_release_event (GdkEventButton*);
|
||||
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
|
||||
|
||||
void controllable_changed ();
|
||||
PBD::ScopedConnection watch_connection;
|
||||
|
@ -203,10 +203,10 @@ ProcessorEntry::set_enum_width (Width w)
|
||||
void
|
||||
ProcessorEntry::led_clicked()
|
||||
{
|
||||
if (!_processor->active ()) {
|
||||
_processor->activate ();
|
||||
} else {
|
||||
if (_button.active_state() == CairoWidget::Active) {
|
||||
_processor->deactivate ();
|
||||
} else {
|
||||
_processor->activate ();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user