Merge pull request #2703 from czadowanie/master

upower: show-icon config option
This commit is contained in:
Alexis Rouillard
2023-12-05 23:34:43 +01:00
committed by GitHub
3 changed files with 24 additions and 1 deletions

View File

@ -18,7 +18,15 @@ UPower::UPower(const std::string& id, const Json::Value& config)
m_Mutex(),
client(),
showAltText(false) {
box_.pack_start(icon_);
// Show icon only when "show-icon" isn't set to false
if (config_["show-icon"].isBool()) {
showIcon = config_["show-icon"].asBool();
}
if (showIcon) {
box_.pack_start(icon_);
}
box_.pack_start(label_);
box_.set_name(name_);
event_box_.add(box_);