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

Issue 583843003: views::ImageButton: Added SetMinimumImageSize; removed SetPreferredSize. (Closed)

Created:
6 years, 3 months ago by Matt Giuca
Modified:
6 years, 3 months ago
Reviewers:
zturner, sky
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, kalyank, sadrul, ben+ash_chromium.org, tfarina, kcarattini, calamity
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

views::ImageButton: Added SetMinimumImageSize; removed SetPreferredSize. ImageButton::SetMinimumImageSize allows the client to explicitly set a size larger than the image contained within the button. The image will be aligned inside the button according to its alignment setting. ImageButton::SetPreferredSize had a misleading name (since in fact it only sets the size when there is no image) and is no longer needed. Its original usage (r50040) is now gone. It wasn't having any effect in either of its two remaining callers, since they always set an image immediately afterwards. Therefore, deleted this method and removed both calls to it. Note that we are keeping the default behaviour that an ImageButton with no image has a size of 16x14. I wanted to remove this, but the list of potential clients that could be relying on it is huge. BUG=415909 Committed: https://crrev.com/306b915c2ea97c618aa011aa6a3f39c5d5b0600b Cr-Commit-Position: refs/heads/master@{#295917}

Patch Set 1 #

Patch Set 2 : Added tests for border + minimum size. #

Patch Set 3 : Formatting. #

Patch Set 4 : Delete usage of SetPreferredSize entirely -- these had no effect. #

Total comments: 6

Patch Set 5 : Respond to sky's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -24 lines) Patch
M ash/system/audio/volume_view.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M ui/app_list/views/contents_switcher_view.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M ui/app_list/views/contents_switcher_view.cc View 1 2 3 2 chunks +3 lines, -7 lines 0 comments Download
M ui/views/controls/button/image_button.h View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M ui/views/controls/button/image_button.cc View 1 2 3 4 3 chunks +16 lines, -4 lines 0 comments Download
M ui/views/controls/button/image_button_unittest.cc View 1 3 chunks +20 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Matt Giuca
sky: Please review changes in views. Also OWNERS for views and ash. zturner: Please confirm ...
6 years, 3 months ago (2014-09-19 09:07:44 UTC) #2
Matt Giuca
FYI the reason I need SetMinimumImageSize is for the follow-up CL https://codereview.chromium.org/581923002/. (I tried doing ...
6 years, 3 months ago (2014-09-19 09:20:18 UTC) #3
sky
LGTM https://codereview.chromium.org/583843003/diff/60001/ui/views/controls/button/image_button.cc File ui/views/controls/button/image_button.cc (right): https://codereview.chromium.org/583843003/diff/60001/ui/views/controls/button/image_button.cc#newcode33 ui/views/controls/button/image_button.cc:33: minimum_image_size_(0, 0), nit: remove this as 0,0 is ...
6 years, 3 months ago (2014-09-19 15:31:06 UTC) #4
zturner
On 2014/09/19 09:07:44, Matt Giuca wrote: > sky: Please review changes in views. Also OWNERS ...
6 years, 3 months ago (2014-09-19 16:16:51 UTC) #5
Matt Giuca
https://codereview.chromium.org/583843003/diff/60001/ui/views/controls/button/image_button.cc File ui/views/controls/button/image_button.cc (right): https://codereview.chromium.org/583843003/diff/60001/ui/views/controls/button/image_button.cc#newcode33 ui/views/controls/button/image_button.cc:33: minimum_image_size_(0, 0), On 2014/09/19 15:31:06, sky wrote: > nit: ...
6 years, 3 months ago (2014-09-22 00:41:06 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/583843003/80001
6 years, 3 months ago (2014-09-22 00:41:57 UTC) #8
commit-bot: I haz the power
Committed patchset #5 (id:80001) as 232dfea248864ddfa183136dae0799327bccf113
6 years, 3 months ago (2014-09-22 03:48:59 UTC) #9
commit-bot: I haz the power
6 years, 3 months ago (2014-09-22 03:50:00 UTC) #10
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/306b915c2ea97c618aa011aa6a3f39c5d5b0600b
Cr-Commit-Position: refs/heads/master@{#295917}

Powered by Google App Engine
This is Rietveld 408576698