tweak: Add hide searchbar option

Also bring config.def.h up to date
This commit is contained in:
NunoSempere 2022-12-16 01:27:04 +01:00
parent ca5438c626
commit 350e6022df
3 changed files with 32 additions and 19 deletions

View File

@ -45,9 +45,11 @@ typedef enum {
prev_tab,
close_tab,
show_searchbar,
hide_searchbar,
show_finder,
finder_next,
finder_prev
prettify
} func;
#define SFT 1 << 0
@ -72,9 +74,11 @@ static struct {
{ CTRL, KEY(w), close_tab },
{ 0x0, KEY(F11), toggle_fullscreen },
{ CTRL, KEY(e), show_searchbar },
{ CTRL, KEY(k), hide_searchbar },
{ CTRL, KEY(f), show_finder },
{ CTRL, KEY(n), finder_next },
{ CTRL | SFT, KEY(N), finder_prev }
{ CTRL | SFT, KEY(N), finder_prev },
{ CTRL, KEY(p), prettify }
};
/* For controls more akin to normal browsers, use:
@ -94,7 +98,8 @@ static struct {
{ CTRL, KEY(l), show_searchbar },
{ CTRL, KEY(f), show_finder },
{ CTRL, KEY(n), finder_next },
{ CTRL | SFT, KEY(N), finder_prev }
{ CTRL | SFT, KEY(N), finder_prev },
{ CTRL, KEY(p), prettify }
};
*/
/* Reference for the key shorthand:

View File

@ -46,6 +46,7 @@ typedef enum {
prev_tab,
close_tab,
show_searchbar,
hide_searchbar,
show_finder,
finder_next,
finder_prev,
@ -75,10 +76,11 @@ static struct {
{ CTRL, KEY(w), close_tab },
{ 0x0, KEY(F11), toggle_fullscreen },
{ CTRL, KEY(l), show_searchbar },
{ CTRL, KEY(k), hide_searchbar },
{ CTRL, KEY(f), show_finder },
{ CTRL, KEY(n), finder_next },
{ CTRL | SFT, KEY(N), finder_prev },
{ CTRL, KEY(p), prettify },
{ CTRL, KEY(p), prettify }
};
/* ^ For controls more akin to normal browsers */
/* Reference for the key shorthand:
@ -94,12 +96,14 @@ static struct {
{ CTRL, KEY(minus), zoomout },
{ CTRL, KEY(0), zoom_reset },
{ ALT, KEY(h), prev_tab },
{ CTRL, KEY(k), hide_searchbar },
{ ALT, KEY(l), next_tab },
{ CTRL, KEY(w), close_tab },
{ 0x0, KEY(F11), toggle_fullscreen },
{ CTRL, KEY(e), show_searchbar },
{ CTRL, KEY(f), show_finder },
{ CTRL, KEY(n), finder_next },
{ CTRL | SFT, KEY(N), finder_prev }
{ CTRL | SFT, KEY(N), finder_prev },
{ CTRL, KEY(p), prettify }
};
*/

4
rose.c
View File

@ -260,6 +260,10 @@ int handle_key(func id, GtkNotebook *notebook)
show_bar(notebook);
break;
case hide_searchbar:
gtk_widget_hide(GTK_WIDGET(bar));
break;
case show_finder:
entry_mode = _FIND;
show_bar(notebook);