New issue
Advanced search Search tips

Issue 875102 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 754101


Participants' hotlists:
Harmony-Cast-Dialog


Sign in to add a comment

Media Remoting dialog has an extra padding at the bottom in English

Project Member Reported by taku...@chromium.org, Aug 16

Issue description

As shown in the screenshot, the dialog has an extra padding at the bottom, due to the body text label reporting a larger height than it should.
 
media_remoting_dialog.png
11.6 KB View Download
Cc: bsep@chromium.org
Summary: Media Remoting dialog has an extra padding at the bottom in English (was: Media Remoting dialog has an extra padding at the bottom)
This is a weird bug. I just checked Japanese and Hebrew, and the bug doesn't repro with those languages.

full_text_->GetStringSize().height() here [1] returns 60, whereas in other languages returns 40, which seems to be the correct value. All the languages use two lines of text. In the relaunch recommendation dialog, which uses the same label style and also has two lines of text, the height is 40 even in English.

The height is 40 if I don't specify views::style::CONTEXT_MESSAGE_BOX_BODY_TEXT.

Bret, do you have any idea for what might be the issue?

[1] https://cs.chromium.org/chromium/src/ui/views/controls/label.cc?sq=package:chromium&g=0&l=356
I vaguely recall an issue where multi-line text would take up too much height. I think it was  bug 766069 , which is still unresolved. But I'm not sure that applies here, and anyway I don't know why it would only happen in English.

I glanced at the dialog definition, it looks like CalculatePreferredSize is not subtracting out margins() in its width. I wonder if that has something to do with it, though again I don't know why it would only apply to English.

Hopefully that's useful. Otherwise, I don't know...
Thanks for the pointers Bret. I tried subtracting margins().width() from the width in CalculatePreferredSize() and the dialog width changed. The text now takes up three lines and the extra space is gone/taken. If this is the way to calculate the actual desired width, I'll send this change out.
remoting_dialog_subtract_margin_width.png
60.1 KB View Download
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 24

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

commit ffec9ada4e464a19cb55c9cd3aa5bb1b83461ae5
Author: Takumi Fujimoto <takumif@chromium.org>
Date: Fri Aug 24 17:37:50 2018

Use correct width in Cast-related dialogs

Subtract margin width from the preferred widths of the media remoting
and cloud services dialogs, so that they have the intended width.

Bug:  875102 
Change-Id: I362dd2bbae7f533df3f9f51d851c7f7b5d136908
Reviewed-on: https://chromium-review.googlesource.com/1187577
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585896}
[modify] https://crrev.com/ffec9ada4e464a19cb55c9cd3aa5bb1b83461ae5/chrome/browser/ui/views/media_router/cloud_services_dialog_view.cc
[modify] https://crrev.com/ffec9ada4e464a19cb55c9cd3aa5bb1b83461ae5/chrome/browser/ui/views/media_router/media_remoting_dialog_view.cc

Status: Fixed (was: Assigned)

Sign in to add a comment