Resolve the duplicate widget insertion warning

This commit is contained in:
Savanni D'Gerinel 2024-02-19 18:04:45 -05:00
parent a5d51dab70
commit 0032f16422
2 changed files with 6 additions and 7 deletions

View File

@ -84,24 +84,24 @@ impl DaySummary {
let row = gtk::Box::builder().build(); let row = gtk::Box::builder().build();
let label = gtk::Label::builder() let weight_label = gtk::Label::builder()
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.css_classes(["day-summary__weight"]) .css_classes(["day-summary__weight"])
.build(); .build();
if let Some(w) = view_model.weight() { if let Some(w) = view_model.weight() {
label.set_label(&w.to_string()) weight_label.set_label(&w.to_string())
} }
let label = gtk::Label::builder() let steps_label = gtk::Label::builder()
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.css_classes(["day-summary__steps"]) .css_classes(["day-summary__steps"])
.build(); .build();
if let Some(s) = view_model.steps() { if let Some(s) = view_model.steps() {
label.set_label(&format!("{} steps", s)); steps_label.set_label(&format!("{} steps", s));
} }
row.append(&label); row.append(&weight_label);
row.append(&label); row.append(&steps_label);
self.append(&row); self.append(&row);
for activity in TIME_DISTANCE_ACTIVITIES { for activity in TIME_DISTANCE_ACTIVITIES {

View File

@ -145,7 +145,6 @@ impl HistoricalView {
let mut days = interval.days().map(Date::new).collect::<Vec<Date>>(); let mut days = interval.days().map(Date::new).collect::<Vec<Date>>();
days.reverse(); days.reverse();
model.extend(days.into_iter()); model.extend(days.into_iter());
// model.extend(interval.days().map(Date::new));
self.imp() self.imp()
.list_view .list_view
.set_model(Some(&gtk::NoSelection::new(Some(model)))); .set_model(Some(&gtk::NoSelection::new(Some(model))));