mirror of
https://github.com/13hannes11/toolbx-tuner.git
synced 2024-09-03 23:21:00 +02:00
refactor into separate files for app structure
This commit is contained in:
31
src/ui/app/model.rs
Normal file
31
src/ui/app/model.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use relm4::{factory::FactoryVec, Model};
|
||||
|
||||
use crate::ui::components::toolbox_settings::model::AppComponents;
|
||||
|
||||
use super::{messages::AppMsg, widgets::AppWidgets};
|
||||
|
||||
pub struct AppModel {
|
||||
pub toolboxes: FactoryVec<ToolboxContainer>,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ToolboxContainer {
|
||||
pub name: String,
|
||||
pub status: ToolboxStatus,
|
||||
pub update_available: bool,
|
||||
}
|
||||
impl Model for AppModel {
|
||||
type Msg = AppMsg;
|
||||
type Widgets = AppWidgets;
|
||||
type Components = AppComponents;
|
||||
}
|
||||
|
||||
pub enum ToolboxStatus {
|
||||
Stopped,
|
||||
Running,
|
||||
}
|
||||
impl Default for ToolboxStatus {
|
||||
fn default() -> Self {
|
||||
ToolboxStatus::Stopped
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user