refactor: avoid useless has_class check

This commit is contained in:
Alexis
2018-08-10 17:05:12 +02:00
parent 9e85c68fc8
commit 4d3879f26f
4 changed files with 9 additions and 9 deletions

View File

@ -42,9 +42,9 @@ auto waybar::modules::Workspaces::update() -> void
} else {
auto styleContext = it->second.get_style_context();
bool isCurrent = node["focused"].asBool();
if (styleContext->has_class("current") && !isCurrent) {
if (!isCurrent) {
styleContext->remove_class("current");
} else if (!styleContext->has_class("current") && isCurrent) {
} else if (isCurrent) {
styleContext->add_class("current");
}
if (hided) {