iced-template: init
This commit is contained in:
commit
8f0abd2b78
8 changed files with 4192 additions and 0 deletions
30
src/app/mod.rs
Normal file
30
src/app/mod.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use iced::{Color, Element, Renderer, Task, Theme, application, theme, widget};
|
||||
|
||||
enum Message {}
|
||||
|
||||
struct State {}
|
||||
|
||||
impl State {
|
||||
fn new() -> Self {
|
||||
Self {}
|
||||
}
|
||||
fn update(&mut self, message: Message) -> Task<Message> {
|
||||
Task::none()
|
||||
}
|
||||
fn view(&self) -> Element<'_, Message, Theme, Renderer> {
|
||||
widget::text("hiiiiiii").into()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run() -> Result<(), impl std::error::Error> {
|
||||
application(State::new, State::update, State::view)
|
||||
.theme(theme::Theme::custom(
|
||||
"high-contrast-dark",
|
||||
theme::Palette {
|
||||
background: Color::from_rgb8(10, 10, 10),
|
||||
text: Color::WHITE,
|
||||
..theme::Palette::DARK
|
||||
},
|
||||
))
|
||||
.run()
|
||||
}
|
||||
5
src/main.rs
Normal file
5
src/main.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
mod app;
|
||||
|
||||
fn main() -> Result<(), impl std::error::Error> {
|
||||
app::run()
|
||||
}
|
||||
Loading…
Reference in a new issue