From 74bead3a762f6959874c638fe121da003d2b277d Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Fri, 6 Dec 2024 18:45:24 +0800 Subject: [PATCH] refactor: set min window size to show all panel options (#256) --- resources/components/prompt/prompt.css | 6 +++--- src/config.rs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/components/prompt/prompt.css b/resources/components/prompt/prompt.css index 168a704..cd3061f 100644 --- a/resources/components/prompt/prompt.css +++ b/resources/components/prompt/prompt.css @@ -10,8 +10,8 @@ body { .dialog { display: flex; background: #ffffff; - width: 400px; - min-height: 110px; + width: 300px; + min-height: 60px; max-height: 300px; flex-direction: column; align-items: center; @@ -24,6 +24,6 @@ body { .msg { display: inline-block; width: 100%; - min-height: 90px; + min-height: 50px; text-align: center; } diff --git a/src/config.rs b/src/config.rs index eecf977..fe70904 100644 --- a/src/config.rs +++ b/src/config.rs @@ -176,6 +176,11 @@ fn parse_cli_args() -> Result { let mut window_attributes = winit::window::Window::default_attributes(); + // set min inner size + // should be at least able to show the whole control panel + // FIXME: url input has weird behavior that will expand lager when having long text + window_attributes = window_attributes.with_min_inner_size(dpi::LogicalSize::new(480, 72)); + let width = matches.opt_get::("width").unwrap_or_else(|e| { log::error!("Failed to parse width command line argument: {e}"); None