This PR adds an option to close the search bar instead of hiding it.
A few things to note:
On Windows, when the search bar is built using window::get_searchbar(), the platform::is_visible() function returns true (because lpwndpl.showCmd == SHOW_WINDOW_CMD(1) apparently). So, I had to remove the ability to close the search bar using the "open search bar shortcut" when the close search bar setting is on. This could probably be avoided by using the is_minimized() method introduced in tauri v1.3.0.
The setting requires a restart, because I did not wanted to fight against the lifetime that comes with the addition of settings to the shortcuts.register() closure (see crates/tauri/src/main.rs changes). I could use app_hand.try_state::<Config>() to retrieve the setting tho, let me know if you want me to change this.
Only Windows has been tested. Not MacOS, nor Linux.
Closes #408
This PR adds an option to close the search bar instead of hiding it.
A few things to note:
window::get_searchbar()
, theplatform::is_visible()
function returnstrue
(becauselpwndpl.showCmd == SHOW_WINDOW_CMD(1)
apparently). So, I had to remove the ability to close the search bar using the "open search bar shortcut" when the close search bar setting is on. This could probably be avoided by using the is_minimized() method introduced in tauri v1.3.0.settings
to theshortcuts.register()
closure (seecrates/tauri/src/main.rs
changes). I could useapp_hand.try_state::<Config>()
to retrieve the setting tho, let me know if you want me to change this.