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

Issue 652346 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug
Team-Security-UX



Sign in to add a comment

Page Info uses Material UI dimensions instead of common Views definitions

Project Member Reported by lgar...@chromium.org, Oct 3 2016

Issue description

In [1], msw@ pointed out that I was using custom UI dimensions in the Views implementation of the Page Info bubble.

I was following the latest full specs I had from sgabriel@ (attached), with further advice from maxwalker@.

However, there is a file with Views constants defined at views/layout/layout_constants.h [2]. It uses e.g. `kPanelHorizMargin = 13`, whereas the Material specs user 16 for the corresponding horizontal measurement. (Note that Material design uses multiples of 8.)

`layout_constants.h` refers to "spec 21/4", but no one seems to know what that is.

Designers: How should engineers interpret this difference between Material spec values and existing common constants? Should designers be speccing off the Views values?
Should the Views values be updated to use multiples of 8?

[1] https://codereview.chromium.org/2306673003
[2] https://chromium.googlesource.com/chromium/src/+blame/cee34b707ac41e83ff9d9045c0ffda49ec3f556f/views/layout/layout_constants.h
 
SPEC - Bubble - Security state.png
914 KB View Download
Cc: pkasting@chromium.org
This is something we'll have to address for all dialogs as we switch to Harmony. It's definitely the case that we don't want to have every dialog (re)define its own MD constants.

I don't claim that this is the best way forward, but changing from constants to getters is one option that springs to mind:

int GetHorizontalPadding() {
  return ui::MaterialDesignController::IsSecondaryUiMaterial() ? kValueMd : kValue;
}

We've had to do something similar in c/b/ui/layout_constants.cc so perhaps we should follow that example.

+pkasting as I heard he may be contributing to updating dialogs for Harmony and he's familiar with this general dilemma.
Yeah, if we want a common set of layout constants, and they need to be controllable at runtime (by IsSecondaryUiMaterial()), we need to use getters of some sort.  It's just a question of where to put them.

Are these things that can go in the Chrome layout_constants.* files, or are they in ui/views/ and would need to go elsewhere?
I believe we're talking about the ones in ui/views/layout/layout_constants.h
I was sort of hoping some of those could move up into chrome/, but probably not.

My guess is that simply changing these from constants to getters and leaving them in the same place is The Right Thing To Do.  We should probably only change them a few at a time, and with testing to make sure changes we make don't break anything we didn't intend to.
Status: Available (was: Untriaged)
Components: UI>Browser>Bubbles>PageInfo
Status: WontFix (was: Available)
This bug doesn't have value at this point, as we've been converting all the dialogs to use a centralized set of getters, and layout_constants.h is now gone.

Sign in to add a comment