mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
refactor: format tray && partial fix for #235
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <dbus-status-notifier-item.h>
|
||||
#include <glibmm/refptr.h>
|
||||
#include <giomm/dbusproxy.h>
|
||||
#include <glibmm/refptr.h>
|
||||
#include <gtkmm/eventbox.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/icontheme.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/menu.h>
|
||||
#include <json/json.h>
|
||||
#include <libdbusmenu-gtk/dbusmenu-gtk.h>
|
||||
@ -19,7 +19,7 @@
|
||||
namespace waybar::modules::SNI {
|
||||
|
||||
class Item : public sigc::trackable {
|
||||
public:
|
||||
public:
|
||||
Item(std::string, std::string, const Json::Value&);
|
||||
~Item() = default;
|
||||
|
||||
@ -44,24 +44,24 @@ public:
|
||||
std::string attention_movie_name;
|
||||
std::string icon_theme_path;
|
||||
std::string menu;
|
||||
DbusmenuGtkMenu *dbus_menu = nullptr;
|
||||
Gtk::Menu *gtk_menu = nullptr;
|
||||
DbusmenuGtkMenu* dbus_menu = nullptr;
|
||||
Gtk::Menu* gtk_menu = nullptr;
|
||||
bool item_is_menu;
|
||||
|
||||
private:
|
||||
private:
|
||||
void proxyReady(Glib::RefPtr<Gio::AsyncResult>& result);
|
||||
void setProperty(const Glib::ustring& name, Glib::VariantBase& value);
|
||||
void getUpdatedProperties();
|
||||
void processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& result);
|
||||
void onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
|
||||
const Glib::VariantContainerBase& arguments);
|
||||
const Glib::VariantContainerBase& arguments);
|
||||
|
||||
void updateImage();
|
||||
Glib::RefPtr<Gdk::Pixbuf> extractPixBuf(GVariant *variant);
|
||||
Glib::RefPtr<Gdk::Pixbuf> extractPixBuf(GVariant* variant);
|
||||
Glib::RefPtr<Gdk::Pixbuf> getIconByName(std::string name, int size);
|
||||
static void onMenuDestroyed(Item *self);
|
||||
bool makeMenu(GdkEventButton *const &ev);
|
||||
bool handleClick(GdkEventButton *const & /*ev*/);
|
||||
static void onMenuDestroyed(Item* self);
|
||||
bool makeMenu(GdkEventButton* const& ev);
|
||||
bool handleClick(GdkEventButton* const& /*ev*/);
|
||||
|
||||
Glib::RefPtr<Gio::Cancellable> cancellable_;
|
||||
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
|
||||
@ -69,4 +69,4 @@ private:
|
||||
bool update_pending_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::SNI
|
||||
} // namespace waybar::modules::SNI
|
||||
|
Reference in New Issue
Block a user