Introduce Program API
This commit is contained in:
parent
0524e9b457
commit
c22269bff3
43 changed files with 1141 additions and 831 deletions
|
|
@ -3,10 +3,13 @@ use iced::widget::{
|
|||
progress_bar, row, scrollable, slider, text, text_input, toggler,
|
||||
vertical_rule, vertical_space,
|
||||
};
|
||||
use iced::{Alignment, Element, Length, Sandbox, Settings, Theme};
|
||||
use iced::{Alignment, Element, Length, Theme};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
Styling::run(Settings::default())
|
||||
iced::sandbox(Styling::update, Styling::view)
|
||||
.theme(Styling::theme)
|
||||
.title("Styling - Iced")
|
||||
.run()
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
@ -28,17 +31,7 @@ enum Message {
|
|||
TogglerToggled(bool),
|
||||
}
|
||||
|
||||
impl Sandbox for Styling {
|
||||
type Message = Message;
|
||||
|
||||
fn new() -> Self {
|
||||
Styling::default()
|
||||
}
|
||||
|
||||
fn title(&self) -> String {
|
||||
String::from("Styling - Iced")
|
||||
}
|
||||
|
||||
impl Styling {
|
||||
fn update(&mut self, message: Message) {
|
||||
match message {
|
||||
Message::ThemeChanged(theme) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue