[evolution/wip-webkit2] Port zoom API in EMailReader
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip-webkit2] Port zoom API in EMailReader
- Date: Fri, 18 Oct 2013 12:08:46 +0000 (UTC)
commit 3974d378eacf463ce1cbd28af261881979da0f49
Author: Tomas Popela <tpopela redhat com>
Date: Fri Oct 18 14:06:44 2013 +0200
Port zoom API in EMailReader
mail/e-mail-reader.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 761fa58..a0e24ab 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1754,10 +1754,17 @@ action_mail_zoom_in_cb (GtkAction *action,
EMailReader *reader)
{
EMailDisplay *display;
+ gdouble zoom_level;
display = e_mail_reader_get_mail_display (reader);
- webkit_web_view_zoom_in (WEBKIT_WEB_VIEW (display));
+ /* There is no webkit_web_view_zoom_in function in WK2, so emulate it */
+ zoom_level = webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (display));
+ /* zoom-step in WK1 was 0.1 */
+ zoom_level += 0.1;
+ webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (display), zoom_level);
+/* FIXME XXX
+ webkit_web_view_zoom_in (WEBKIT_WEB_VIEW (web_view));*/
}
static void
@@ -1765,10 +1772,18 @@ action_mail_zoom_out_cb (GtkAction *action,
EMailReader *reader)
{
EMailDisplay *display;
+ gdouble zoom_level;
display = e_mail_reader_get_mail_display (reader);
- webkit_web_view_zoom_out (WEBKIT_WEB_VIEW (display));
+ /* There is no webkit_web_view_zoom_out function in WK2, so emulate it */
+ zoom_level = webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (web_view));
+ /* zoom-step in WK1 was 0.1 */
+ zoom_level -= 0.1;
+ if (zoom_level >= 0)
+ webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (web_view), zoom_level);
+/* FIXME XXX
+ webkit_web_view_zoom_out (WEBKIT_WEB_VIEW (web_view));*/
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]