Skip to content

Commit

Permalink
tweak(windows): add borders to windows inner_size (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5huynh authored Dec 9, 2022
1 parent 66b3570 commit 40cb4b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/client/src/pages/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl Component for SearchPage {
// Listen to onblur events so we can hide the search bar
if let Some(wind) = window() {
let link_clone = link.clone();
let on_blur = EventListener::new(&wind, "blur", move |_event| {
let on_blur = EventListener::new(&wind, "blur", move |_| {
link_clone.send_message(Msg::Blur);
});

Expand Down
8 changes: 7 additions & 1 deletion crates/tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
log::error!("Unable to copy default plugins: {}", e);
}

let default_height = if cfg!(target_os = "windows") {
98.0
} else {
96.0
};

let window = WindowBuilder::new(
app,
constants::SEARCH_WIN_NAME,
Expand All @@ -161,7 +167,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.decorations(false)
.transparent(true)
.disable_file_drop_handler()
.inner_size(640.0, 96.0)
.inner_size(640.0, default_height)
.build()
.expect("Unable to create searchbar window");
// Center on launch.
Expand Down

0 comments on commit 40cb4b6

Please sign in to comment.