X-Git-Url: https://git.armaanb.net/?p=chorizo.git;a=blobdiff_plain;f=browser.c;h=37ffdb5ede8dd9cd3a54655ea7f15a11d2c58c53;hp=ede3ec69230dbe31d6c89e910ba32b130472d94a;hb=4bdba4340d9d0d9f43a01180ec1b9e9882c71983;hpb=193bc77912bb08b519b808886b869cfa4f6296fc diff --git a/browser.c b/browser.c index ede3ec6..37ffdb5 100644 --- a/browser.c +++ b/browser.c @@ -432,7 +432,13 @@ changed_title(GObject *obj, GParamSpec *pspec, gpointer data) t = t == NULL ? u : t; t = t[0] == 0 ? u : t; - gtk_label_set_text(GTK_LABEL(c->tablabel), t); + gchar *name = malloc(strlen(t) + 4); + gchar *muted = (webkit_web_view_get_is_muted(WEBKIT_WEB_VIEW(c->web_view))) + ? "[m] " : ""; + sprintf(name, "%s%s", muted, t); + + gtk_label_set_text(GTK_LABEL(c->tablabel), name); + g_free(name); gtk_widget_set_tooltip_text(c->tablabel, t); mainwindow_title(gtk_notebook_get_current_page(GTK_NOTEBOOK(mw.notebook))); } @@ -1084,6 +1090,12 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data) } else if (def_key("tab_previous", GDK_KEY_u) == key) { gtk_notebook_prev_page(GTK_NOTEBOOK(mw.notebook)); return TRUE; + } else if (def_key("tab_mute", GDK_KEY_m) == key) { + gboolean muted = + webkit_web_view_get_is_muted(WEBKIT_WEB_VIEW(c->web_view)); + webkit_web_view_set_is_muted(WEBKIT_WEB_VIEW(c->web_view), !muted); + changed_title(G_OBJECT(c->web_view), NULL, c); + return TRUE; } else if (def_key("tab_new", GDK_KEY_w) == key) { f = ensure_uri_scheme(cfg.home_uri); client_new(f, NULL, TRUE, TRUE);