[hackers] [surf] Hiding the loading indicator when it is not used. Based on a patch from || Christoph Lohmann

From: <hg_AT_suckless.org>
Date: Wed, 31 Oct 2012 21:15:44 +0100 (CET)

changeset: 255:8cae34fadf47
user: Christoph Lohmann <20h_AT_r-36.net>
date: Sun Oct 28 14:16:22 2012 +0100
files: config.def.h surf.c
description:
Hiding the loading indicator when it is not used. Based on a patch from
http://xteddy.org/surf.html#toc5. Thanks!


diff -r 302fbbc42629 -r 8cae34fadf47 config.def.h
--- a/config.def.h Sun Oct 28 14:06:17 2012 +0100
+++ b/config.def.h Sun Oct 28 14:16:22 2012 +0100
_AT_@ -9,6 +9,8 @@
 static time_t sessiontime = 3600;
 static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
 static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
+static int indicator_thickness = 2;
+
 #define HIDE_BACKGROUND FALSE
 #define SPATIAL_BROWSING TRUE
 
diff -r 302fbbc42629 -r 8cae34fadf47 surf.c
--- a/surf.c Sun Oct 28 14:06:17 2012 +0100
+++ b/surf.c Sun Oct 28 14:16:22 2012 +0100
_AT_@ -341,11 +341,12 @@
         w = c->indicator;
         width = c->progress * w->allocation.width / 100;
         gc = gdk_gc_new(w->window);
- if(strstr(uri, "https://") == uri)
+ if(strstr(uri, "https://") == uri) {
                 gdk_color_parse(c->sslfailed ?
                                 progress_untrust : progress_trust, &fg);
- else
+ } else {
                 gdk_color_parse(progress, &fg);
+ }
         gdk_gc_set_rgb_fg_color(gc, &fg);
         gdk_draw_rectangle(w->window,
                         w->style->bg_gc[GTK_WIDGET_STATE(w)],
_AT_@ -554,7 +555,7 @@
 
         /* 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);
 
_AT_@ -569,7 +570,6 @@
         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);
Received on Wed Oct 31 2012 - 21:15:44 CET

This archive was generated by hypermail 2.3.0 : Wed Oct 31 2012 - 21:24:10 CET