Changeset 172839 in webkit


Ignore:
Timestamp:
Aug 21, 2014 4:49:12 PM (10 years ago)
Author:
Simon Fraser
Message:

Add a button to enable paint flashing in the web inspector
https://bugs.webkit.org/show_bug.cgi?id=136133

Reviewed by Tim Hatcher.

Add a button to the right of the layer borders button to turn on paint flashing.
Future patches will actually enable this feature.

  • Localizations/en.lproj/localizedStrings.js: Tooltip strings.
  • UserInterface/Images/PaintFlashing.svg: Added. "Paintbrush" icon.
  • UserInterface/Views/DOMTreeContentView.js:

(WebInspector.DOMTreeContentView):
(WebInspector.DOMTreeContentView.prototype.get navigationItems):
(WebInspector.DOMTreeContentView.prototype._togglePaintFlashing):

Location:
trunk/Source/WebInspectorUI
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r172820 r172839  
     12014-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add a button to enable paint flashing in the web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=136133
     5
     6        Reviewed by Tim Hatcher.
     7       
     8        Add a button to the right of the layer borders button to turn on paint flashing.
     9        Future patches will actually enable this feature.
     10
     11        * Localizations/en.lproj/localizedStrings.js: Tooltip strings.
     12        * UserInterface/Images/PaintFlashing.svg: Added. "Paintbrush" icon.
     13        * UserInterface/Views/DOMTreeContentView.js:
     14        (WebInspector.DOMTreeContentView):
     15        (WebInspector.DOMTreeContentView.prototype.get navigationItems):
     16        (WebInspector.DOMTreeContentView.prototype._togglePaintFlashing):
     17
    1182014-08-20  Saam Barati  <sbarati@apple.com>
    219
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r172435 r172839  
    135135localizedStrings["Disable Breakpoints"] = "Disable Breakpoints";
    136136localizedStrings["Disable all breakpoints"] = "Disable all breakpoints";
     137localizedStrings["Disable paint flashing"] = "Disable paint flashing";
    137138localizedStrings["Disable point to inspect mode (%s)"] = "Disable point to inspect mode (%s)";
    138139localizedStrings["Disabled"] = "Disabled";
     
    182183localizedStrings["Enable Breakpoints"] = "Enable Breakpoints";
    183184localizedStrings["Enable all breakpoints"] = "Enable all breakpoints";
     185localizedStrings["Enable paint flashing"] = "Enable paint flashing";
    184186localizedStrings["Enable point to inspect mode (%s)"] = "Enable point to inspect mode (%s)";
    185187localizedStrings["Encoded"] = "Encoded";
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r172241 r172839  
    4343    this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible;
    4444
     45    this._paintFlashingButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("paint-flashing", WebInspector.UIString("Enable paint flashing"), WebInspector.UIString("Disable paint flashing"), "Images/PaintFlashing.svg", 16, 16);
     46    this._paintFlashingButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this);
     47    this._paintFlashingButtonNavigationItem.enabled = true;
     48
    4549    WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
    4650    this._showsShadowDOMButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("shows-shadow-DOM", WebInspector.UIString("Show shadow DOM nodes"), WebInspector.UIString("Hide shadow DOM nodes"), shadowDOMImage.src, shadowDOMImage.width, shadowDOMImage.height);
     
    7579    get navigationItems()
    7680    {
    77         return [this._showsShadowDOMButtonNavigationItem, this._compositingBordersButtonNavigationItem];
     81        return [this._showsShadowDOMButtonNavigationItem, this._compositingBordersButtonNavigationItem, this._paintFlashingButtonNavigationItem];
    7882    },
    7983
     
    415419    },
    416420
     421    _togglePaintFlashing: function(event)
     422    {
     423        console.assert(PageAgent.setShowPaintRects);
     424
     425        var activated = !this._paintFlashingButtonNavigationItem.activated;
     426        this._paintFlashingButtonNavigationItem.activated = activated;
     427        PageAgent.setShowPaintRects(activated);
     428    },
     429
    417430    _updateCompositingBordersButtonToMatchPageSettings: function()
    418431    {
Note: See TracChangeset for help on using the changeset viewer.