diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-09-21 01:07:32 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-09-21 10:53:41 +0100 |
commit | 9d3112a643d2ff1c6055133485273d5e5a358d24 (patch) | |
tree | da78d753fa16de6bd20e7d2942115083df742210 /frontends/gtk/window.c | |
parent | e14416d43fea0da0aca91a3373ed3c67a28af183 (diff) | |
download | netsurf-9d3112a643d2ff1c6055133485273d5e5a358d24.tar.gz netsurf-9d3112a643d2ff1c6055133485273d5e5a358d24.tar.bz2 |
persist the menu and tool bar visibility as user settings
Diffstat (limited to 'frontends/gtk/window.c')
-rw-r--r-- | frontends/gtk/window.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c index da904ea95..a5defcfce 100644 --- a/frontends/gtk/window.c +++ b/frontends/gtk/window.c @@ -707,6 +707,22 @@ static struct browser_window *bw_from_gw(void *data) } +static bool get_tool_bar_show(void) +{ + const char *cur_bar_show; + + cur_bar_show = nsoption_charp(bar_show); + if (cur_bar_show != NULL) { + if (strcmp(cur_bar_show, "menu/tool") == 0) { + return true; + } else if (strcmp(cur_bar_show, "tool") == 0) { + return true; + } + } + return false; +} + + /** * Create and open a gtk container (window or tab) for a browsing context. * @@ -887,6 +903,9 @@ gui_window_create(struct browser_window *bw, /* initialy should not be visible */ nsgtk_search_toggle_visibility(g->search); + /* set toolbar visibility from user option */ + nsgtk_toolbar_show(g->toolbar, get_tool_bar_show()); + /* safe to drop the reference to the tab_builder as the container is * referenced by the notebook now. */ |