Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak(windows): add borders to search bar initial inner_size #245

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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