1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| | // SPDX-License-Identifier: EUPL-1.2+
// SPDX-FileCopyrightText: 2025 Johannes Süllner <johannes.suellner@mailbox.org>
use iced::{Subscription, Task};
mod completion;
mod confirmation;
mod disk_selection;
mod installation;
mod layout;
mod welcome;
pub const WINDOW_WIDTH: f32 = 750.0;
pub const WINDOW_HEIGHT: f32 = 650.0;
pub const MARGIN_VERTICAL: f32 = 25.0;
pub const MARGIN_LR: f32 = 15.0;
pub const BUTTON_TEXT_SIZE: u32 = 20;
pub const TITLE_TEXT_SIZE: u32 = 24;
type UpdateResult = (Option<Box<dyn Page>>, Task<Event>);
type InstallResult = Result<String, (u32, String)>;
pub trait Page {
fn update(&mut self, event: Event) -> UpdateResult;
fn view(&self) -> iced::Element<'_, Event>;
fn subscription(&self) -> Subscription<Event> {
Subscription::none()
}
}
#[derive(Clone, Debug)]
pub enum Event {
/* Pages are ordered as they appear during the installation. */
PageWelcome(welcome::PageWelcomeEvent),
PageDiskSelection(disk_selection::PageDiskSelectionEvent),
PageConfirmation(confirmation::PageConfirmationEvent),
PageInstallation(installation::PageInstallationEvent),
PageCompletion(completion::PageCompletionEvent),
}
pub const INITAL_PAGE: welcome::PageWelcome = welcome::PageWelcome {};
|