Top padding is wrong on new Views translate bubble |
|||||||||||||
Issue descriptionTop padding is incorrect. Screenshot attached. Correct mocks at https://goto.google.com/chrometranslateui2016q3.
,
Jun 14 2016
,
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).
,
Jun 15 2016
Did overriding ShouldShowWindowTitle not work? Can you share the hack CL?
,
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
,
Jun 15 2016
Can you look at the password bubble and see how they do it? They seem to solve this problem.
,
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.
,
Jun 15 2016
Can we not also display text as title? I guess I'm confused.
,
Jun 15 2016
Translate displays the text in the content view, instead of the title. (IIUC). Password's body contains the username and password.
,
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().
,
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.
,
Jun 15 2016
+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.
,
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.
,
Jun 16 2016
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.)
,
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.
,
Jun 16 2016
> 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.
,
Jun 29 2016
,
Jun 29 2016
,
Jun 29 2016
Lower priority to 3 after find out password manager also show the same issue.
,
Feb 22 2017
,
Feb 22 2017
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?
,
Feb 22 2017
yyushkina@ - I know nothing about Windows/Linux. May be you got the wrong Peter?
,
Feb 22 2017
probably intended to +pkasting
,
Feb 22 2017
,
Feb 22 2017
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.
,
Apr 4 2017
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?
,
Apr 4 2017
,
Apr 5 2017
I'm fine duping this into that if that's the canonical bug.
,
Apr 27 2017
|
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by zkoch@chromium.org
, Jun 14 2016