Skip to content

Commit

Permalink
Add main
Browse files Browse the repository at this point in the history
  • Loading branch information
Mroik committed May 7, 2024
1 parent 83fb075 commit c9c026e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
ui::Renderer,
};

struct App {
pub struct App {
model: Fitch,
renderer: Renderer,
state: State,
Expand All @@ -15,7 +15,7 @@ struct App {
}

impl App {
fn new() -> std::io::Result<App> {
pub fn new() -> std::io::Result<App> {
let mut app = App {
model: Fitch::new(),
renderer: Renderer::new()?,
Expand All @@ -38,7 +38,7 @@ impl App {
}
}

fn listen(&mut self) {
pub fn listen(&mut self) {
loop {
if self.state == State::Quit {
break;
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ mod fitch;
mod parser;
mod ui;

use app::App;

fn main() {
println!("Hello, world!");
let mut app = App::new().unwrap();
app.listen();
}
4 changes: 2 additions & 2 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ fn expression_box_area(whole: Rect) -> Rect {
let temp = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(whole.height / 2 - 1),
Constraint::Length(1),
Constraint::Length(whole.height / 2 - 3),
Constraint::Length(3),
Constraint::Length(whole.height / 2),
])
.split(whole)[1];
Expand Down

0 comments on commit c9c026e

Please sign in to comment.