add tray icons
This commit is contained in:
@@ -5,6 +5,12 @@
|
||||
#include <gtkmm/gestureclick.h>
|
||||
#include <gtkmm/picture.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/popovermenu.h>
|
||||
#include <giomm/menumodel.h>
|
||||
#include <giomm/menu.h>
|
||||
#include <giomm/menuitem.h>
|
||||
#include <giomm/simpleaction.h>
|
||||
#include <giomm/simpleactiongroup.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@@ -26,9 +32,23 @@ class TrayIconWidget : public Gtk::Button
|
||||
Gtk::Picture m_picture;
|
||||
Gtk::Image m_image;
|
||||
Glib::RefPtr<Gtk::GestureClick> m_secondaryGesture;
|
||||
Glib::RefPtr<Gtk::PopoverMenu> m_menuPopover;
|
||||
Glib::RefPtr<Gio::SimpleActionGroup> m_menuActions;
|
||||
Glib::RefPtr<Gio::MenuModel> m_menuModel;
|
||||
sigc::connection m_menuChangedConnection;
|
||||
bool m_menuPopupPending = false;
|
||||
double m_pendingX = 0.0;
|
||||
double m_pendingY = 0.0;
|
||||
|
||||
void on_primary_clicked();
|
||||
void on_secondary_released(int n_press, double x, double y);
|
||||
bool ensure_menu();
|
||||
void on_menu_items_changed(guint position, guint removed, guint added);
|
||||
void try_popup();
|
||||
void populate_menu_items(const std::vector<TrayService::MenuNode> &nodes,
|
||||
const Glib::RefPtr<Gio::Menu> &menu,
|
||||
const Glib::RefPtr<Gio::SimpleActionGroup> &actions);
|
||||
void on_menu_action(const Glib::VariantBase ¶meter, int itemId);
|
||||
};
|
||||
|
||||
class TrayWidget : public Gtk::Box
|
||||
|
||||
Reference in New Issue
Block a user