diff options
badwolf.c: limit characters in tabs
1 files changed, 7 insertions, 0 deletions
| -rw-r--r-- | badwolf.c | 7 |
@@ -98,12 +98,19 @@ WebViewCb_notify__title(WebKitWebView *webView, GParamSpec *pspec, gpointer user const gchar *title; struct Client *browser = (struct Client *)user_data; +#define BADWOLF_TAB_MAXCHARS 16 + title = webkit_web_view_get_title(browser->webView); if(title == NULL) title = webkit_web_view_get_uri(browser->webView); if(title == NULL) title = "BadWolf"; + if(strlen(title) > BADWOLF_TAB_MAXCHARS) + { + title = g_strndup(title, BADWOLF_TAB_MAXCHARS); + } + gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(browser->window->notebook), browser->box, title); return TRUE; |