From 1cf075347711bc28b94e82c1bc7db206c21cc5ab Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Sun, 1 May 2011 12:52:27 -0400 Subject: added DEFAULT_ZOOM_SIZE for the zoom size --- sb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sb.c b/sb.c index 76cafd4..6e810b5 100644 --- a/sb.c +++ b/sb.c @@ -43,8 +43,7 @@ static struct { #define DEFAULT_FONT "san-serif" #define DEFAULT_TAB_LENGTH 25 #define DEFAULT_HISTORY_FILE "/.sb_history" - - +#define DEFAULT_ZOOM_SIZE .05 static GQuark term_data_id = 0; @@ -157,6 +156,7 @@ gtk_label_set_label(GTK_LABEL(t->label), tabtitle); /* when the page load is commited, call this function */ static void load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, tab *t) { + const gchar* uri = webkit_web_frame_get_uri(frame); if (gtk_notebook_get_current_page(GTK_NOTEBOOK(w.notebook)) == gtk_notebook_page_num(GTK_NOTEBOOK(w.notebook), t->scroll)) { @@ -194,8 +194,8 @@ g_free(u); /*increase or decrease the zoom of the page */ static void tab_zoom (gboolean b) { struct tab *t = get_tab(NULL, gtk_notebook_get_current_page(GTK_NOTEBOOK(w.notebook))); - if (b) { webkit_web_view_set_zoom_level(t->view, (webkit_web_view_get_zoom_level(t->view) + .05)); } - else { webkit_web_view_set_zoom_level(t->view, (webkit_web_view_get_zoom_level(t->view) - .05)); } + if (b) { webkit_web_view_set_zoom_level(t->view, (webkit_web_view_get_zoom_level(t->view) + DEFAULT_ZOOM_SIZE)); } + else { webkit_web_view_set_zoom_level(t->view, (webkit_web_view_get_zoom_level(t->view) - DEFAULT_ZOOM_SIZE)); } } @@ -276,6 +276,7 @@ static void tab_view_source() { /* create a tab */ static void tab_new(gboolean b) { + tab *t; t = g_new0(tab, 1); -- cgit v1.2.3