New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 831968 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 831921



Sign in to add a comment

Desktop PWAs: menu button cropped with --top-chrome-md=material-touch-optimized --enable-features=SecondaryUiMd

Project Member Reported by alancutter@chromium.org, Apr 12 2018

Issue description

Chrome Version: 66

When we run chromeOS with "--top-chrome-md=material-touch-optimized --enable-features=SecondaryUiMd" command line flags the menu button icon is visually cropped.

With either of the flags removed the menu button icon looks as expected.

See screenshots.
 
expected.png
3.4 KB View Download
cropped.png
3.6 KB View Download
The gfx::Canvas::GetClipBounds inside ImageView::OnPaintImage() is different.

Normally it's size is (14, 16) but with the flags it's only (10, 10). That doesn't fully explain what we see but it's a start.
--draw-view-bounds-rects reveals the clip box the icon is being drawn into, possibly an inset is being applied to the view?
draw-rects.png
3.4 KB View Download
Looks like this is the critical bit of code that changes behaviour when those two flags are enabled:

gfx::Inset HarmonyLayoutProvider::GetInsetsMetric(int metric) {
  switch (metric) {
    ...
    case views::InsetsMetric::INSETS_LABEL_BUTTON:
      if (ui::MaterialDesignController::IsTouchOptimizedUiEnabled())
        return gfx::Insets(kHarmonyLayoutUnit / 2, kHarmonyLayoutUnit / 2);
      return ChromeLayoutProvider::GetInsetsMetric(metric);
   ...
}
Blockedon: 831921
This button needs to be updated for touch UI anyway so this should get fixed as part of that effort.
Created a CL that just removes the inset from the hosted app menu button as we have no need for it: https://chromium-review.googlesource.com/#/c/chromium/src/+/1011922
before.png
4.4 KB View Download
after.png
4.4 KB View Download
Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c071f74f1fc90449ab5ee85ae810f08d79a62759

commit c071f74f1fc90449ab5ee85ae810f08d79a62759
Author: Alan Cutter <alancutter@chromium.org>
Date: Mon Apr 16 06:00:25 2018

Remove inset from hosted app menu button

This CL fixes undesirably large insets on the hosted app menu button
that get set when command line flags
"--top-chrome-md=material-touch-optimized --enable-features=SecondaryUiMd"
are used on chromeOS causing the menu icon to get cropped.

Before:
https://bugs.chromium.org/p/chromium/issues/attachment?aid=334387&signed_aid=zaosvDPanfssI1aE7ljaww==&inline=1

After:
https://bugs.chromium.org/p/chromium/issues/attachment?aid=334388&signed_aid=sVoIaJthm75DLZgxqr06fA==&inline=1


Bug:  831968 
Change-Id: I20bcc33aef41a0e0872170e7751502936c63ded4
Reviewed-on: https://chromium-review.googlesource.com/1011922
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550938}
[modify] https://crrev.com/c071f74f1fc90449ab5ee85ae810f08d79a62759/chrome/browser/ui/views/frame/hosted_app_menu_button.cc

Status: Fixed (was: Started)
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c071f74f1fc90449ab5ee85ae810f08d79a62759

commit c071f74f1fc90449ab5ee85ae810f08d79a62759
Author: Alan Cutter <alancutter@chromium.org>
Date: Mon Apr 16 06:00:25 2018

Remove inset from hosted app menu button

This CL fixes undesirably large insets on the hosted app menu button
that get set when command line flags
"--top-chrome-md=material-touch-optimized --enable-features=SecondaryUiMd"
are used on chromeOS causing the menu icon to get cropped.

Before:
https://bugs.chromium.org/p/chromium/issues/attachment?aid=334387&signed_aid=zaosvDPanfssI1aE7ljaww==&inline=1

After:
https://bugs.chromium.org/p/chromium/issues/attachment?aid=334388&signed_aid=sVoIaJthm75DLZgxqr06fA==&inline=1


Bug:  831968 
Change-Id: I20bcc33aef41a0e0872170e7751502936c63ded4
Reviewed-on: https://chromium-review.googlesource.com/1011922
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550938}
[modify] https://crrev.com/c071f74f1fc90449ab5ee85ae810f08d79a62759/chrome/browser/ui/views/frame/hosted_app_menu_button.cc

Cc: mkarkada@chromium.org mgiuca@chromium.org dhadd...@chromium.org abod...@chromium.org alancutter@chromium.org
 Issue 836429  has been merged into this issue.

Sign in to add a comment