Align the currently selected automation state on dropdown
By passing the current text of the automation button we can make the dropdown menu align with the current mode. This will only work for full-size automation buttons, not when use-knob is true, but in that case it feels wrong to popup on top of the button anyway. Also make the menu show on mouse down like a real dropdown.
This commit is contained in:
parent
9702020929
commit
606ffe6a35
@ -830,9 +830,10 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
|||||||
control_ui->automate_button.set_sensitive (false);
|
control_ui->automate_button.set_sensitive (false);
|
||||||
set_tooltip(control_ui->automate_button, _("This control cannot be automated"));
|
set_tooltip(control_ui->automate_button, _("This control cannot be automated"));
|
||||||
} else {
|
} else {
|
||||||
control_ui->automate_button.signal_clicked.connect (sigc::bind (
|
control_ui->automate_button.signal_button_press_event().connect (
|
||||||
sigc::mem_fun(*this, &GenericPluginUI::astate_clicked),
|
sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::astate_button_event),
|
||||||
control_ui));
|
control_ui),
|
||||||
|
false);
|
||||||
mcontrol->alist()->automation_state_changed.connect (
|
mcontrol->alist()->automation_state_changed.connect (
|
||||||
control_connections,
|
control_connections,
|
||||||
invalidator (*this),
|
invalidator (*this),
|
||||||
@ -932,9 +933,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
|||||||
return control_ui;
|
return control_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
GenericPluginUI::astate_clicked (ControlUI* cui)
|
GenericPluginUI::astate_button_event (GdkEventButton* ev, ControlUI* cui)
|
||||||
{
|
{
|
||||||
|
if (ev->button != 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
using namespace Menu_Helpers;
|
using namespace Menu_Helpers;
|
||||||
|
|
||||||
if (automation_menu == 0) {
|
if (automation_menu == 0) {
|
||||||
@ -955,7 +960,10 @@ GenericPluginUI::astate_clicked (ControlUI* cui)
|
|||||||
items.push_back (MenuElem (_("Touch"),
|
items.push_back (MenuElem (_("Touch"),
|
||||||
sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Touch, cui)));
|
sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Touch, cui)));
|
||||||
|
|
||||||
anchored_menu_popup(automation_menu, &cui->automate_button, "", 1, gtk_get_current_event_time());
|
anchored_menu_popup(automation_menu, &cui->automate_button, cui->automate_button.get_text(),
|
||||||
|
1, ev->time);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -287,7 +287,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
|
|||||||
void update_input_displays (); // workaround for preset load
|
void update_input_displays (); // workaround for preset load
|
||||||
void control_combo_changed (ControlUI* cui, float value);
|
void control_combo_changed (ControlUI* cui, float value);
|
||||||
|
|
||||||
void astate_clicked (ControlUI*);
|
bool astate_button_event (GdkEventButton* ev, ControlUI*);
|
||||||
void automation_state_changed (ControlUI*);
|
void automation_state_changed (ControlUI*);
|
||||||
void set_automation_state (ARDOUR::AutoState state, ControlUI* cui);
|
void set_automation_state (ARDOUR::AutoState state, ControlUI* cui);
|
||||||
void set_all_automation (ARDOUR::AutoState state);
|
void set_all_automation (ARDOUR::AutoState state);
|
||||||
|
Loading…
Reference in New Issue
Block a user