Total spendings

This commit is contained in:
Quentin Boyer 2023-11-12 15:23:10 +01:00
parent 9e849349d4
commit c2bb26b8d5

View file

@ -542,7 +542,19 @@ impl Application for Glaurung {
items: &self.variable,
on_add: Message::AddVariable,
on_expr_edit: Message::EditVariable,
})
}),
horizontal_rule(SECTION_RULE).style(|theme: &Theme| {
let def = rule::StyleSheet::appearance(theme, &theme::Rule::Default);
rule::Appearance { width: 3, ..def }
}),
text(&format!(
"Total spendings: {} €",
self.recurring
.values()
.chain(self.variable.values().flat_map(|(_, f)| f))
.sum::<f64>()
))
.size(TEXT_EMPH2),
]
.max_width(500)
.padding(5)