New issue
Advanced search Search tips

Issue 790808 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Allow LabelButtons to shrink when their text is changed to be shorter

Project Member Reported by bsep@chromium.org, Dec 1 2017

Issue description

Currently when a LabelButton's text is changed via SetText it will only resize up by adjusting its minimum size to match its new preferred size. I would like to remove this feature.

According to msw@ this was added because buttons would bold when focused, and it looked odd if they twitched between the two sizes. But buttons no longer bold when focused.

I did some searching and I couldn't find any buttons that rely on this functionality any more. In fact, I found a couple of (minor) bugs where buttons aren't working around this functionality correctly.

First bug:
1. Disable Harmony style ("--disable-features=SecondaryUiMd")
2. Give a site a permission, like microphone or location
3. Open the page info dialog
4. Click on "Allow" next to the new permission and change it to "Ask (default)" and then back to "Allow"
5. The dotted line around the permission will be too large

Second bug:
1. Go to a foreign language website, where the Translate bubble pops up
2. Click the "options" link
3. Click "Translate"
4. Click the "options" link again
5. The "Done" button will be too large
 

Comment 1 by bsep@chromium.org, Dec 1 2017

Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 1 2017

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

commit 81f4f4b352ff2b7109c3bc631747219fb1dd4617
Author: Bret Sepulveda <bsep@chromium.org>
Date: Fri Dec 01 19:56:02 2017

Stop LabelButton's minimum size from increasing to its preferred size.

When a LabelButton changes its label from a longer to a shorter string
it would not decrease in size. This patch removes that code and cleans
up the tests and related code.

Bug:  790808 
Change-Id: I6fce4b3ecf3335c2a9d31bc2a3ac73e18f1e92a8
Reviewed-on: https://chromium-review.googlesource.com/798323
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521021}
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/chrome/browser/ui/views/page_info/permission_selector_row.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/chrome/browser/ui/views/profiles/avatar_button.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/chrome/browser/ui/views/translate/translate_bubble_view.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/ui/views/controls/button/label_button.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/ui/views/controls/button/label_button.h
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/ui/views/controls/button/label_button_unittest.cc
[modify] https://crrev.com/81f4f4b352ff2b7109c3bc631747219fb1dd4617/ui/views/examples/button_example.cc

Comment 3 by bsep@chromium.org, Dec 1 2017

Status: Fixed (was: Assigned)

Sign in to add a comment