DescriptionDevTools: rework focus logic
Summary of changes:
- We actually have 3 places where GlassPanes are instantiated [Dialogs, Options
in Toolbar, DraggingElements (e.g. Colorpicker)]
- DefaultFocusedViewStack is not necessary and is removed. Previously, it was
only used by Dialogs anyways. Dialogs are the only GlassPanes that will save
the previously focused element and call .focus() when the dialog closes
- Showing a different tab (switching to a drawer panel) will now focus on the
new tab, if no previous focus was set
- DeviceMode's toolbar previously depended on .setSelectionRange() to keep focus
in its size input field while resizing. Now, dragging the splitter won't steal
focus at all, so DeviceMode doesn't need to force focus on itself
- When using the Command Menu to open a panel/file, it will close the GlassPane
first (which may call .focus() on the previous element) before calling .show()
on the new panel/file, so that the new panel/file gets the final focus
BUG=604427, 609013, 612397
Committed: https://crrev.com/d436b82c55a2d1d5ad217b59afd2744e1aa6fa77
Cr-Commit-Position: refs/heads/master@{#396955}
Patch Set 1 #Patch Set 2 : Move Dialog logic into Dialog; opening tabs will focus if no focus was set #
Total comments: 8
Patch Set 3 : Address patch 1 comments #Patch Set 4 : Removed unnecessary focus call #Patch Set 5 : Remove stray newline #
Total comments: 2
Messages
Total messages: 20 (8 generated)
|