(platform: &str)
| 53 | } |
| 54 | |
| 55 | pub fn new_with_platform(platform: &str) -> Self { |
| 56 | let platform = match platform { |
| 57 | "desktop" => PlatformWindow::Desktop(DesktopWindow { |
| 58 | min_size: Size::new(300.0, 200.0), |
| 59 | max_size: Size::new(f32::MAX, f32::MAX), |
| 60 | resizable: true, |
| 61 | }), |
| 62 | "ios" | "android" => PlatformWindow::Mobile(MobileWindow { |
| 63 | safe_area: SafeArea::default(), |
| 64 | orientation: Orientation::Portrait, |
| 65 | }), |
| 66 | "web" => PlatformWindow::Web(WebWindow { |
| 67 | container_id: "rust-ui-app".to_string(), |
| 68 | }), |
| 69 | _ => PlatformWindow::Desktop(DesktopWindow { |
| 70 | min_size: Size::new(300.0, 200.0), |
| 71 | max_size: Size::new(f32::MAX, f32::MAX), |
| 72 | resizable: true, |
| 73 | }), |
| 74 | }; |
| 75 | |
| 76 | Self { |
| 77 | width: 800, |
| 78 | height: 600, |
| 79 | scale_factor: 1.0, |
| 80 | platform, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | pub fn resize(&mut self, width: u32, height: u32) { |
| 85 | self.width = width; |
nothing calls this directly
no outgoing calls
no test coverage detected