summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnno Boland (tox) <tox@s01.de>2009-09-07 10:56:27 +0200
committerEnno Boland (tox) <tox@s01.de>2009-09-07 10:56:27 +0200
commit91ca224af21a008512081a7868ada2479d5d9231 (patch)
tree1a447b7f10d4b19a7cd518b89f3a64c0bc4f9653
parent1835cbef2fd56c1e8e749ee596b9af88617ab547 (diff)
downloadsurf-91ca224af21a008512081a7868ada2479d5d9231.tar.gz
surf-91ca224af21a008512081a7868ada2479d5d9231.tar.bz2
surf-91ca224af21a008512081a7868ada2479d5d9231.zip
indicator is red when http and green when https
-rw-r--r--surf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/surf.c b/surf.c
index 2bfdf7b..729151f 100644
--- a/surf.c
+++ b/surf.c
@@ -179,17 +179,31 @@ void
drawindicator(Client *c) {
GtkWidget *w;
gint width;
+ GdkGC *gc;
+ GdkColor red = { 65535,65535,0,0 };
+ GdkColor green = { 65535,0,65535,0 };
+ gchar *uri;
+
+ uri = geturi(c);
w = c->indicator;
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,
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