[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

kevino at webkit.org kevino at webkit.org
Thu Oct 29 20:46:54 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit fa87a16f618e5e13ace29faecbe5c287c1db7c6e
Author: kevino at webkit.org <kevino at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 17 15:49:02 2009 +0000

    Reviewed by Kevin Ollivier.
    
    Optionally allow the user to zoom text using the mouse wheel.
    
    https://bugs.webkit.org/show_bug.cgi?id=30444
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49741 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index d90cfa4..51ac132 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-16  Kevin Watters  <kevinwatters at gmail.com>
+
+        Reviewed by Kevin Ollivier.
+
+        Optionally allow the user to zoom text using the mouse wheel.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=30444
+
+        * WebView.cpp:
+        (wxWebView::wxWebView):
+        (wxWebView::OnMouseEvents):
+        * WebView.h:
+
 2009-10-16  Kevin Ollivier  <kevino at theolliviers.com>
 
         wxMSW non-precomp headers build fix.
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index 9f2d369..6c7d181 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -269,6 +269,7 @@ wxWebView::wxWebView() :
     m_isEditable(false),
     m_isInitialized(false),
     m_beingDestroyed(false),
+    m_mouseWheelZooms(false),
     m_title(wxEmptyString)
 {
 }
@@ -279,6 +280,7 @@ wxWebView::wxWebView(wxWindow* parent, int id, const wxPoint& position,
     m_isEditable(false),
     m_isInitialized(false),
     m_beingDestroyed(false),
+    m_mouseWheelZooms(false),
     m_title(wxEmptyString)
 {
     Create(parent, id, position, size, style, name);
@@ -592,8 +594,16 @@ void wxWebView::OnMouseEvents(wxMouseEvent& event)
     wxEventType type = event.GetEventType();
     
     if (type == wxEVT_MOUSEWHEEL) {
-        WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
-        frame->eventHandler()->handleWheelEvent(wkEvent);
+        if (m_mouseWheelZooms && event.ControlDown() && !event.AltDown() && !event.ShiftDown()) {
+            if (event.GetWheelRotation() < 0)
+                DecreaseTextSize();
+            else if (event.GetWheelRotation() > 0)
+                IncreaseTextSize();
+        } else {
+            WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
+            frame->eventHandler()->handleWheelEvent(wkEvent);
+        }
+
         return;
     }
     
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index e83c420..e44def9 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -194,6 +194,9 @@ public:
     static void SetCachePolicy(const wxWebViewCachePolicy& cachePolicy);
     static wxWebViewCachePolicy GetCachePolicy();
 
+    void SetMouseWheelZooms(bool mouseWheelZooms) { m_mouseWheelZooms = mouseWheelZooms; }
+    bool GetMouseWheelZooms() const { return m_mouseWheelZooms; }
+
 protected:
 
     // event handlers (these functions should _not_ be virtual)
@@ -216,6 +219,7 @@ private:
     bool m_isEditable;
     bool m_isInitialized;
     bool m_beingDestroyed;
+    bool m_mouseWheelZooms;
     WebViewPrivate* m_impl;
     wxWebFrame* m_mainFrame;
     wxString m_title;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list