Allow to hide the statusbar.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 19 Sep 2014 20:02:33 +0000 (22:02 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 19 Sep 2014 20:02:33 +0000 (22:02 +0200)
doc/vimb.1
src/main.c
src/setting.c

index e771289..c65abf9 100644 (file)
@@ -1088,6 +1088,9 @@ Indicates if the environment variable `http_proxy' is evaluated.
 .B scrollstep (int)
 Number of pixel vimb scrolls if 'j' or 'k' is used.
 .TP
+.B statusbar (bool)
+Indicates if the statusbar should be shown.
+.TP
 .B status-color-bg (color)
 Background color of the statusbar.
 .TP
index d19dde9..27eb08b 100644 (file)
@@ -290,8 +290,13 @@ static void wget_bar(int len, int progress, char *string)
 void vb_update_statusbar()
 {
     int max, val, num;
-    GString *status = g_string_new("");
+    GString *status;
 
+    if (!gtk_widget_get_visible(GTK_WIDGET(vb.gui.statusbar.box))) {
+        return;
+    }
+
+    status = g_string_new("");
     /* show the active downloads */
     if (vb.state.downloads) {
         num = g_list_length(vb.state.downloads);
index 9cc1f9c..be0efcb 100644 (file)
@@ -64,6 +64,7 @@ static int pagecache(const char *name, int type, void *value, void *data);
 static int soup(const char *name, int type, void *value, void *data);
 static int internal(const char *name, int type, void *value, void *data);
 static int input_color(const char *name, int type, void *value, void *data);
+static int statusbar(const char *name, int type, void *value, void *data);
 static int status_color(const char *name, int type, void *value, void *data);
 static int input_font(const char *name, int type, void *value, void *data);
 static int status_font(const char *name, int type, void *value, void *data);
@@ -165,6 +166,7 @@ void setting_init()
     setting_add("strict-focus", TYPE_BOOLEAN, &off, internal, 0, &vb.config.strict_focus);
     i = 40;
     setting_add("scrollstep", TYPE_INTEGER, &i, internal, 0, &vb.config.scrollstep);
+    setting_add("statusbar", TYPE_BOOLEAN, &on, statusbar, 0, NULL);
     setting_add("status-color-bg", TYPE_COLOR, &"#000000", status_color, 0, &vb.style.status_bg[VB_STATUS_NORMAL]);
     setting_add("status-color-fg", TYPE_COLOR, &"#ffffff", status_color, 0, &vb.style.status_fg[VB_STATUS_NORMAL]);
     setting_add("status-font", TYPE_FONT, &SETTING_GUI_FONT_EMPH, status_font, 0, &vb.style.status_font[VB_STATUS_NORMAL]);
@@ -598,6 +600,13 @@ static int input_color(const char *name, int type, void *value, void *data)
     return SETTING_OK;
 }
 
+static int statusbar(const char *name, int type, void *value, void *data)
+{
+    gtk_widget_set_visible(GTK_WIDGET(vb.gui.statusbar.box), *(gboolean*)value);
+
+    return SETTING_OK;
+}
+
 static int status_color(const char *name, int type, void *value, void *data)
 {
     VB_COLOR_PARSE((VbColor*)data, (char*)value);