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

Issue 619191 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 658854
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Top padding is wrong on new Views translate bubble

Project Member Reported by zkoch@chromium.org, Jun 10 2016

Issue description

Top padding is incorrect. Screenshot attached.

Correct mocks at https://goto.google.com/chrometranslateui2016q3.
 
Screenshot (7) (1).png
1.6 MB View Download

Comment 1 by zkoch@chromium.org, Jun 14 2016

Cc: ftang@chromium.org

Comment 2 by zkoch@chromium.org, Jun 14 2016

Owner: ftang@chromium.org

Comment 3 by ftang@chromium.org, Jun 15 2016

I have hard time to figure out what is the "right" top padding. I made a hack (not in check in shape) change to reduce the top padding to the "normal" size, but it then conflict with the close button. (see attachment). The reason the top padding currently is this tall is because the frame add those padding based on the height of the closer button. (see attachment).
padding.png
18.7 KB View Download

Comment 4 by groby@chromium.org, Jun 15 2016

Did overriding ShouldShowWindowTitle not work? Can you share the hack CL?

Comment 5 by ftang@chromium.org, Jun 15 2016

no, it does not work. the reason is the padding is decided by the following function. 
Notice even ShouldShowWindowTitle() return false, which make label_height as 0, the std::max(title_height, close_height) will be close_height. the close icon is ui/resources/default_100_percent/close_dialog.png and is 14x14.


gfx::Insets BubbleFrameView::GetInsets() const {
  gfx::Insets insets = content_margins_;

  const int icon_height = title_icon_->GetPreferredSize().height();
  const int label_height = title_->GetPreferredSize().height();
  const bool has_title = icon_height > 0 || label_height > 0;
  const int title_padding = has_title ? title_margins_.height() : 0;
  const int title_height = std::max(icon_height, label_height) + title_padding;
  const int close_height = close_->visible() ? close_->height() : 0;
  insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0);
  return insets;
}

My hack (just to figure out what is the right look) is change the line to
  insets += gfx::Insets(title_height, 0, 0, 0);

of course, it is not acceptable, just try to figure out what will it looks like if we remove the close height. The result is the top padding looks great but will conflict with the close icon on the upper right conner 

Comment 6 by zkoch@chromium.org, Jun 15 2016

Can you look at the password bubble and see how they do it? They seem to solve this problem.


Screen Shot 2016-06-15 at 12.15.46 PM.png
20.7 KB View Download

Comment 7 by groby@chromium.org, Jun 15 2016

The passwords bubble displays the text *as title*. :) 

Can we get a redlined translate bubble so we actually know what the desired outcome is? I'd personally think that simply disabling the title would be the right thing, but I don't have a screenshot, so I can't compare.

Also, attaching the mock from the presentation so we don't constantly have to wait for that to load. 


Screen Shot 2016-06-15 at 12.38.39 PM.png
80.4 KB View Download

Comment 8 by zkoch@chromium.org, Jun 15 2016

Can we not also display text as title? I guess I'm confused.

Comment 9 by groby@chromium.org, Jun 15 2016

Translate displays the text in the content view, instead of the title. (IIUC). Password's body contains the username and password.

Comment 10 by ftang@chromium.org, Jun 15 2016

I don't think the link text in password manager is display as "title" after reading https://cs.chromium.org/chromium/src/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

It looks there are two code path there. One use the WindowTitle if model_.title_brand_link_range().is_empty() and the other display the model_.title_brand_link_range(). 

Comment 11 by ftang@chromium.org, Jun 15 2016

zach- is that true the screenshot you took for password manager is from Mac instead of Windows? I use the window build (Version 52.0.2739.0 dev-m (64-bit)) to see the password manager the following way. It show me the same top padding as Translate bubble.

1. use a "chrome" not "chromium" build
2. click "setting"
3. click "show advanced setting..."
4. scroll to "Passwords and forms" 
5. check "Offer to save passwords with Google Smart Lock for passwords.
6. visit a page which require login
7. Login and see the Password manager show up with "Do you want <blue>Google Smart Lock </blue> to save your password for this site?"
Notice the top padding, with the close icon, is exactly the same as Translate bubble.

password_translate.png
19.3 KB View Download

Comment 12 by groby@chromium.org, Jun 15 2016

Cc: est...@chromium.org
+estade, who did some refactoring on Views/Bubbles. Evan, is that the expected behavior for a bubble with no title, or should the text move higher?

zkoch: Can we please get a redlined bubble spec? Comparing the Mac and Views version, it's very hard to decide what's actually the right look. 

BTW: When this was originally implemented (bug #611626), the spec looked exactly like what we're seeing here. Re-attached for the heck of it. 

dfc4a2bb-7531-4824-a8c4-1aa0b588c83e.png
51.3 KB View Download

Comment 13 by zkoch@chromium.org, Jun 15 2016

Redlines coming. I asked the designer.

That padding just looks super weird, though I agree with Frank that passwords have the same problem.
I think this is a result of crrev.com/7223e2c7d071d74bcd66 which added a close button that pushes the rest of the contents down. Other bubbles have the title correctly aligned because they use simple titles (no inlined links) and the translate bubble instead fakes a title. The correct solution would be to add support for linkified titles (or arbitrary title views) to BubbleDialogDelegateView/BubbleFrameView.

When we let individual bubbles create one off solutions, we get the ugliness  ftang's side-by-side screenshots reveal (different content indentation, different title font size, etc.)

Comment 15 by pendar@google.com, Jun 16 2016

Original redlines are in this bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=611626

I didn't specify the padding because I assumed there is a standardized padding for all bubbles and I didn't want to conflict with that. Unfortunately I couldn't find any documented general bubble specs for Chrome. 
> I didn't specify the padding because I assumed there is a standardized padding 
> for all bubbles and I didn't want to conflict with that.

this is the correct thing to do.

Comment 17 by ftang@chromium.org, Jun 29 2016

Components: UI>Browser>Translate

Comment 18 by ftang@chromium.org, Jun 29 2016

Summary: Top padding is wrong on new Views translate bubble (was: Padding is wrong on new Views translate bubble)

Comment 19 by ftang@chromium.org, Jun 29 2016

Labels: -Pri-1 Pri-3
Lower priority to 3 after find out password manager also show the same issue.
Blocking: -608500
Cc: pkl@chromium.org
Peter - can you take a look and let us know whether it's correct to assume that the top padding issue will be fixed with Harmony efforts?

Comment 22 by pkl@chromium.org, Feb 22 2017

yyushkina@ - I know nothing about Windows/Linux. May be you got the wrong Peter?
Cc: pkasting@chromium.org
probably intended to +pkasting

Comment 24 by pkl@chromium.org, Feb 22 2017

Cc: -pkl@chromium.org
We'll make sure Harmony gets things right.

yyushkina@: are there bugs on file for Harmonizing the various translate dialogs, that link to hwi's mocks?  I didn't see any from the Harmony tracking spreadsheet.  I ask because we should have some, and it's possible this should be one, or be duped against one, or be closed in favor of one.

If you're not aware of any, let me know whether you'll file some or I should go through and file some.
Cc: yyushkina@chromium.org
Looks like I wasn't cc'ed on this bug so just now saw your comment pkasting@. 658854 is the only  bug for Harmonizing various translate dialogs. Should I dupe this one into it? 
Cc: hwi@chromium.org pendar@google.com
 Issue 701463  has been merged into this issue.
Mergedinto: 658854
Status: Duplicate (was: Assigned)
I'm fine duping this into that if that's the canonical bug.
Components: -UI>Browser>Translate UI>Browser>Language>Translate

Sign in to add a comment