Add justify config option for Labels
This is especially useful for centering labels on vertical bars.
This commit is contained in:
parent
4c5ff80bbd
commit
89b3203bfa
|
@ -49,6 +49,17 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
|
||||||
label_.set_xalign(align);
|
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(); }
|
auto ALabel::update() -> void { AModule::update(); }
|
||||||
|
|
Loading…
Reference in New Issue