aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-08-17 07:07:50 -0400
committerJesse Luehrs <doy@tozt.net>2019-08-17 07:12:24 -0400
commit31ab49d6d3661e7d8afd4d89ba4715a81a82079d (patch)
treefcae38b02efce2009a4857cfdebb077c5956ab63
parent6011682296a68302ff151e7a085a9d60d4afb8be (diff)
downloadynab-reimbursements-31ab49d6d3661e7d8afd4d89ba4715a81a82079d.tar.gz
ynab-reimbursements-31ab49d6d3661e7d8afd4d89ba4715a81a82079d.zip
add a border around the dialogs
-rw-r--r--src/display.rs2
-rw-r--r--src/views/txn_table.rs13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/display.rs b/src/display.rs
index 5380c5f..cbe0459 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -8,7 +8,7 @@ pub fn theme() -> cursive::theme::Theme {
cursive::theme::Color::TerminalDefault;
cursive::theme::Theme {
shadow: false,
- borders: cursive::theme::BorderStyle::None,
+ borders: cursive::theme::BorderStyle::Simple,
palette,
}
}
diff --git a/src/views/txn_table.rs b/src/views/txn_table.rs
index c952ebc..5c6dcd1 100644
--- a/src/views/txn_table.rs
+++ b/src/views/txn_table.rs
@@ -149,12 +149,9 @@ fn txn_table(
outflows.iter().chain(inflows.iter()).collect();
let err = budget.reconcile_transactions(&txns);
if let Some(err) = err {
- s.add_layer(cursive::views::Dialog::info(format!(
- "Error: {}",
- err
- )))
+ s.add_layer(dialog(&format!("Error: {}", err)))
} else {
- s.add_layer(cursive::views::Dialog::info(format!(
+ s.add_layer(dialog(&format!(
"Successfully updated {} transactions",
txns.len()
)));
@@ -192,7 +189,7 @@ fn txn_table(
.unwrap();
}
} else {
- s.add_layer(cursive::views::Dialog::info(format!(
+ s.add_layer(dialog(&format!(
"Selected amount is {}, must be 0",
crate::ynab::format_amount(total_amount)
)))
@@ -393,3 +390,7 @@ fn render_selected_total(s: &mut cursive::Cursive) {
v.set_content(sstr);
});
}
+
+fn dialog(s: &str) -> impl cursive::view::View {
+ cursive::views::Panel::new(cursive::views::Dialog::info(s))
+}