mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Handle case where a custom MenuElem is added to the dropdown
This commit is contained in:
parent
469f3e4d2a
commit
43e4e428f5
1 changed files with 5 additions and 2 deletions
|
|
@ -82,11 +82,14 @@ ArdourDropdown::on_button_press_event (GdkEventButton* ev)
|
|||
void
|
||||
ArdourDropdown::set_active (std::string const& text)
|
||||
{
|
||||
LblMenuItem const* current_active = dynamic_cast<LblMenuItem*> (_menu.get_active ());
|
||||
if (current_active && current_active->label() == text) {
|
||||
MenuItem const* current_active = _menu.get_active();
|
||||
LblMenuItem const* current_lblitem = dynamic_cast<LblMenuItem const*> (current_active);
|
||||
|
||||
if ((current_lblitem && current_lblitem->label() == text) || (current_active && current_active->get_label() == text)) {
|
||||
set_text (text);
|
||||
return;
|
||||
}
|
||||
|
||||
using namespace Menu_Helpers;
|
||||
int c = 0;
|
||||
for (auto& i : _menu.items()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue