X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=surf.c;h=c6cb82490cf20d9cb1fcc69f88cf2ddea9d10c9b;hb=4cbfddf15907c96b55ac3381c9a402260a96ce9f;hp=454a5856ad02b42752c37c47d81d165a3b152a23;hpb=ea2d9489303f3eacc77f6afcbcd13d2a7a0fe54a;p=surf.git diff --git a/surf.c b/surf.c index 454a585..c6cb824 100644 --- a/surf.c +++ b/surf.c @@ -179,17 +179,29 @@ void drawindicator(Client *c) { GtkWidget *w; gint width; + GdkGC *gc; + gchar *uri; + GdkColor fg; + + uri = geturi(c); w = c->indicator; width = c->progress * w->allocation.width / 100; + + gc = gdk_gc_new(w->window); + + gdk_color_parse(strstr(uri, "https://") == uri ? + progress_trust : progress, &fg); + gdk_gc_set_rgb_fg_color(gc, &fg); gdk_draw_rectangle(w->window, w->style->bg_gc[GTK_WIDGET_STATE(w)], TRUE, 0, 0, w->allocation.width, w->allocation.height); gdk_draw_rectangle(w->window, - w->style->fg_gc[GTK_WIDGET_STATE(w)], + gc, TRUE, 0, 0, width, w->allocation.height); + g_object_unref(gc);/*g_free(gc);*/ } gboolean @@ -403,7 +415,7 @@ newclient(void) { /* indicator */ c->indicator = gtk_drawing_area_new(); - gtk_widget_set_size_request(c->indicator, 800, 5); + gtk_widget_set_size_request(c->indicator, 0, 2); g_signal_connect (G_OBJECT (c->indicator), "expose_event", G_CALLBACK (exposeindicator), c);