Skip to content

Commit

Permalink
Merge branch 'master' into pr/anakael/sway-language-impr
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays authored Jul 23, 2021
2 parents 100d4d3 + b33be38 commit b47705a
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Dockerfiles/debian
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
FROM debian:sid

RUN apt-get update && \
apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev && \
apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry0 && \
apt-get clean
22 changes: 19 additions & 3 deletions include/modules/sni/item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@
#include <libdbusmenu-gtk/dbusmenu-gtk.h>
#include <sigc++/trackable.h>

#include <set>
#include <string_view>

namespace waybar::modules::SNI {

struct ToolTip {
Glib::ustring icon_name;
Glib::ustring text;
};

class Item : public sigc::trackable {
public:
Item(const std::string&, const std::string&, const Json::Value&);
Expand All @@ -27,10 +35,8 @@ class Item : public sigc::trackable {
Gtk::EventBox event_box;
std::string category;
std::string id;
std::string status;

std::string title;
int32_t window_id;
std::string icon_name;
Glib::RefPtr<Gdk::Pixbuf> icon_pixmap;
Glib::RefPtr<Gtk::IconTheme> icon_theme;
Expand All @@ -39,6 +45,7 @@ class Item : public sigc::trackable {
std::string attention_movie_name;
std::string icon_theme_path;
std::string menu;
ToolTip tooltip;
DbusmenuGtkMenu* dbus_menu = nullptr;
Gtk::Menu* gtk_menu = nullptr;
/**
Expand All @@ -51,6 +58,7 @@ class Item : public sigc::trackable {
private:
void proxyReady(Glib::RefPtr<Gio::AsyncResult>& result);
void setProperty(const Glib::ustring& name, Glib::VariantBase& value);
void setStatus(const Glib::ustring& value);
void getUpdatedProperties();
void processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& result);
void onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
Expand All @@ -62,10 +70,18 @@ class Item : public sigc::trackable {
static void onMenuDestroyed(Item* self, GObject* old_menu_pointer);
void makeMenu();
bool handleClick(GdkEventButton* const& /*ev*/);
bool handleScroll(GdkEventScroll* const&);

// smooth scrolling threshold
gdouble scroll_threshold_ = 0;
gdouble distance_scrolled_x_ = 0;
gdouble distance_scrolled_y_ = 0;
// visibility of items with Status == Passive
bool show_passive_ = false;

Glib::RefPtr<Gio::DBus::Proxy> proxy_;
Glib::RefPtr<Gio::Cancellable> cancellable_;
bool update_pending_;
std::set<std::string_view> update_pending_;
};

} // namespace waybar::modules::SNI
12 changes: 12 additions & 0 deletions man/waybar-tray.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ Addressed by *tray*
typeof: integer ++
Defines the size of the tray icons.

*show-passive-items*: ++
typeof: bool ++
default: false ++
Defines visibility of the tray icons with *Passive* status.

*smooth-scrolling-threshold*: ++
typeof: double ++
Threshold to be used when scrolling.

*spacing*: ++
typeof: integer ++
Defines the spacing between the tray icons.
Expand All @@ -37,3 +46,6 @@ Addressed by *tray*
# STYLE

- *#tray*
- *#tray > .passive*
- *#tray > .active*
- *#tray > .needs-attention*
9 changes: 9 additions & 0 deletions resources/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ label:focus {
background-color: #2980b9;
}

#tray > .passive {
-gtk-icon-effect: dim;
}

#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}

#idle_inhibitor {
background-color: #2d3436;
}
Expand Down
Loading

0 comments on commit b47705a

Please sign in to comment.