mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
697 B
30 lines
697 B
#pragma once |
|
#include <functional> |
|
#include <gtkmm.h> |
|
#include <string> |
|
#include <unordered_map> |
|
|
|
class Menu { |
|
Menu() = default; |
|
|
|
public: |
|
static Menu &get() { |
|
static Menu singleton; |
|
return singleton; |
|
} |
|
|
|
void add_action(const std::string &name, const std::function<void()> &action); |
|
std::unordered_map<std::string, Glib::RefPtr<Gio::SimpleAction>> actions; |
|
void set_keys(); |
|
|
|
void build(); |
|
|
|
Glib::RefPtr<Gio::Menu> juci_menu; |
|
Glib::RefPtr<Gio::Menu> window_menu; |
|
std::unique_ptr<Gtk::Menu> right_click_line_menu; |
|
std::unique_ptr<Gtk::Menu> right_click_selected_menu; |
|
std::function<void()> toggle_menu_items = [] {}; |
|
|
|
private: |
|
Glib::RefPtr<Gtk::Builder> builder; |
|
};
|
|
|