diff --git a/styles/AmberNight/style.css b/styles/AmberNight/style.css index de538da..9534b7a 100644 --- a/styles/AmberNight/style.css +++ b/styles/AmberNight/style.css @@ -25,7 +25,6 @@ body { } #background { - background-color: var(--md-surface-variant); } /* Container */ diff --git a/styles/launcher/config.toml b/styles/launcher/config.toml index ce59c4c..d08579b 100644 --- a/styles/launcher/config.toml +++ b/styles/launcher/config.toml @@ -6,7 +6,7 @@ content_halign="Center" height="105%" width="100%" valign="Start" -blurred_background=false +blurred_background=true line_max_chars=32 key_detection_type="Code" term="kitty -e" diff --git a/styles/launcher/style.css b/styles/launcher/style.css index def5974..8e8d367 100644 --- a/styles/launcher/style.css +++ b/styles/launcher/style.css @@ -16,7 +16,7 @@ } #background { - background-color: rgba(33, 33, 33, 0.25); + background-color: rgba(33, 33, 33, 0.1); backdrop-filter: blur(12px); width: 100vw; height: 100vh; @@ -29,16 +29,13 @@ #window { all: unset; - background-color: rgba(33, 33, 33, 0.1); /* #212121BB */ + background-color: transparent; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 1200px; - margin-top: 2em; - margin-left: 15em; - margin-right: 15em; - margin-bottom: 5em; + margin: 2em 15em 5em; } /* Outer-box is the app container grid */ @@ -63,10 +60,7 @@ border-radius: 6px; text-align: center; outline: none; - margin-left: 25em; - margin-right: 25em; - margin-bottom: 5em; - margin-top: 2em; + margin: 2em 25em 5em; } #input:focus, diff --git a/worf/src/lib/gui.rs b/worf/src/lib/gui.rs index 06ebf0c..f90a7ac 100644 --- a/worf/src/lib/gui.rs +++ b/worf/src/lib/gui.rs @@ -558,6 +558,7 @@ struct MetaData { struct UiElements { app: Application, window: ApplicationWindow, + background: Option, search: SearchEntry, main_box: FlowBox, menu_rows: ArcMenuMap, @@ -663,9 +664,12 @@ fn build_ui( .default_height(1) .build(); + let background = create_background(config); + let ui_elements = Rc::new(UiElements { app, window, + background, search: SearchEntry::new(), main_box: FlowBox::new(), menu_rows: Arc::new(RwLock::new(HashMap::new())), @@ -742,6 +746,16 @@ fn build_ui( let window_start = Instant::now(); ui_elements.window.present(); + if let Some(background) = &ui_elements.background { + background.present(); + } + + log::debug!("window show took {:?}", window_start.elapsed()); + + log::debug!("Building UI took {:?}", start.elapsed(),); +} + +fn create_background(config: &Config) -> Option { if config.blurred_background() { let background = ApplicationWindow::builder() .decorated(false) @@ -753,14 +767,12 @@ fn build_ui( .build(); background.set_widget_name("background"); background.set_namespace(Some("worf")); - - background.present(); + Some(background) + } else { + None } - - log::debug!("window show took {:?}", window_start.elapsed()); - - log::debug!("Building UI took {:?}", start.elapsed(),); } + fn build_main_box(config: &Config, ui_elements: &Rc>) { ui_elements.main_box.set_widget_name("inner-box"); ui_elements.main_box.set_css_classes(&["inner-box"]); @@ -1359,6 +1371,9 @@ fn send_selected_item( log::error!("failed to send message {e}"); } }); + if let Some(background) = &ui.background { + background.hide(); + } ui.window.hide(); close_gui(&ui_clone.app); }