account_login_preview.rs (1125B)
1 use crate::egui_preview_setup::{EguiPreviewCase, EguiPreviewSetup}; 2 use notedeck::account_login_view::{DesktopAccountLoginView, MobileAccountLoginView}; 3 use notedeck::login_manager::LoginManager; 4 5 pub struct DesktopAccountLoginPreview { 6 manager: LoginManager, 7 } 8 9 impl EguiPreviewCase for DesktopAccountLoginPreview { 10 fn new(_supr: EguiPreviewSetup) -> Self { 11 DesktopAccountLoginPreview { 12 manager: LoginManager::new(), 13 } 14 } 15 } 16 17 impl eframe::App for DesktopAccountLoginPreview { 18 fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { 19 DesktopAccountLoginView::new(ctx, &mut self.manager).panel() 20 } 21 } 22 23 pub struct MobileAccountLoginPreview { 24 manager: LoginManager, 25 } 26 27 impl EguiPreviewCase for MobileAccountLoginPreview { 28 fn new(_supr: EguiPreviewSetup) -> Self { 29 MobileAccountLoginPreview { 30 manager: LoginManager::new(), 31 } 32 } 33 } 34 35 impl eframe::App for MobileAccountLoginPreview { 36 fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { 37 MobileAccountLoginView::new(ctx, &mut self.manager).panel() 38 } 39 }