mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
add common align
config property to set text alignment
add fixed-length property to set the fixed width of the label
This commit is contained in:
parent
be777b8525
commit
8c70513a24
@ -28,6 +28,15 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st
|
||||
label_.set_single_line_mode(true);
|
||||
}
|
||||
|
||||
if (config_["fixed-length"].isUInt()) {
|
||||
label_.set_width_chars(config_["fixed-length"].asUInt());
|
||||
}
|
||||
|
||||
if (config_["align"].isDouble()) {
|
||||
auto align = config_["align"].asFloat();
|
||||
label_.set_xalign(align);
|
||||
}
|
||||
|
||||
if (config_["rotate"].isUInt()) {
|
||||
label_.set_angle(config["rotate"].asUInt());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user