Compare commits
2 commits
578cc7723c
...
d0a084c60c
Author | SHA1 | Date | |
---|---|---|---|
d0a084c60c | |||
cf9b557446 |
1 changed files with 9 additions and 2 deletions
11
src/main.rs
11
src/main.rs
|
@ -6,7 +6,7 @@ use std::{
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use eframe::egui::{self, Key, TextEdit};
|
use eframe::egui::{self, Key, TextEdit, ViewportBuilder};
|
||||||
|
|
||||||
enum RunError {
|
enum RunError {
|
||||||
HomeDir(homedir::GetHomeError),
|
HomeDir(homedir::GetHomeError),
|
||||||
|
@ -45,7 +45,10 @@ fn main() -> Result<(), RunError> {
|
||||||
.open(Path::join(&home_dir, "todo.txt"))
|
.open(Path::join(&home_dir, "todo.txt"))
|
||||||
.map_err(RunError::OpenFile)?;
|
.map_err(RunError::OpenFile)?;
|
||||||
|
|
||||||
let native_options = eframe::NativeOptions::default();
|
let native_options = eframe::NativeOptions {
|
||||||
|
viewport: ViewportBuilder::default().with_app_id("todoodoo"),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
"To-DooDoo",
|
"To-DooDoo",
|
||||||
native_options,
|
native_options,
|
||||||
|
@ -93,4 +96,8 @@ impl eframe::App for ToDooDooApp {
|
||||||
ui.add_sized(ui.available_size(), TextEdit::multiline(&mut self.notes));
|
ui.add_sized(ui.available_size(), TextEdit::multiline(&mut self.notes));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn save(&mut self, _storage: &mut dyn eframe::Storage) {
|
||||||
|
self.save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue