indicator is red when http and green when https
This commit is contained in:
parent
1835cbef2f
commit
91ca224af2
16
surf.c
16
surf.c
|
@ -179,17 +179,31 @@ void
|
||||||
drawindicator(Client *c) {
|
drawindicator(Client *c) {
|
||||||
GtkWidget *w;
|
GtkWidget *w;
|
||||||
gint width;
|
gint width;
|
||||||
|
GdkGC *gc;
|
||||||
|
GdkColor red = { 65535,65535,0,0 };
|
||||||
|
GdkColor green = { 65535,0,65535,0 };
|
||||||
|
gchar *uri;
|
||||||
|
|
||||||
|
|
||||||
|
uri = geturi(c);
|
||||||
w = c->indicator;
|
w = c->indicator;
|
||||||
width = c->progress * w->allocation.width / 100;
|
width = c->progress * w->allocation.width / 100;
|
||||||
|
|
||||||
|
gc = gdk_gc_new(w->window);
|
||||||
|
|
||||||
|
if(strstr(uri, "https://") == uri)
|
||||||
|
gdk_gc_set_rgb_fg_color(gc, &green);
|
||||||
|
else
|
||||||
|
gdk_gc_set_rgb_fg_color(gc, &red);
|
||||||
gdk_draw_rectangle(w->window,
|
gdk_draw_rectangle(w->window,
|
||||||
w->style->bg_gc[GTK_WIDGET_STATE(w)],
|
w->style->bg_gc[GTK_WIDGET_STATE(w)],
|
||||||
TRUE,
|
TRUE,
|
||||||
0, 0, w->allocation.width, w->allocation.height);
|
0, 0, w->allocation.width, w->allocation.height);
|
||||||
gdk_draw_rectangle(w->window,
|
gdk_draw_rectangle(w->window,
|
||||||
w->style->fg_gc[GTK_WIDGET_STATE(w)],
|
gc,
|
||||||
TRUE,
|
TRUE,
|
||||||
0, 0, width, w->allocation.height);
|
0, 0, width, w->allocation.height);
|
||||||
|
g_object_unref(gc);/*g_free(gc);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
Loading…
Reference in New Issue