Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Inspector: Rearrange Gradient Editor to be able to show the color component input fields #2861

Merged
merged 1 commit into from
Jul 30, 2022

Conversation

patrickangle
Copy link
Contributor

@patrickangle patrickangle commented Jul 29, 2022

6d528bd

Web Inspector: Rearrange Gradient Editor to be able to show the color component input fields
https://bugs.webkit.org/show_bug.cgi?id=243352
rdar://97803004

Reviewed by Devin Rousso.

Move the angle control above the color controls so that controls become more specific as you move from top to bottom of
the gradient editor. This also affords us the breathing room to show the color component fields at the bottom of the
color picker.

* Source/WebInspectorUI/UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.async colorInputsWrapperElement):
(WI.ColorPicker.prototype._showColorComponentInputs):
(WI.ColorPicker.set enableColorComponentInputs): Deleted.
* Source/WebInspectorUI/UserInterface/Views/GradientEditor.css:
(.gradient-editor):
(.gradient-editor > .gradient-type-select):
(.gradient-editor > .gradient-slider):
(.gradient-editor > .color-picker):
(.gradient-editor > .gradient-angle):
(.gradient-editor.radial-gradient): Deleted.
(.gradient-editor.editing-color): Deleted.
(.gradient-editor.radial-gradient.editing-color): Deleted.
* Source/WebInspectorUI/UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):

Canonical link: https://commits.webkit.org/252971@main

@patrickangle patrickangle self-assigned this Jul 29, 2022
@patrickangle patrickangle added Web Inspector Bugs related to the WebKit Web Inspector. WebKit Nightly Build labels Jul 29, 2022
@patrickangle
Copy link
Contributor Author

Screen.Recording.2022-07-29.at.1.51.50.PM.mov


this._colorPicker = new WI.ColorPicker;
this._colorPicker.colorSquare.dimension = 195;
this._colorPicker.enableColorComponentInputs = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops :P

set enableColorComponentInputs(value)
{
this._enableColorComponentInputs = value;
this._element.classList.toggle("hide-inputs", !this._enableColorComponentInputs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also get rid of the CSS .color-picker.hide-inputs?

@@ -24,25 +25,13 @@
*/

.gradient-editor {
--gradient-editor-controls-width: 237px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: should only have one space after :

NIT: I usually put CSS variables at the bottom of a declaration so that the actual things that affect style are shown first (similar to how we put member variables at the bottom of a class in C++)

padding-bottom: 15px;
}

.gradient-editor.editing-color {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like we could also get rid of "editing-color" in the JS too?

}

.gradient-editor > .gradient-type-select {
width: 237px;
width: var(--gradient-editor-controls-width);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would width: 100% not work here?

}

.gradient-editor > .color-picker {
width: 238px;
width: calc(var(--gradient-editor-controls-width) + 1px);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto (:34)

@@ -65,12 +54,11 @@
}

.gradient-editor > .gradient-angle {
width: var(--gradient-editor-controls-width);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto (:34)

@patrickangle patrickangle added the merge-queue Applied to send a pull request to merge-queue label Jul 29, 2022
… component input fields

https://bugs.webkit.org/show_bug.cgi?id=243352
rdar://97803004

Reviewed by Devin Rousso.

Move the angle control above the color controls so that controls become more specific as you move from top to bottom of
the gradient editor. This also affords us the breathing room to show the color component fields at the bottom of the
color picker.

* Source/WebInspectorUI/UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.async colorInputsWrapperElement):
(WI.ColorPicker.prototype._showColorComponentInputs):
(WI.ColorPicker.set enableColorComponentInputs): Deleted.
* Source/WebInspectorUI/UserInterface/Views/GradientEditor.css:
(.gradient-editor):
(.gradient-editor > .gradient-type-select):
(.gradient-editor > .gradient-slider):
(.gradient-editor > .color-picker):
(.gradient-editor > .gradient-angle):
(.gradient-editor.radial-gradient): Deleted.
(.gradient-editor.editing-color): Deleted.
(.gradient-editor.radial-gradient.editing-color): Deleted.
* Source/WebInspectorUI/UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):

Canonical link: https://commits.webkit.org/252971@main
@webkit-commit-queue
Copy link
Collaborator

Committed 252971@main (6d528bd): https://commits.webkit.org/252971@main

Reviewed commits have been landed. Closing PR #2861 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 6d528bd into WebKit:main Jul 30, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web Inspector Bugs related to the WebKit Web Inspector.
Projects
None yet
4 participants