Changeset 49741 in webkit


Ignore:
Timestamp:
Oct 17, 2009 8:49:02 AM (14 years ago)
Author:
kevino@webkit.org
Message:

Reviewed by Kevin Ollivier.

Optionally allow the user to zoom text using the mouse wheel.

https://bugs.webkit.org/show_bug.cgi?id=30444

Location:
trunk/WebKit/wx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/wx/ChangeLog

    r49712 r49741  
     12009-10-16  Kevin Watters  <kevinwatters@gmail.com>
     2
     3        Reviewed by Kevin Ollivier.
     4
     5        Optionally allow the user to zoom text using the mouse wheel.
     6       
     7        https://bugs.webkit.org/show_bug.cgi?id=30444
     8
     9        * WebView.cpp:
     10        (wxWebView::wxWebView):
     11        (wxWebView::OnMouseEvents):
     12        * WebView.h:
     13
    1142009-10-16  Kevin Ollivier  <kevino@theolliviers.com>
    215
  • trunk/WebKit/wx/WebView.cpp

    r49712 r49741  
    270270    m_isInitialized(false),
    271271    m_beingDestroyed(false),
     272    m_mouseWheelZooms(false),
    272273    m_title(wxEmptyString)
    273274{
     
    280281    m_isInitialized(false),
    281282    m_beingDestroyed(false),
     283    m_mouseWheelZooms(false),
    282284    m_title(wxEmptyString)
    283285{
     
    593595   
    594596    if (type == wxEVT_MOUSEWHEEL) {
    595         WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
    596         frame->eventHandler()->handleWheelEvent(wkEvent);
     597        if (m_mouseWheelZooms && event.ControlDown() && !event.AltDown() && !event.ShiftDown()) {
     598            if (event.GetWheelRotation() < 0)
     599                DecreaseTextSize();
     600            else if (event.GetWheelRotation() > 0)
     601                IncreaseTextSize();
     602        } else {
     603            WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
     604            frame->eventHandler()->handleWheelEvent(wkEvent);
     605        }
     606
    597607        return;
    598608    }
  • trunk/WebKit/wx/WebView.h

    r48451 r49741  
    195195    static wxWebViewCachePolicy GetCachePolicy();
    196196
     197    void SetMouseWheelZooms(bool mouseWheelZooms) { m_mouseWheelZooms = mouseWheelZooms; }
     198    bool GetMouseWheelZooms() const { return m_mouseWheelZooms; }
     199
    197200protected:
    198201
     
    217220    bool m_isInitialized;
    218221    bool m_beingDestroyed;
     222    bool m_mouseWheelZooms;
    219223    WebViewPrivate* m_impl;
    220224    wxWebFrame* m_mainFrame;
Note: See TracChangeset for help on using the changeset viewer.