Skip to content

Commit

Permalink
refactor(Tray): also search in default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Apr 11, 2019
1 parent 7806746 commit 57c99dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/modules/sni/item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Item : public sigc::trackable {

Glib::RefPtr<Gio::Cancellable> cancellable_;
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
std::vector<Glib::ustring> default_icon_path_;
bool update_pending_;
};

Expand Down
5 changes: 4 additions & 1 deletion src/modules/sni/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ waybar::modules::SNI::Item::Item(std::string bn, std::string op, const Json::Val
if (config["icon-size"].isUInt()) {
icon_size = config["icon-size"].asUInt();
}
default_icon_path_ = Gtk::IconTheme::get_default()->get_search_path();
event_box.add(image);
event_box.add_events(Gdk::BUTTON_PRESS_MASK);
event_box.signal_button_press_event().connect(
Expand Down Expand Up @@ -94,7 +95,9 @@ waybar::modules::SNI::Item::setProperty(const ustring& name,
} else if (name == "IconThemePath") {
icon_theme_path = get_variant<std::string>(value);
if (!icon_theme_path.empty()) {
icon_theme->set_search_path({icon_theme_path});
std::vector<Glib::ustring> paths(default_icon_path_);
paths.push_back(icon_theme_path);
icon_theme->set_search_path(paths);
}
} else if (name == "Menu") {
menu = get_variant<std::string>(value);
Expand Down

0 comments on commit 57c99dc

Please sign in to comment.