Do not try to compute a tab colour unless it's a proper URI
This commit is contained in:
parent
350dbe5e07
commit
637388a8de
1 changed files with 23 additions and 16 deletions
|
@ -45,7 +45,8 @@ colorful_tabs_view_notify_uri_cb (MidoriView* view,
|
|||
dark, we lighten it up a litte. Finally we make the event box
|
||||
visible and modify its background. */
|
||||
|
||||
uri = soup_uri_new (midori_view_get_display_uri (view));
|
||||
if ((uri = soup_uri_new (midori_view_get_display_uri (view))))
|
||||
{
|
||||
hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri->host, -1);
|
||||
soup_uri_free (uri);
|
||||
colorstr = g_strndup (hash, 6 + 1);
|
||||
|
@ -61,6 +62,12 @@ colorful_tabs_view_notify_uri_cb (MidoriView* view,
|
|||
gtk_event_box_set_visible_window (GTK_EVENT_BOX (label), TRUE);
|
||||
gtk_widget_modify_bg (label, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, &color);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_modify_bg (label, GTK_STATE_NORMAL, NULL);
|
||||
gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue