feat(Bar): handle widget size changes

This commit is contained in:
Alex
2019-04-24 12:37:24 +02:00
parent 90d89fe974
commit 311c34ecbc
28 changed files with 175 additions and 137 deletions

View File

@ -19,7 +19,7 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar&
}
waybar::modules::IdleInhibitor::~IdleInhibitor() {
if (idle_inhibitor_) {
if (idle_inhibitor_ != nullptr) {
zwp_idle_inhibitor_v1_destroy(idle_inhibitor_);
idle_inhibitor_ = nullptr;
}
@ -41,7 +41,7 @@ auto waybar::modules::IdleInhibitor::update() -> void {
bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) {
if (e->button == 1) {
label_.get_style_context()->remove_class(status_);
if (idle_inhibitor_) {
if (idle_inhibitor_ != nullptr) {
zwp_idle_inhibitor_v1_destroy(idle_inhibitor_);
idle_inhibitor_ = nullptr;
status_ = "deactivated";