From: Daniel Carl Date: Tue, 22 Oct 2013 18:59:16 +0000 (+0200) Subject: Added feature to enable/disable progress in window title. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=24e9426434cba1f0a67cff80416297231cc94b68;p=vimb.git Added feature to enable/disable progress in window title. --- diff --git a/src/config.def.h b/src/config.def.h index 6b65997..40bf602 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -22,11 +22,18 @@ /* features */ +/* enable cookie support */ #define FEATURE_COOKIE +/* highlich search reasults */ #define FEATURE_SEARCH_HIGHLIGHT +/* disable scrollbars */ #define FEATURE_NO_SCROLLBARS +/* show page title in url completions */ #define FEATURE_TITLE_IN_COMPLETION +/* enable the read it later queue */ #define FEATURE_QUEUE +/* show load progress in window title */ +#define FEATURE_TITLE_PROGRESS /* should the history indicator [+-] be shown in status bar after url */ #define FEATURE_HISTORY_INDICATOR diff --git a/src/main.c b/src/main.c index 72f205d..21d0618 100644 --- a/src/main.c +++ b/src/main.c @@ -865,15 +865,18 @@ static void title_changed_cb(WebKitWebView *webview, WebKitWebFrame *frame, cons static void update_title(void) { - char *title; +#ifdef FEATURE_TITLE_PROGRESS /* show load status of page or the downloads */ if (vb.state.progress != 100) { - title = g_strdup_printf("[%i%%] %s", vb.state.progress, vb.state.title); + char *title = g_strdup_printf("[%i%%] %s", vb.state.progress, vb.state.title); gtk_window_set_title(GTK_WINDOW(vb.gui.window), title); g_free(title); } else { gtk_window_set_title(GTK_WINDOW(vb.gui.window), vb.state.title); } +#else + gtk_window_set_title(GTK_WINDOW(vb.gui.window), vb.state.title); +#endif } static gboolean mimetype_decision_cb(WebKitWebView *webview,