static gboolean showxid = FALSE;
static char winid[64];
static char *progname;
-static gboolean loadimage = 1, plugin = 1, script = 1;
+static gboolean loadimage = 1, plugin = 1, script = 1, using_proxy = 0;
static char *buildpath(const char *path);
static gboolean buttonrelease(WebKitWebView *web, GdkEventButton *e, GList *gl);
drawindicator(Client *c) {
gint width;
const char *uri;
+ char *colorname;
GtkWidget *w;
GdkGC *gc;
GdkColor fg;
w = c->indicator;
width = c->progress * w->allocation.width / 100;
gc = gdk_gc_new(w->window);
- if(strstr(uri, "https://") == uri)
- gdk_color_parse(c->sslfailed ?
- progress_untrust : progress_trust, &fg);
- else
- gdk_color_parse(progress, &fg);
+ if(strstr(uri, "https://") == uri) {
+ if(using_proxy) {
+ colorname = c->sslfailed? progress_proxy_untrust : progress_proxy_trust;
+ } else {
+ colorname = c->sslfailed? progress_untrust : progress_trust;
+ }
+ } else {
+ if(using_proxy) {
+ colorname = progress_proxy;
+ } else {
+ colorname = progress;
+ }
+ }
+
+ gdk_color_parse(colorname, &fg);
gdk_gc_set_rgb_fg_color(gc, &fg);
gdk_draw_rectangle(w->window,
w->style->bg_gc[GTK_WIDGET_STATE(w)],
/* Indicator */
c->indicator = gtk_drawing_area_new();
- gtk_widget_set_size_request(c->indicator, 0, 2);
+ gtk_widget_set_size_request(c->indicator, 0, indicator_thickness);
g_signal_connect (G_OBJECT (c->indicator), "expose_event",
G_CALLBACK (exposeindicator), c);
gtk_box_set_child_packing(GTK_BOX(c->vbox), c->scroll, TRUE, TRUE, 0, GTK_PACK_START);
gtk_widget_grab_focus(GTK_WIDGET(c->view));
gtk_widget_show(c->vbox);
- gtk_widget_show(c->indicator);
gtk_widget_show(c->scroll);
gtk_widget_show(GTK_WIDGET(c->view));
gtk_widget_show(c->win);
g_object_set(G_OBJECT(s), "proxy-uri", puri, NULL);
soup_uri_free(puri);
g_free(new_proxy);
+ using_proxy = 1;
}
}
update(Client *c) {
char *t;
- if(c->linkhover)
+ if(c->linkhover) {
t = g_strdup(c->linkhover);
- else if(c->progress != 100)
+ } else if(c->progress != 100) {
+ drawindicator(c);
+ gtk_widget_show(c->indicator);
t = g_strdup_printf("[%i%%] %s", c->progress, c->title);
- else
+ } else {
+ gtk_widget_hide_all(c->indicator);
t = g_strdup(c->title);
- drawindicator(c);
+ }
gtk_window_set_title(GTK_WINDOW(c->win), t);
g_free(t);
}