Changeset 190416 in webkit


Ignore:
Timestamp:
Oct 1, 2015, 10:42:21 AM (10 years ago)
Author:
BJ Burg
Message:

Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
https://bugs.webkit.org/show_bug.cgi?id=149590

Patch by João Oliveira <hello@jxs.pt> on 2015-09-30
Reviewed by Joseph Pecoraro.

Patch by João Oliveira and Brian Burg.

Source/WebCore:

Expose the frontend page's zoom factor so we can implement relative zoom.

  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::zoomFactor): Added.

  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.idl:
  • page/Frame.h:

(WebCore::Frame::pageZoomFactor):

Source/WebInspectorUI:

  • UserInterface/Base/Main.js:

(WebInspector.contentLoaded): Add global keyboard shortcuts for zoom in and zoom out.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190413 r190416  
     12015-09-30  João Oliveira  <hello@jxs.pt>
     2
     3        Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
     4        https://bugs.webkit.org/show_bug.cgi?id=149590
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Patch by João Oliveira and Brian Burg.
     9
     10        Expose the frontend page's zoom factor so we can implement relative zoom.
     11
     12        * inspector/InspectorFrontendHost.cpp:
     13        (WebCore::InspectorFrontendHost::zoomFactor): Added.
     14        * inspector/InspectorFrontendHost.h:
     15        * inspector/InspectorFrontendHost.idl:
     16        * page/Frame.h:
     17        (WebCore::Frame::pageZoomFactor):
     18
    1192015-10-01  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp

    r190271 r190416  
    175175}
    176176
     177void InspectorFrontendHost::inspectedURLChanged(const String& newURL)
     178{
     179    if (m_client)
     180        m_client->inspectedURLChanged(newURL);
     181}
     182
    177183void InspectorFrontendHost::setZoomFactor(float zoom)
    178184{
     
    180186}
    181187
    182 void InspectorFrontendHost::inspectedURLChanged(const String& newURL)
    183 {
    184     if (m_client)
    185         m_client->inspectedURLChanged(newURL);
     188float InspectorFrontendHost::zoomFactor()
     189{
     190    return m_frontendPage->mainFrame().pageZoomFactor();
    186191}
    187192
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.h

    r189558 r190416  
    5858    void closeWindow();
    5959    void bringToFront();
     60    void inspectedURLChanged(const String&);
     61
    6062    void setZoomFactor(float);
    61     void inspectedURLChanged(const String&);
     63    float zoomFactor();
    6264
    6365    void setAttachedWindowHeight(unsigned);
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.idl

    r189558 r190416  
    3838    void closeWindow();
    3939    void bringToFront();
     40    void inspectedURLChanged(DOMString newURL);
     41
    4042    void setZoomFactor(unrestricted float zoom);
    41     void inspectedURLChanged(DOMString newURL);
     43    float zoomFactor();
    4244
    4345    void requestSetDockSide(DOMString side);
  • trunk/Source/WebInspectorUI/ChangeLog

    r190405 r190416  
     12015-09-30  João Oliveira  <hello@jxs.pt>
     2
     3        Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
     4        https://bugs.webkit.org/show_bug.cgi?id=149590
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Patch by João Oliveira and Brian Burg.
     9
     10        * UserInterface/Base/Main.js:
     11        (WebInspector.contentLoaded): Add global keyboard shortcuts for zoom in and zoom out.
     12
    1132015-10-01  Andres Gomez  <agomez@igalia.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r190149 r190416  
    246246    this.detailsSidebarKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Option, "0", this.toggleDetailsSidebar.bind(this));
    247247
     248    this._increaseZoomKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Plus, this._increaseZoom.bind(this));
     249    this._decreaseZoomKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Minus, this._decreaseZoom.bind(this));
     250
    248251    this.tabBrowser = new WebInspector.TabBrowser(document.getElementById("tab-browser"), this.tabBar, this.navigationSidebar, this.detailsSidebar);
    249252    this.tabBrowser.addEventListener(WebInspector.TabBrowser.Event.SelectedTabContentViewDidChange, this._tabBrowserSelectedTabContentViewDidChange, this);
     
    18091812};
    18101813
     1814WebInspector._increaseZoom = function(event) {
     1815    let currentZoom = InspectorFrontendHost.zoomFactor();
     1816    InspectorFrontendHost.setZoomFactor(currentZoom * 1.2);
     1817    event.preventDefault();
     1818};
     1819
     1820WebInspector._decreaseZoom = function(event) {
     1821    let currentZoom = InspectorFrontendHost.zoomFactor();
     1822    InspectorFrontendHost.setZoomFactor(currentZoom * 0.8);
     1823    event.preventDefault();
     1824};
     1825
    18111826WebInspector._generateDisclosureTriangleImages = function()
    18121827{
Note: See TracChangeset for help on using the changeset viewer.