mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #1271 from alebastr/sni-passive-visibility
fix(tray): fix visibility of Passive items
This commit is contained in:
commit
7af6e8413c
@ -62,6 +62,7 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf
|
|||||||
event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick));
|
event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick));
|
||||||
event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll));
|
event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll));
|
||||||
// initial visibility
|
// initial visibility
|
||||||
|
event_box.show_all();
|
||||||
event_box.set_visible(show_passive_);
|
event_box.set_visible(show_passive_);
|
||||||
|
|
||||||
cancellable_ = Gio::Cancellable::create();
|
cancellable_ = Gio::Cancellable::create();
|
||||||
|
@ -35,11 +35,8 @@ void Tray::onRemove(std::unique_ptr<Item>& item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto Tray::update() -> void {
|
auto Tray::update() -> void {
|
||||||
if (box_.get_children().empty()) {
|
// Show tray only when items are availale
|
||||||
box_.hide();
|
box_.set_visible(!box_.get_children().empty());
|
||||||
} else {
|
|
||||||
box_.show_all();
|
|
||||||
}
|
|
||||||
// Call parent update
|
// Call parent update
|
||||||
AModule::update();
|
AModule::update();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user