From 8ca4ad2be35b13e1fcbfad0d3e08f92b50414413 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 2 Feb 2024 21:32:26 +0900 Subject: [PATCH] restrict minimum size of window to 100x100 --- v2/src/wry/webview.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/src/wry/webview.rs b/v2/src/wry/webview.rs index 29f128a..676956f 100644 --- a/v2/src/wry/webview.rs +++ b/v2/src/wry/webview.rs @@ -171,7 +171,10 @@ pub struct WebViewRenderer { impl WebViewRenderer { pub fn new(config: &Config, event_loop: &EventLoop, mut menu: Menu) -> Result { - let mut builder = WindowBuilder::new().with_title("Shiba").with_visible(false); + let mut builder = WindowBuilder::new() + .with_title("Shiba") + .with_visible(false) + .with_min_inner_size(PhysicalSize { width: 100, height: 100 }); let window_state = if config.window().restore { config.data_dir().load() } else { None }; let (zoom_level, always_on_top) = if let Some(state) = window_state {