Now that's the kind of change that I'm talking about :) Great start! https://codereview.chromium.org/15061006/diff/10002/ui/views/controls/button/button.h File ...
7 years, 7 months ago
(2013-05-13 01:37:22 UTC)
#1
https://codereview.chromium.org/15061006/diff/10002/ui/views/controls/button/checkbox.h File ui/views/controls/button/checkbox.h (right): https://codereview.chromium.org/15061006/diff/10002/ui/views/controls/button/checkbox.h#newcode61 ui/views/controls/button/checkbox.h:61: // Sets/Gets whether or not the checkbox is checked. ...
7 years, 7 months ago
(2013-05-13 02:28:31 UTC)
#3
How's this looking? Can you post before/after pics? https://codereview.chromium.org/15061006/diff/30001/ui/views/controls/button/button.h File ui/views/controls/button/button.h (right): https://codereview.chromium.org/15061006/diff/30001/ui/views/controls/button/button.h#newcode38 ui/views/controls/button/button.h:38: STATE_TOGGLED, ...
7 years, 7 months ago
(2013-05-16 22:40:05 UTC)
#4
More comments, but relax this weekend, enjoy family time! https://codereview.chromium.org/15061006/diff/69005/ui/views/controls/button/checkbox.h File ui/views/controls/button/checkbox.h (right): https://codereview.chromium.org/15061006/diff/69005/ui/views/controls/button/checkbox.h#newcode38 ui/views/controls/button/checkbox.h:38: ...
7 years, 7 months ago
(2013-05-18 03:46:30 UTC)
#8
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/checkbox.cc File ui/views/controls/button/checkbox.cc (right): https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/checkbox.cc#newcode35 ui/views/controls/button/checkbox.cc:35: *rb.GetImageSkiaNamed(IDR_CHECKBOX_CHECKED_PRESSED)); We still need IDR_CHECKBOX_FOCUSED_CHECKED, IDR_CHECKBOX_FOCUSED_CHECKED_HOVER, IDR_CHECKBOX_FOCUSED_CHECKED_PRESSED. Where that ...
7 years, 7 months ago
(2013-05-18 18:44:49 UTC)
#10
Please tell me there are no more button images we can't handle after this. https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/checkbox.h ...
7 years, 7 months ago
(2013-05-18 19:42:09 UTC)
#11
Please tell me there are no more button images we can't handle after this.
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
File ui/views/controls/button/checkbox.h (right):
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
ui/views/controls/button/checkbox.h:54: gfx::ImageSkia
checked_state_images_[STATE_COUNT];
Sigh, I guess rather than complicating LabelButton more, this should become:
gfx::ImageSkia images_[2][2][STATE_COUNT];
Then change SetCheckedImage to:
SetCustomImage(bool checked, bool focused, ButtonState for_state, const
gfx::ImageSkia& image) {
const size_t checked_index = checked ? 1 : 0;
const size_t focused_index = focused ? 1 : 0;
images[checked_index][focused_index][for_state] = image;
...
}
And change the overridden GetImage to do the same with:
const size_t checked_index = checked() ? 1 : 0;
const size_t focused_index = HasFocus() ? 1 : 0;
Then undo the SetFocusedImage changes to LabelButton.
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
File ui/views/controls/button/label_button.h (right):
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
ui/views/controls/button/label_button.h:31: const gfx::ImageSkia&
GetFocusedImage(ButtonState for_state);
remove
tfarina
The behavior of those buttons are still broken. Looks dumb :( https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/checkbox.h File ui/views/controls/button/checkbox.h (right): ...
7 years, 7 months ago
(2013-05-18 21:10:33 UTC)
#12
The behavior of those buttons are still broken. Looks dumb :(
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
File ui/views/controls/button/checkbox.h (right):
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
ui/views/controls/button/checkbox.h:54: gfx::ImageSkia
checked_state_images_[STATE_COUNT];
On 2013/05/18 19:42:09, msw wrote:
> Sigh, I guess rather than complicating LabelButton more, this should become:
> gfx::ImageSkia images_[2][2][STATE_COUNT];
>
> Then change SetCheckedImage to:
> SetCustomImage(bool checked, bool focused, ButtonState for_state, const
> gfx::ImageSkia& image) {
> const size_t checked_index = checked ? 1 : 0;
> const size_t focused_index = focused ? 1 : 0;
> images[checked_index][focused_index][for_state] = image;
> ...
> }
>
> And change the overridden GetImage to do the same with:
> const size_t checked_index = checked() ? 1 : 0;
> const size_t focused_index = HasFocus() ? 1 : 0;
>
> Then undo the SetFocusedImage changes to LabelButton.
Done.
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
File ui/views/controls/button/label_button.h (right):
https://codereview.chromium.org/15061006/diff/82001/ui/views/controls/button/...
ui/views/controls/button/label_button.h:31: const gfx::ImageSkia&
GetFocusedImage(ButtonState for_state);
On 2013/05/18 19:42:09, msw wrote:
> remove
Done.
msw
If you follow my suggestions, it should work as expected. If anything, you *might* also ...
7 years, 7 months ago
(2013-05-21 00:35:17 UTC)
#13
http://imgur.com/2DYw7wq Looks a bit better, but the transition of the states are pretty broken. You ...
7 years, 7 months ago
(2013-05-21 02:50:53 UTC)
#16
http://imgur.com/2DYw7wq
Looks a bit better, but the transition of the states are pretty broken. You will
see what I mean when you patch this in.
https://codereview.chromium.org/15061006/diff/103001/ui/views/controls/button...
File ui/views/controls/button/button.h (right):
https://codereview.chromium.org/15061006/diff/103001/ui/views/controls/button...
ui/views/controls/button/button.h:46: STYLE_CHECKBOX,
On 2013/05/21 02:24:11, msw wrote:
> Sorry for the reversal here, but remove these styles and their use from
> LabelButtonBorder::GetInsets(), instead add a LabelButtonBorder::insets_ and
> SetInsets(), and make LabelButtonBorder::GetInsets() return |insets_| before
the
> switch if they're not empty().
>
> Then make Checkbox cast border() to a LabelButtonBorder and call SetInsets()
> with the proper values. RadioButton will just inherit the correct insets from
> Checkbox.
Done.
msw
https://codereview.chromium.org/15061006/diff/108004/ui/views/controls/button/checkbox.cc File ui/views/controls/button/checkbox.cc (right): https://codereview.chromium.org/15061006/diff/108004/ui/views/controls/button/checkbox.cc#newcode30 ui/views/controls/button/checkbox.cc:30: SetCustomImage(false, false, STATE_DISABLED, nit: remove the disabled comment and ...
7 years, 7 months ago
(2013-05-22 00:36:10 UTC)
#17
Issue 15061006: views: Switch Checkbox over to LabelButton.
(Closed)
Created 7 years, 7 months ago by tfarina
Modified 7 years, 7 months ago
Reviewers: msw, Dan Beam, sky
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 78