diff options
-rw-r--r-- | doc/dwb.1 | 6 | ||||
-rw-r--r-- | doc/dwb.1.txt | 3 | ||||
-rw-r--r-- | src/config.h | 2 | ||||
-rw-r--r-- | src/dwb.c | 24 | ||||
-rw-r--r-- | src/dwb.h | 1 | ||||
-rw-r--r-- | util/settings.pre | 1 |
6 files changed, 34 insertions, 3 deletions
@@ -3468,6 +3468,12 @@ Program used for printing previews, default value: \fINULL\fR\&. .RE .PP +\fBprivate\-color\fR +.RS 4 +Statusbar color used when private browsing is enabled, default value: +\fI#505050\fR\&. +.RE +.PP \fBproxy\fR .RS 4 Whether to use a HTTP\-proxy\&. Possible values: true/false, default value: diff --git a/doc/dwb.1.txt b/doc/dwb.1.txt index fcb3b23a..2809eddb 100644 --- a/doc/dwb.1.txt +++ b/doc/dwb.1.txt @@ -1444,6 +1444,9 @@ color-string, default value: '#eeeeee'. *print-previewer*:: Program used for printing previews, default value: 'NULL'. +*private-color*:: +Statusbar color used when private browsing is enabled, default value: '#505050'. + *proxy*:: Whether to use a HTTP-proxy. Possible values: true/false, default value: 'false'. diff --git a/src/config.h b/src/config.h index f8e22cb0..e4b6dede 100644 --- a/src/config.h +++ b/src/config.h @@ -987,6 +987,8 @@ static WebSettings DWB_SETTINGS[] = { SETTING_GLOBAL, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, { 0 }, }, { { "background-color", "Background color of the active tab", }, SETTING_GLOBAL, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, { 0 }, }, + { { "private-color", "Statusbar background color in private browsing mode", }, + SETTING_GLOBAL, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, { 0 }, }, { { "tab-active-fg-color", "Foreground color of the active tab", }, SETTING_GLOBAL, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, { 0 }, }, @@ -79,6 +79,7 @@ static DwbStatus dwb_set_find_delay(GList *gl, WebSettings *s); static DwbStatus dwb_set_do_not_track(GList *gl, WebSettings *s); static DwbStatus dwb_set_show_single_tab(GList *gl, WebSettings *s); static DwbStatus dwb_set_accept_language(GList *gl, WebSettings *s); +static void dwb_set_statusbar_color(); //static DwbStatus dwb_set_javascript_debugging(GList *gl, WebSettings *s); #ifdef WITH_LIBSOUP_2_38 static DwbStatus dwb_set_dns_lookup(GList *gl, WebSettings *s); @@ -285,6 +286,7 @@ dwb_set_private_browsing(GList *gl, WebSettings *s) { dwb.misc.private_browsing = s->arg_local.b; dwb_webkit_setting(gl, s); + dwb_set_statusbar_color(); return STATUS_OK; }/*}}}*/ @@ -3829,6 +3831,7 @@ dwb_init_style() /* Statusbar */ DWB_COLOR_PARSE(&dwb.color.active_fg, GET_CHAR("foreground-color")); DWB_COLOR_PARSE(&dwb.color.active_bg, GET_CHAR("background-color")); + DWB_COLOR_PARSE(&dwb.color.private_bg, GET_CHAR("private-color")); /* Tabs */ DWB_COLOR_PARSE(&dwb.color.tab_active_fg, GET_CHAR("tab-active-fg-color")); @@ -3879,16 +3882,29 @@ dwb_init_style() SET_FONT(dwb.font.fd_entry, "font-entry"); SET_FONT(dwb.font.fd_completion, "font-completion"); #undef SET_FONT - } /*}}}*/ +} /*}}}*/ + +static void +dwb_set_statusbar_color() +{ + if (dwb.misc.private_browsing) + { + DWB_WIDGET_OVERRIDE_BACKGROUND(dwb.gui.statusbox, GTK_STATE_NORMAL, &dwb.color.private_bg); + DWB_WIDGET_OVERRIDE_BASE(dwb.gui.entry, GTK_STATE_NORMAL, &dwb.color.private_bg); + } + else + { + DWB_WIDGET_OVERRIDE_BACKGROUND(dwb.gui.statusbox, GTK_STATE_NORMAL, &dwb.color.active_bg); + DWB_WIDGET_OVERRIDE_BASE(dwb.gui.entry, GTK_STATE_NORMAL, &dwb.color.active_bg); + } +} static void dwb_apply_style() { DWB_WIDGET_OVERRIDE_FONT(dwb.gui.entry, dwb.font.fd_entry); - DWB_WIDGET_OVERRIDE_BASE(dwb.gui.entry, GTK_STATE_NORMAL, &dwb.color.active_bg); DWB_WIDGET_OVERRIDE_TEXT(dwb.gui.entry, GTK_STATE_NORMAL, &dwb.color.active_fg); - DWB_WIDGET_OVERRIDE_BACKGROUND(dwb.gui.statusbox, GTK_STATE_NORMAL, &dwb.color.active_bg); DWB_WIDGET_OVERRIDE_COLOR(dwb.gui.rstatus, GTK_STATE_NORMAL, &dwb.color.active_fg); DWB_WIDGET_OVERRIDE_COLOR(dwb.gui.lstatus, GTK_STATE_NORMAL, &dwb.color.active_fg); DWB_WIDGET_OVERRIDE_FONT(dwb.gui.rstatus, dwb.font.fd_active); @@ -3896,6 +3912,8 @@ dwb_apply_style() DWB_WIDGET_OVERRIDE_FONT(dwb.gui.lstatus, dwb.font.fd_active); DWB_WIDGET_OVERRIDE_BACKGROUND(dwb.gui.window, GTK_STATE_NORMAL, &dwb.color.active_bg); + + dwb_set_statusbar_color(); } DwbStatus @@ -684,6 +684,7 @@ struct _View { struct _Color { DwbColor active_fg; DwbColor active_bg; + DwbColor private_bg; DwbColor ssl_trusted; DwbColor ssl_untrusted; DwbColor tab_active_fg; diff --git a/util/settings.pre b/util/settings.pre index 156c3387..b38a3b1e 100644 --- a/util/settings.pre +++ b/util/settings.pre @@ -58,6 +58,7 @@ error-color text Color for error messages foreground-color text Foreground color of the statusbar normal-completion-bg-color text Background color of normal completion items normal-completion-fg-color text Foreground color of normal completion items +private-color text Statusbar color used with enable-private-browsing enabled progress-bar-empty-color text Color of the empty part of the progress bar progress-bar-full-color text Color of the full part of the progress bar prompt-color text Color for prompt messages |