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

Issue 14230018: Handle dialog acclerators explicitly; nix default button switching. (Closed)

Created:
7 years, 8 months ago by msw
Modified:
7 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Handle dialog acclerators explicitly; nix default button switching. Stop switching default dialog buttons on focus changes. Remove default button and focus tracking, and button accelerators. ( this is undesirable complexity and looks odd ) Add and handle DialogClientView return and escape accelerators. ( for escape: invoke the cancel button or CancelWindow ) ( for return: invoke the focused view, ok button, or AcceptWindow ) Still call SetIsDefault to keep the ok/cancel default button appearance. Remove the redundant set_focusable call, the button style is focusable. Only return true from TreeView::AcceleratorPressed if it's handled. BUG=166075 TEST=[Return] and [Escape] work on dialogs as expected regardless of the focused view in the dialog. R=sky@chromium.org

Patch Set 1 #

Patch Set 2 : Simplify default button selection. #

Patch Set 3 : Limit the focused view handling to LabelButton; update tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -104 lines) Patch
M ui/views/controls/tree/tree_view.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 2 chunks +26 lines, -26 lines 0 comments Download
M ui/views/window/dialog_client_view.h View 4 chunks +1 line, -16 lines 0 comments Download
M ui/views/window/dialog_client_view.cc View 1 2 10 chunks +28 lines, -58 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
msw
Hey Scott, please take a look; thanks!
7 years, 8 months ago (2013-04-16 23:12:10 UTC) #1
sky
I agree switching the default button based on focus is weird, but it's standard windows ...
7 years, 8 months ago (2013-04-16 23:41:54 UTC) #2
msw
On 2013/04/16 23:41:54, sky wrote: > I agree switching the default button based on focus ...
7 years, 8 months ago (2013-04-16 23:49:31 UTC) #3
msw
On 2013/04/16 23:49:31, msw wrote: > I could instead enlarge all/dialog buttons to accommodate their ...
7 years, 8 months ago (2013-04-17 21:16:08 UTC) #4
sky
Does bold only effect the width and not the height? On Tue, Apr 16, 2013 ...
7 years, 8 months ago (2013-04-22 14:24:09 UTC) #5
msw
On 2013/04/22 14:24:09, sky wrote: > Does bold only effect the width and not the ...
7 years, 8 months ago (2013-04-22 18:04:11 UTC) #6
sky
We don't want buttons (or any other static type view) to change in size. It ...
7 years, 8 months ago (2013-04-22 22:30:17 UTC) #7
msw
On 2013/04/22 22:30:17, sky wrote: > We don't want buttons (or any other static type ...
7 years, 8 months ago (2013-04-22 22:40:41 UTC) #8
sky
How does it look for a font where the bold size is a different height? ...
7 years, 8 months ago (2013-04-22 23:23:14 UTC) #9
msw
7 years, 8 months ago (2013-04-23 00:35:24 UTC) #10
Message was sent while issue was closed.
On 2013/04/22 23:23:14, sky wrote:
> How does it look for a font where the bold size is a different height?

The default Win and CrOS fonts do not change height when made bold, but by
forcing the buttons to have gfx::Font("Arial", 16); the bold styled text is one
pixel taller than it's non-bold counterpart. The button layout code gives all
available height to its Label, so Label's  vertical centering takes over and
keeps the text vertically centered. It doesn't look bad, even when you change
the default dynamically with focus. I'll send you an image via e-mail; let me
know if you have specific concerns; perhaps file an issue rather than discussing
it here?

Powered by Google App Engine
This is Rietveld 408576698