diff --git a/code/src/app.rs b/code/src/app.rs index 8d49f34..8e9f6cb 100644 --- a/code/src/app.rs +++ b/code/src/app.rs @@ -40,7 +40,24 @@ impl Default for App{ Tab{ tab_type: TabTypes::Worker, title: "Сотрудники".to_owned(), + }, + Tab{ + tab_type: TabTypes::Salary, + title:"Выплаты".to_owned(), + }, + Tab{ + tab_type: TabTypes::Position, + title: "Должности".to_owned(), + }, + Tab{ + tab_type: TabTypes::Recipe, + title: "Рецеты".to_owned(), + }, + Tab{ + tab_type: TabTypes::Product, + title: "Продукция".to_owned() } + ]); Self{tree} } @@ -116,19 +133,23 @@ impl MainTabViewer{ } fn show_worker(&mut self, ui: &mut egui::Ui){ + todo!() + + } + fn show_position(&mut self, ui: &mut egui::Ui){ let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async{ - for eq in self.positions.read().clone().unwrap().iter(){ + for eq in self.positions.read().clone().unwrap().iter(){ ui.push_id(&eq.name, |ui|{ egui::CollapsingHeader::new(&eq.name) .default_open(false) .show(ui, |ui|{ ui.label(eq.wage.to_string()); }) + }); } }) - } fn show_salary(&mut self, ui: &mut egui::Ui){ ui.label("Salary"); @@ -157,6 +178,9 @@ impl egui_dock::TabViewer for MainTabViewer{ }, TabTypes::Material => { &self.show_material(ui); + }, + TabTypes::Position =>{ + &self.show_position(ui); } _ =>{ ui.label("This is not");