From 5396ffb71fa4169d031776de6ff96af09059e39b Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:22:32 +0100 Subject: [PATCH] Added "icon-size" and "hide-if-empty" config options --- src/modules/upower/upower.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/upower/upower.cpp b/src/modules/upower/upower.cpp index 1575c878..0e6796c4 100644 --- a/src/modules/upower/upower.cpp +++ b/src/modules/upower/upower.cpp @@ -18,8 +18,17 @@ UPower::UPower(const std::string& id, const Json::Value& config) box_.pack_start(label_); event_box_.add(box_); + // Icon Size + if (config_["icon-size"].isUInt()) { + iconSize = config_["icon-size"].asUInt(); + } icon_.set_pixel_size(iconSize); + // Hide If Empty + if (config_["hide-if-empty"].isBool()) { + hideIfEmpty = config_["hide-if-empty"].asBool(); + } + GError* error = NULL; client = up_client_new_full(NULL, &error); if (client == NULL) {