Changeset 251744 in webkit


Ignore:
Timestamp:
Oct 29, 2019 5:10:28 PM (4 years ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: Opacity slider background doesn't update when when hue slider moves
https://bugs.webkit.org/show_bug.cgi?id=203593
<rdar://problem/56723629>

Reviewed by Matt Baker.

  • UserInterface/Views/ColorPicker.js:

(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.colorSquareColorDidChange):
Remove unused function arguments.

(WI.ColorPicker.prototype.sliderValueDidChange):
Update the background of the opacity slider when the hue slider changes.

(WI.ColorPicker.prototype._updateOpacitySlider): Renamed from _updateSliders.
Drive-by: replace var with let.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r251682 r251744  
     12019-10-29  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Opacity slider background doesn't update when when hue slider moves
     4        https://bugs.webkit.org/show_bug.cgi?id=203593
     5        <rdar://problem/56723629>
     6
     7        Reviewed by Matt Baker.
     8
     9        * UserInterface/Views/ColorPicker.js:
     10        (WI.ColorPicker.prototype.set color):
     11        (WI.ColorPicker.prototype.colorSquareColorDidChange):
     12        Remove unused function arguments.
     13
     14        (WI.ColorPicker.prototype.sliderValueDidChange):
     15        Update the background of the opacity slider when the hue slider changes.
     16
     17        (WI.ColorPicker.prototype._updateOpacitySlider): Renamed from _updateSliders.
     18        Drive-by: replace `var` with `let`.
     19
    1202019-10-28  Nikita Vasilyev  <nvasilyev@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js

    r251487 r251744  
    124124
    125125        this._opacitySlider.value = this._color.alpha;
    126         this._updateSliders(this._colorSquare.rawColor, this._color);
     126        this._updateOpacitySlider();
    127127
    128128        this._showColorComponentInputs();
     
    144144    {
    145145        this._updateColor();
    146         this._updateSliders(this._colorSquare.rawColor, this._colorSquare.tintedColor);
     146        this._updateOpacitySlider();
    147147    }
    148148
     
    154154            this._colorSquare.hue = value * 360;
    155155            this._updateColor();
     156            this._updateOpacitySlider();
    156157        }
    157158    }
     
    190191    }
    191192
    192     _updateSliders(rawColor, tintedColor)
    193     {
    194         var rgb = this._colorSquare.tintedColor.rgb;
    195         var opaque = new WI.Color(WI.Color.Format.RGBA, rgb.concat(1)).toString();
    196         var transparent = new WI.Color(WI.Color.Format.RGBA, rgb.concat(0)).toString();
     193    _updateOpacitySlider()
     194    {
     195        let rgb = this._colorSquare.tintedColor.rgb;
     196        let opaque = new WI.Color(WI.Color.Format.RGBA, rgb.concat(1)).toString();
     197        let transparent = new WI.Color(WI.Color.Format.RGBA, rgb.concat(0)).toString();
    197198        this._opacitySlider.element.style.setProperty("background-image", "linear-gradient(90deg, " + transparent + ", " + opaque + "), " + this._opacityPattern);
    198199    }
Note: See TracChangeset for help on using the changeset viewer.