Commit Graph
9 Commits
Author SHA1 Message Date
Alex Rudenko b5552d18ba Fix a11y issues in Layout panel
This CL addresses a few issues with a11y:

- Color picker can now be opened via keyboard and has proper
focus/hover styles.
- Same for the button to reveal the element + tweaked colors.

Fixed: 1131367
Change-Id: I8ec8380ce44bcf43da88b74aca61fdb575646407
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2436825
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-09-29 12:31:09 +00:00
Alex Rudenko 1e2dd0ea03 Add focus outline to checkboxes in Layout panel
This CL adds an outline for focused checkboxes. The outline style is
the same as for other checkboxes in DevTools.

Screenshot: https://i.imgur.com/R4vMUr3.png

Fixed: 1130929
Change-Id: I995f3e3fe6ea9ca916e5493d6edf0c2e7ecbce39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422956
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-22 12:40:06 +00:00
Alex Rudenko 994d019fcb Highlight grid elements on hover
This CL adds highlighting for grid lements in Layout panel.

Screenshot: https://i.imgur.com/shpPOKF.png
Bug: 1109177
Change-Id: Ie0ab990f78cc025c58f74ea654662baad477d885
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2416510
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
2020-09-17 16:44:18 +00:00
Alex Rudenko bc83da97d2 Color picker for Layout pane
Adds standard color picker to Layout panel (not-persistent yet).

Bug: 1109177
Change-Id: If02e72ac6fb0afe0eb76c8afaa890385a092e70a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406163
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-09-15 09:51:04 +00:00
Patrick Brosset 510f71e848 Layout: Avoid shrinking color swatches in layout panel
When the panel is narrow, the color swatches sometimes shrink in width.
We don't want this.

This super simple change prevents this.

Before: https://imgur.com/mBoWid5.jpg
After: https://imgur.com/jAnBefF.jpg

Bug: 1109177
Change-Id: I726786271a365f46b09dca325c40675ad3b4708c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2404387
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-09-11 08:48:26 +00:00
Patrick Brosset 436d8ac8c5 Don't make NodeText a block element to apply ellipsis in Layout panel
In bug 1109177 I cleaned up the display of nodes listed in the Layout
panel by making them not wrap, and have an ellipsis when they were too
long.
This caused a visual regression in the breadcrumbs of the Elements tree.
The nodes there use the same component and they were affected by my
CSS change.
Namely, the focus outline became taller and got cropped.

In this change, I'm just reverting the change of CSS to NodeText.
Instead, I'm moving this to the layoutPane.css, so it now only applies
to nodes in the Layout pane, and not the breadcrumbs anymore.

Before: https://imgur.com/CTGA6SO.jpg
After: https://imgur.com/sFfUQLk.jpg

Bug: 1124250
Change-Id: I9433cf0187be17a0044766472236470bb1be4b79
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2389035
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Michael Liao <michael.liao@microsoft.com>
2020-09-03 17:25:07 +00:00
Patrick Brosset 1824faf288 Layout: Give each grid overlay a different color in order to differentiate them
There can be many grids on a single page, and therefore many adorners in the
Elements tree and many checkboxes in the Layout panel.
Users may want to turn several of these grids on so they can see visually in
the page how they align.

Right now, all grids share the same colors, this makes it hard to know which
lines and which labels belong to which grids:
Example: https://imgur.com/OqqeFGN.jpg

This change introduces some logic to generate a new color for each grid overlay.
Only the main color is generated, and an alpha value is used to derive the gap
color from it. The labels already match the line colors provided, so no changes
needed for this.
Example: https://imgur.com/Kja5xNK.jpg

To generate colors, we use the HSV format and set the S and V values so that we
can go through the whole hue spectrum and keep some consistency between the
colors.
This does mean, however, that we are limited in how many different colors we can
generate (we need to incremenet the H value quite a bit every time to make sure
colors aren't too similar). Hence, after 10 colors or so, we circle back.

Colors are attributed per nodeId, and stored in a map indexed by those ids. This
means that colors are persistent in a user session.

In a future CL, we'll make the swatches clickable so users can change the
colors.

Bug: 1123052
Change-Id: Ie9fa67432230473bcdd438f9b5adf3fce169d165
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2384794
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
2020-09-03 09:48:31 +00:00
Patrick Brosset af165fe4d2 Layout: Assorted cosmetic changes to the layout pane as per mockups
This change brings the new Layout panel closer to what the mockups for
this panel specify and also makes a few fixes to manage narrow and wide
sizes better.

For information, the last mockups were shared in this thread:
https://chromium.slack.com/archives/C016SAMDTK7/p1597755197253400?thread_ts=1597421739.244800&cid=C016SAMDTK7

Here is the list of changes:
* Removed the label before the line label drop-down, as per mockups
* Made the line label drop-down first in the settings section
* Fixed a bug where elements would appear as div..class when the
  className contained whitespaces
* Centered checkboxes and labels vertically
* Clipped long node previews with an ellipsis to avoid horizontal
  scrolling
* Fixed a bug where the checkboxes and select button became smaller
  when there was enough space
* Introduced multi-column layout for when the panel is super wide

Before: https://imgur.com/Jo8oMG7.jpg
After: https://imgur.com/zEmGi3V.jpg (also includes moving the settings
to the top, which is in another CL, that I happened to build this CL on)

Bug: 1109177
Change-Id: I1a7c543f7f21d5e003cdb91dbb44dc04765aa0a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379226
Reviewed-by: Michael Liao <michael.liao@microsoft.com>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-08-31 08:41:16 +00:00
Alex Rudenko 320d83cddb Fix LayoutPane icon appearance in dark mode
Fixed the Reveal element icon in the dark mode and, as a drive-by,
extracts LayoutPane's CSS into a separate file (+ 1 problem fixed
by CSS linter).

Bug: 1109177
Change-Id: Iaa02d93aae6f74aab520e70093584870e4fa5c46
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364356
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-20 06:47:24 +00:00