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

Issue 11068012: Add new views::LabelButton and LabelButtonBorder. (Closed)

Created:
8 years, 2 months ago by msw
Modified:
8 years, 2 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, Ben Goodger (Google), Peter Kasting
Visibility:
Public.

Description

Add new views::LabelButton and LabelButtonBorder. (a simplified replacement for TextButton[Base], etc.) Add the LabelButton class, based on TextButton. (simplify, cleanup, re-use views controls, etc.) Add a supporting LabelButtonBorder class. Add unit tests and a views example in ButtonExample. Add ImageView interactive flag for hit-testing. Make Label::text() return a const string16 ref. TODO(followup): Replace TextButton[Base] use, etc. TODO(followup): Fix CanvasSkia multi-line label painting. BUG=155363 TEST=views examples use of the new LabelButton, etc. R=sky@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162245

Patch Set 1 #

Patch Set 2 : Add WIP LabelButton and example; etc. #

Patch Set 3 : Have LabelButton own its views; cleanup; support themes and colors. #

Patch Set 4 : Cleanup, refine layout and sizing, add unit tests; etc. #

Patch Set 5 : Sync and merge; fix build issues. #

Patch Set 6 : Fix unit test build error; remove stray line. #

Total comments: 4

Patch Set 7 : Rename LabelButtonBorder, remove GetLabel, etc. #

Total comments: 10

Patch Set 8 : Address comments; use custom Layout/GetPreferredSize; fix linux focus border; add test; etc. #

Patch Set 9 : Rebase and cleanup changes. #

Patch Set 10 : Remove stray semicolon. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+891 lines, -29 lines) Patch
M ui/app_list/app_list_item_view.cc View 1 2 3 4 2 chunks +3 lines, -16 lines 0 comments Download
M ui/views/bubble/bubble_border.h View 1 1 chunk +1 line, -2 lines 0 comments Download
A ui/views/controls/button/label_button.h View 1 2 3 4 5 6 7 8 1 chunk +110 lines, -0 lines 0 comments Download
A ui/views/controls/button/label_button.cc View 1 2 3 4 5 6 7 8 9 1 chunk +267 lines, -0 lines 0 comments Download
A ui/views/controls/button/label_button_border.h View 1 2 3 4 5 6 7 8 1 chunk +70 lines, -0 lines 0 comments Download
A ui/views/controls/button/label_button_border.cc View 1 2 3 4 5 6 7 8 1 chunk +185 lines, -0 lines 0 comments Download
A ui/views/controls/button/label_button_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +165 lines, -0 lines 0 comments Download
M ui/views/controls/image_view.h View 1 2 chunks +7 lines, -1 line 0 comments Download
M ui/views/controls/image_view.cc View 1 2 chunks +6 lines, -1 line 0 comments Download
M ui/views/controls/label.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M ui/views/examples/button_example.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M ui/views/examples/button_example.cc View 1 2 3 4 5 6 6 chunks +66 lines, -8 lines 0 comments Download
M ui/views/views.gyp View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
msw
Hey Scott, this is low-pri, but please take a look; thanks!
8 years, 2 months ago (2012-10-10 22:43:37 UTC) #1
sky
Peter was expressing his unhappiness with the current set of button classes recently. Ben and ...
8 years, 2 months ago (2012-10-11 00:39:43 UTC) #2
msw
On 2012/10/11 00:39:43, sky wrote: > Peter was expressing his unhappiness with the current set ...
8 years, 2 months ago (2012-10-11 00:54:26 UTC) #3
sky
What about MenuButton and ImageButton? Would they be folded in too? -Scott On Wed, Oct ...
8 years, 2 months ago (2012-10-11 16:39:06 UTC) #4
msw
> What about MenuButton and ImageButton? Would they be folded in too? Probably; each adds ...
8 years, 2 months ago (2012-10-11 19:18:21 UTC) #5
sky
I like this approach. Longer term can we fold Button and CustomButton into this and ...
8 years, 2 months ago (2012-10-11 19:32:01 UTC) #6
msw
Done; please take another look. Yeah, I'd start by merging Button and CustomButton, then consider ...
8 years, 2 months ago (2012-10-11 20:27:01 UTC) #7
sky
https://codereview.chromium.org/11068012/diff/10027/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/11068012/diff/10027/ui/views/controls/button/label_button.cc#newcode152 ui/views/controls/button/label_button.cc:152: gfx::Size size = label_->GetPreferredSize(); Can't you call to the ...
8 years, 2 months ago (2012-10-11 23:01:56 UTC) #8
msw
Changed to a custom Layout/GetPreferredSize; etc. Please take another look. https://codereview.chromium.org/11068012/diff/10027/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/11068012/diff/10027/ui/views/controls/button/label_button.cc#newcode152 ...
8 years, 2 months ago (2012-10-15 16:48:33 UTC) #9
sky
LGTM
8 years, 2 months ago (2012-10-16 15:30:10 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/11068012/20016
8 years, 2 months ago (2012-10-16 18:36:28 UTC) #11
commit-bot: I haz the power
8 years, 2 months ago (2012-10-16 21:08:24 UTC) #12
Change committed as 162245

Powered by Google App Engine
This is Rietveld 408576698