Changeset 275493 in webkit


Ignore:
Timestamp:
Apr 6, 2021 12:28:30 AM (3 years ago)
Author:
Razvan Caliman
Message:

Web Inspector: Layout sidebar grid overlay color swatch tooltip shouldn't include "switch format" hint
https://bugs.webkit.org/show_bug.cgi?id=223418
<rdar://problem/75825793>

Reviewed by BJ Burg.

  • UserInterface/Views/CSSGridSection.js:

(WI.CSSGridSection.prototype.layout):

  • UserInterface/Views/InlineSwatch.js:

(WI.InlineSwatch):
(WI.InlineSwatch.prototype.set shiftClickColorEnabled):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._allowChangingColorFormats):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r275337 r275493  
     12021-04-06  Razvan Caliman  <rcaliman@apple.com>
     2
     3        Web Inspector: Layout sidebar grid overlay color swatch tooltip shouldn't include "switch format" hint
     4        https://bugs.webkit.org/show_bug.cgi?id=223418
     5        <rdar://problem/75825793>
     6
     7        Reviewed by BJ Burg.
     8
     9        * UserInterface/Views/CSSGridSection.js:
     10        (WI.CSSGridSection.prototype.layout):
     11        * UserInterface/Views/InlineSwatch.js:
     12        (WI.InlineSwatch):
     13        (WI.InlineSwatch.prototype.set shiftClickColorEnabled):
     14        (WI.InlineSwatch.prototype._updateSwatch):
     15        (WI.InlineSwatch.prototype._allowChangingColorFormats):
     16
    1172021-03-31  Patrick Angle  <pangle@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSGridSection.js

    r274592 r275493  
    137137            let gridColor = WI.overlayManager.getGridColorForNode(domNode);
    138138            let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Color, gridColor);
     139            swatch.shiftClickColorEnabled = false;
    139140            itemContainerElement.append(swatch.element);
    140141
  • trunk/Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js

    r269359 r275493  
    6767
    6868            case WI.InlineSwatch.Type.Color:
     69                this._shiftClickColorEnabled = true;
    6970                // Handled later by _updateSwatch.
    7071                break;
     
    122123    {
    123124        this._value = value;
     125        this._updateSwatch(true);
     126    }
     127
     128    set shiftClickColorEnabled(value)
     129    {
     130        this._shiftClickColorEnabled = !!value;
    124131        this._updateSwatch(true);
    125132    }
     
    181188
    182189        if (this._type === WI.InlineSwatch.Type.Color) {
    183             if (this._allowShiftClickColor())
     190            if (this._allowChangingColorFormats())
    184191                this._swatchElement.title = WI.UIString("Click to select a color\nShift-click to switch color formats");
    185192            else
     
    191198    }
    192199
    193     _allowShiftClickColor()
    194     {
    195         return !this._readOnly && !this.value.isOutsideSRGB();
     200    _allowChangingColorFormats()
     201    {
     202        return this._shiftClickColorEnabled && !this._readOnly && !this.value.isOutsideSRGB();
    196203    }
    197204
     
    204211        if (event.shiftKey && value) {
    205212            if (this._type === WI.InlineSwatch.Type.Color) {
    206                 if (!this._allowShiftClickColor()) {
     213                if (!this._allowChangingColorFormats()) {
    207214                    InspectorFrontendHost.beep();
    208215                    return;
Note: See TracChangeset for help on using the changeset viewer.