mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 12:45:45 +01:00
ArdourDropdown: new utility methods
This commit is contained in:
parent
5b7b3860b8
commit
9f49e6379d
2 changed files with 16 additions and 1 deletions
|
|
@ -168,6 +168,13 @@ ArdourDropdown::clear_items ()
|
|||
_menu.items ().clear ();
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::add_separator ()
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
add_menu_elem (SeparatorElem());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::add_menu_elem (Menu_Helpers::Element e)
|
||||
{
|
||||
|
|
@ -201,3 +208,9 @@ ArdourDropdown::append (Glib::RefPtr<Action> action)
|
|||
{
|
||||
_menu.items().push_back (Menu_Helpers::MenuElem (action->get_short_label(), sigc::mem_fun (action.get(), &Action::activate)));
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::append (Gtk::Menu& submenu, Glib::RefPtr<Action> action)
|
||||
{
|
||||
submenu.items().push_back (Menu_Helpers::MenuElem (action->get_short_label(), sigc::mem_fun (action.get(), &Action::activate)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,14 +45,16 @@ public:
|
|||
|
||||
void clear_items ();
|
||||
void add_menu_elem (Gtk::Menu_Helpers::Element e);
|
||||
void append_text_item (std::string const& text);
|
||||
void add_separator ();
|
||||
void append (Glib::RefPtr<Gtk::Action>);
|
||||
void append (Gtk::Menu&, Glib::RefPtr<Gtk::Action>);
|
||||
|
||||
void disable_scrolling();
|
||||
|
||||
Gtk::Menu_Helpers::MenuList& items () { return _menu.items (); }
|
||||
Gtk::Menu& menu () { return _menu; }
|
||||
|
||||
void append_text_item (std::string const& text);
|
||||
void set_active (std::string const& text);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue