Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Issue 111023004: Add GetMinimumSize() for Labels and ensure it's zero for empty Links. (Closed)

Created:
7 years ago by Peter Kasting
Modified:
7 years ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Add GetMinimumSize() for Labels and ensure it's zero for empty Links. This requires auto-disabling focusability for empty links. I also reordered the overrides for Link to match the View declaration order. This also requires some major reworking of StyledLabel, which previously assumed all Links had a focus border, and to make layout easier just forced space for a focus border on all children at all times, as well as always reserving space itself. I've changed this so StyledLabel lays out children correctly, accounting for their focus borders, and only adds space for one itself if any children have a focus border. This eliminates the need for Label::SetHasFocusBorder(), which only had one non-StyledLabel caller (who didn't need it). BUG=none TEST=none R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=239864

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -133 lines) Patch
M chrome/browser/ui/views/avatar_menu_bubble_view.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/controls/label.h View 1 5 chunks +9 lines, -10 lines 0 comments Download
M ui/views/controls/label.cc View 1 2 3 5 chunks +18 lines, -15 lines 0 comments Download
M ui/views/controls/link.h View 2 chunks +8 lines, -11 lines 0 comments Download
M ui/views/controls/link.cc View 1 5 chunks +49 lines, -36 lines 0 comments Download
M ui/views/controls/styled_label.h View 1 2 3 3 chunks +5 lines, -4 lines 0 comments Download
M ui/views/controls/styled_label.cc View 1 2 3 15 chunks +53 lines, -31 lines 0 comments Download
M ui/views/controls/styled_label_unittest.cc View 1 2 3 4 10 chunks +39 lines, -25 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Peter Kasting
7 years ago (2013-12-10 01:45:18 UTC) #1
Peter Kasting
I had to update this to fix the unittests, which required major surgery to StyledLabel. ...
7 years ago (2013-12-10 07:30:26 UTC) #2
Peter Kasting
Oh, I should note. I changed StyledLabel from a priority queue for ranges to a ...
7 years ago (2013-12-10 07:32:29 UTC) #3
sky
https://codereview.chromium.org/111023004/diff/40001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/111023004/diff/40001/ui/views/controls/label.cc#newcode205 ui/views/controls/label.cc:205: if (IsFocusable()) { Why do you want IsFocusable() here ...
7 years ago (2013-12-10 17:18:00 UTC) #4
Peter Kasting
OK, removed all the IsFocusable()-related changes, PTAL.
7 years ago (2013-12-10 18:59:31 UTC) #5
sky
LGTM
7 years ago (2013-12-10 21:07:09 UTC) #6
Peter Kasting
7 years ago (2013-12-10 22:18:44 UTC) #7
Message was sent while issue was closed.
Committed patchset #5 manually as r239864 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698