feat: improve default spacing and add to config

pull/2973/head
Azazel 2024-02-25 22:56:52 +00:00
parent 0ead42e52b
commit 3a5aa5ee83
1 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,14 @@ AIconLabel::AIconLabel(const Json::Value &config, const std::string &name, const
: ALabel(config, name, id, format, interval, ellipsize, enable_click, enable_scroll) { : ALabel(config, name, id, format, interval, ellipsize, enable_click, enable_scroll) {
event_box_.remove(); event_box_.remove();
box_.set_orientation(Gtk::Orientation::ORIENTATION_HORIZONTAL); box_.set_orientation(Gtk::Orientation::ORIENTATION_HORIZONTAL);
box_.set_spacing(8);
// set aesthetic default spacing
int spacing = config_["icon-spacing"].isInt() ? config_["icon-spacing"].asInt() : -5;
box_.set_spacing(spacing);
int margin_top = config_["margin-top"].isInt() ? config_["margin-top"].asInt() : 6;
box_.set_margin_top(margin_top);
box_.add(image_); box_.add(image_);
box_.add(label_); box_.add(label_);
event_box_.add(box_); event_box_.add(box_);