[geary] Make zooming conversation view work with smooth scrolling
- From: Robert Schroll <rschroll src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Make zooming conversation view work with smooth scrolling
- Date: Wed, 11 Jun 2014 20:02:48 +0000 (UTC)
commit ef984d8eca1cdbfc123016bb8e86ccd361e20c81
Author: Robert Schroll <rschroll gmail com>
Date: Wed Jun 11 01:08:04 2014 -0400
Make zooming conversation view work with smooth scrolling
Often, we get smooth scrolling events on WebViews, but the zooming code
looks only for non-smooth scroll events. This handles both.
https://bugzilla.gnome.org/show_bug.cgi?id=731500
.../conversation-viewer/conversation-web-view.vala | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-web-view.vala
b/src/client/conversation-viewer/conversation-web-view.vala
index deab9b9..96d1808 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -57,10 +57,18 @@ public class ConversationWebView : StylishWebView {
public override bool scroll_event(Gdk.EventScroll event) {
if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
- if (event.direction == Gdk.ScrollDirection.UP) {
+ double dir = 0;
+ if (event.direction == Gdk.ScrollDirection.UP)
+ dir = -1;
+ else if (event.direction == Gdk.ScrollDirection.DOWN)
+ dir = 1;
+ else if (event.direction == Gdk.ScrollDirection.SMOOTH)
+ dir = event.delta_y;
+
+ if (dir < 0) {
zoom_in();
return true;
- } else if (event.direction == Gdk.ScrollDirection.DOWN) {
+ } else if (dir > 0) {
zoom_out();
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]