aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-08-19 00:19:38 -0400
committerJesse Luehrs <doy@tozt.net>2019-08-19 00:19:38 -0400
commitaa52e632b866b51d455787a96bcd2f5a63b7ac89 (patch)
tree7e947c62510404f6233be24c303d7fb6f455be0d /src/app.rs
parent3539ceb20f5383a332a8ad1fcab816cf083f277e (diff)
downloadynab-api-aa52e632b866b51d455787a96bcd2f5a63b7ac89.tar.gz
ynab-api-aa52e632b866b51d455787a96bcd2f5a63b7ac89.zip
move ynab-api to its own repository
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/app.rs b/src/app.rs
deleted file mode 100644
index 22bf543..0000000
--- a/src/app.rs
+++ /dev/null
@@ -1,46 +0,0 @@
-pub struct App {
- cursive: cursive::Cursive,
-}
-
-impl App {
- pub fn new(budget: crate::ynab::Budget) -> Self {
- let mut app = cursive::Cursive::default();
- let term_width = app.screen_size().x;
- app.set_theme(Self::theme());
- app.add_global_callback('q', |s| s.quit());
-
- let mut layout = cursive::views::LinearLayout::vertical();
- layout.add_child(cursive::views::TextView::new(format!(
- "Budget: {} ({})\n{}",
- budget.name(),
- budget.id(),
- "=".repeat(term_width),
- )));
-
- layout.add_child(crate::views::TxnTables::new("txn_tables", &budget));
-
- app.set_user_data(budget);
- app.add_fullscreen_layer(layout);
-
- Self { cursive: app }
- }
-
- pub fn run(&mut self) {
- self.cursive.run();
- }
-
- fn theme() -> cursive::theme::Theme {
- let mut palette = cursive::theme::Palette::default();
- palette[cursive::theme::PaletteColor::Background] =
- cursive::theme::Color::TerminalDefault;
- palette[cursive::theme::PaletteColor::View] =
- cursive::theme::Color::TerminalDefault;
- palette[cursive::theme::PaletteColor::Primary] =
- cursive::theme::Color::TerminalDefault;
- cursive::theme::Theme {
- shadow: false,
- borders: cursive::theme::BorderStyle::Simple,
- palette,
- }
- }
-}