Merge pull request #2887 from dann-merlin/master

Add justify config option for Labels
This commit is contained in:
Alexis Rouillard
2024-03-05 09:01:44 +01:00
committed by GitHub
24 changed files with 126 additions and 24 deletions

View File

@ -50,6 +50,17 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
label_.set_xalign(align);
}
}
if (config_["justify"].isString()) {
auto justify_str = config_["justify"].asString();
if (justify_str == "left") {
label_.set_justify(Gtk::Justification::JUSTIFY_LEFT);
} else if (justify_str == "right") {
label_.set_justify(Gtk::Justification::JUSTIFY_RIGHT);
} else if (justify_str == "center") {
label_.set_justify(Gtk::Justification::JUSTIFY_CENTER);
}
}
}
auto ALabel::update() -> void { AModule::update(); }