From 15b9c76b301ca977c4755cee019d38db0bd83b8e Mon Sep 17 00:00:00 2001 From: ultrageese Date: Tue, 12 May 2026 09:17:11 +1000 Subject: [PATCH] =?UTF-8?q?=D0=A2=D1=80=D0=B0=D0=BB=D0=B0=D0=BB=D0=B5?= =?UTF-8?q?=D0=BB=D0=BE=20=D0=A2=D1=80=D0=B0=D0=BB=D0=B0=D0=BB=D0=B0=20=09?= =?UTF-8?q?modified:=20=20=20code/src/app.rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/src/app.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/src/app.rs b/code/src/app.rs index eb8f788..f236423 100644 --- a/code/src/app.rs +++ b/code/src/app.rs @@ -16,7 +16,6 @@ enum TabTypes{ struct Tab{ tab_type: TabTypes, title: String, - content: String, } pub struct App{ @@ -29,17 +28,14 @@ impl Default for App{ Tab{ tab_type: TabTypes::Equipment, title:"Оборудование".to_owned(), - content:"Вкладка с оборудованием".to_owned() }, Tab{ tab_type: TabTypes::Material, title: "Сырьё".to_owned(), - content:"Вкладка с сырьём".to_owned() }, Tab{ tab_type: TabTypes::Worker, title: "Сотрудники".to_owned(), - content:"Сотрудники".to_owned() } ]); @@ -61,6 +57,7 @@ impl App{ Default::default() } + } impl eframe::App for App{ @@ -72,6 +69,11 @@ impl eframe::App for App{ } struct TabViewer {} +impl TabViewer{ + fn show_equipment(&mut self, ui: &mut egui::Ui){ + ui.label("Equipment"); + } +} impl egui_dock::TabViewer for TabViewer{ type Tab = Tab; @@ -80,10 +82,9 @@ impl egui_dock::TabViewer for TabViewer{ (&*tab.title).into() } fn ui(&mut self, ui: &mut egui::Ui, tab: &mut Self::Tab){ - ui.label(&tab.content); match &tab.tab_type{ TabTypes::Equipment => { - ui.label("This is Equipment"); + &self.show_equipment(ui); }, _ =>{ ui.label("This is not");