Merge pull request #3247 from benjamin-voisin/menu

Adding the ability to have dropdown menu for modules
This commit is contained in:
Alexis Rouillard
2024-07-01 09:18:13 +02:00
committed by GitHub
35 changed files with 611 additions and 2 deletions

View File

@ -27,6 +27,10 @@ class ALabel : public AModule {
bool handleToggle(GdkEventButton *const &e) override;
virtual std::string getState(uint8_t value, bool lesser = false);
std::map<std::string, GtkMenuItem *> submenus_;
std::map<std::string, std::string> menuActionsMap_;
static void handleGtkMenuEvent(GtkMenuItem *menuitem, gpointer data);
};
} // namespace waybar

View File

@ -2,6 +2,7 @@
#include <glibmm/dispatcher.h>
#include <glibmm/markup.h>
#include <gtkmm.h>
#include <gtkmm/eventbox.h>
#include <json/json.h>
@ -44,6 +45,7 @@ class AModule : public IModule {
virtual bool handleMouseLeave(GdkEventCrossing *const &ev);
virtual bool handleScroll(GdkEventScroll *);
virtual bool handleRelease(GdkEventButton *const &ev);
GObject *menu_;
private:
bool handleUserEvent(GdkEventButton *const &ev);