feat: move name and classes from label_ to box_
This commit is contained in:
parent
3a5aa5ee83
commit
16aced7f9f
|
@ -9,17 +9,20 @@ AIconLabel::AIconLabel(const Json::Value &config, const std::string &name, const
|
|||
bool enable_click, bool enable_scroll)
|
||||
: ALabel(config, name, id, format, interval, ellipsize, enable_click, enable_scroll) {
|
||||
event_box_.remove();
|
||||
label_.unset_name();
|
||||
label_.get_style_context()->remove_class(MODULE_CLASS);
|
||||
box_.get_style_context()->add_class(MODULE_CLASS);
|
||||
if (!id.empty()) {
|
||||
label_.get_style_context()->remove_class(id);
|
||||
box_.get_style_context()->add_class(id);
|
||||
}
|
||||
|
||||
box_.set_orientation(Gtk::Orientation::ORIENTATION_HORIZONTAL);
|
||||
|
||||
// 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_.set_name(name);
|
||||
|
||||
box_.add(image_);
|
||||
box_.add(label_);
|
||||
|
||||
event_box_.add(box_);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue