Allow left-click on MetaButton Dropdown indicator

This commit is contained in:
Robin Gareus 2025-01-28 17:38:38 +01:00
parent ccc2273d54
commit fb6b64f736
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 90 additions and 19 deletions

View file

@ -39,15 +39,16 @@ class LIBWIDGETS_API ArdourButton : public CairoWidget , public Gtkmm2ext::Activ
{
public:
enum Element {
Edge = 0x1,
Body = 0x2,
Text = 0x4,
Indicator = 0x8,
ColorBox = 0x18, //also sets Indicator
Menu = 0x20,
Inactive = 0x40, // no _action is defined AND state is not used
VectorIcon = 0x80,
IconRenderCallback = 0x100,
Edge = 0x001,
Body = 0x002,
Text = 0x004,
Indicator = 0x008,
ColorBox = 0x018, // also sets Indicator
Menu = 0x020,
MetaMenu = 0x040,
Inactive = 0x080, // no _action is defined AND state is not used
VectorIcon = 0x100,
IconRenderCallback = 0x200,
};
typedef void (* rendercallback_t) (cairo_t*, int, int, uint32_t, void*);

View file

@ -45,7 +45,9 @@ public:
protected:
bool on_button_press_event (GdkEventButton*);
bool on_motion_notify_event (GdkEventMotion*);
void menu_size_request (Gtk::Requisition*);
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
private:
class MetaMenuItem : public Gtk::MenuItem
@ -95,9 +97,11 @@ private:
};
void activate_item (MetaMenuItem const*);
void update_button (MetaMenuItem const*);
Gtk::Menu _menu;
guint _active;
bool _hover_dropdown;
};
} // namespace ArdourWidgets