commit fafd4869791ef1f078964bb8b34ec4dad4b15d31
parent 479fab1d3bca54f21d28c5d12f9595d79a434bd1
Author: Kyle Milz <kmilz@ucalgary.ca>
Date: Sun, 21 Oct 2012 11:30:41 -0600
zoom: re-hook-up zoom() function
Diffstat:
4 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/src/commands.c b/src/commands.c
@@ -755,27 +755,19 @@ scroll(const Arg *arg, void *data)
Eina_Bool
zoom(const Arg *arg, void *data)
{
- // Window_Data *wd = data;
- // App_Data *ad = wd->app;
+ Window_Data *wd = data;
+ App_Data *ad = wd->app;
+ float zoom;
- /*
- ewk_view_scale_set(wd->cur_buf->view, (arg->i & ZoomOut) ?
- // webkit_web_view_get_zoom_level(webview) +
+ zoom = (arg->i & ZoomOut) ?
ewk_view_scale_get(wd->cur_buf->view) +
(((double)(wd->count ? wd->count : 1)) * (arg->i & (1 << 1) ? 1.0 : -1.0) * ad->zoomstep) :
- (wd->count ? (double)wd->count / 100.0 : 1.0), 0, 0);
+ (wd->count ? (double)wd->count / 100.0 : 1.0);
- */
+ ewk_view_scale_set(wd->cur_buf->view, zoom, 0, 0);
+
+ gui_zoom_update(wd, zoom);
- // webkit_web_view_set_full_content_zoom(webview, (arg->i & ZoomFullContent) > 0);
- // webkit_web_view_set_zoom_level(ad->current_tab->web, (arg->i & ZoomOut) ?
- /*
- ewk_view_text_zoom_set(wd->cur_buf->view, (arg->i & ZoomOut) ?
- // webkit_web_view_get_zoom_level(webview) +
- ewk_view_zoom_get(wd->cur_buf->view) +
- (((float)(wd->count ? wd->count : 1)) * (arg->i & (1 << 1) ? 1.0 : -1.0) * ad->zoomstep) :
- (wd->count ? (float)wd->count / 100.0 : 1.0));
- */
return EINA_TRUE;
}
diff --git a/src/utilities.c b/src/utilities.c
@@ -426,10 +426,9 @@ gui_modkey_update(Window_Data *wd)
}
void
-gui_zoom_update(Window_Data *wd)
+gui_zoom_update(Window_Data *wd, float zoom)
{
Eina_Strbuf *status = eina_strbuf_new();
- float zoom = ewk_view_scale_get(wd->cur_buf->view);
if (zoom != 1.0)
eina_strbuf_append_printf(status, " %0.2lfx", zoom);
diff --git a/src/utilities.h b/src/utilities.h
@@ -31,7 +31,7 @@ void make_url(Evas_Object *label, Buffer_Data *bd);
void make_bf_list(Evas_Object *label, Buffer_Data *bd);
void gui_count_update(Window_Data*);
void gui_modkey_update(Window_Data*);
-void gui_zoom_update(Window_Data*);
+void gui_zoom_update(Window_Data*, float);
void gui_scroll_update(Window_Data*);
const char* uri_sanitize(const char*);
diff --git a/src/window.c b/src/window.c
@@ -390,7 +390,7 @@ window_main_buffer_set(Buffer_Data *new_buf)
/* right side */
gui_count_update(wd);
gui_modkey_update(wd);
- gui_zoom_update(wd);
+ gui_zoom_update(wd, ewk_view_scale_get(new_buf->view));
gui_scroll_update(wd);
}
}