Fix warning if swap-icon-label is not defined in config

This commit is contained in:
zjeffer
2025-08-11 19:56:58 +02:00
parent 556c5f5a30
commit 3c3164eb8e

View File

@ -36,10 +36,12 @@ AIconLabel::AIconLabel(const Json::Value &config, const std::string &name, const
box_.set_spacing(spacing); box_.set_spacing(spacing);
bool swap_icon_label = false; bool swap_icon_label = false;
if (not config_["swap-icon-label"].isBool()) if (config_.isMember("swap-icon-label")) {
spdlog::warn("'swap-icon-label' must be a bool."); if (!config_["swap-icon-label"].isBool())
else spdlog::warn("'swap-icon-label' must be a bool.");
swap_icon_label = config_["swap-icon-label"].asBool(); else
swap_icon_label = config_["swap-icon-label"].asBool();
}
if ((rot == 0 || rot == 3) ^ swap_icon_label) { if ((rot == 0 || rot == 3) ^ swap_icon_label) {
box_.add(image_); box_.add(image_);