initWithWindowScene appears to create a window with no area if the
provided scene is null. As a fallback, creating a window without an
associated scene still returns usable bounds.
The old implementation had a few problems:
- For a target area near but not touching the bottom of the parent area,
and a long menu with an initially-visible item halfway through the
list, the initially-visible item would sometimes be obscured by the
scroller area. The new implementation adjusts the size of the menu to
ensure that there's enough additional room for the scroller areas.
- For a target area at the very top or very bottom of the target area,
the menu would be positioned inconsistently; sometimes it would
overlap with the target area, but other times it would be positioned
with a gap separating the menu and target area. In the new
implementation, if there's not enough room for scrollers to be
positioned above/below the target area, the menu will always be
positioned so that it touches but does not overlap the target area.
- The initially-selected item would normally be
positioned as close as possible to the target area, but this wasn't
always applied consistently for long menus, and the menu would
sometimes only be scrolled enough to make the item visible at the end
of the menu furthest from the target area. In the new implementation,
the initially-visible item will always be positioned on top of the
target area, or adjacent to it, depending on the available space.
This makes it a bit easier to see exactly which PopupMenu state is used
during the calculation, and enforces that no menu state is modified
during the call.
Prior to this fix calling setDirectory and then setSelectedFile from the
same call stack could cause setSelectedFile to have no effect. This was
because the directory change is asynchronously propagated from the
DirectoryContentsList. This was picked up by the FileListComponent as a
directory change after setSelectedFile, even though the directory change
happened before.
Before 2c5b1fbb6f, we only queried
currentlyFocusedPeer during runAsync(), instead of reading it
immediately. The behaviour after that commit prevented message boxes
from showing if showMessageBoxAsync() was called before any peer had
been created.
With the PopupMenu creating its own window the focus would return to the
ComboBox after activating a menu item. Prior to this commit however the
focus was seemingly lost after menu item activation. With this change
the focus returns to the ComboBox in both cases.
The issue became manifest in c51b331318.
In our implementation the toggle action takes precedence over the press
action, making the latter unreachable when the Item is in a checkable
state. Calling isTicked (true) turns the Item into a checkable object.
The onToggle implementation however didn't interact with the isTicked
state, and it didn't fire the press action either. This made the item
non-interactable with screen readers once it got into a ticked state.
This bug could be observed in the DemoRunner:
- Enable "button" navigation mode (as opposed to "gesture" mode) on the
Android device.
- Remove the line enabling kiosk mode, build and install the DemoRunner.
- Run the app and navigate to the Settings pane. Open a menu, or the
bluetooth MIDI dialog window, then close the popup window.
- Rotate the device.
Previously, the steps above could result in the system painting its own
backgrounds behind the system bars. With this patch in place, we reset
the requested system UI colours and transparency, which seems to
maintain the desired appearance.
A recent change made disabled components traversable by default when
using a screen reader. This change makes TalkBack report such components
as disabled.
With this change disabled components become discoverable by screen
readers, similarly to how OS native user interface components behave by
default.
The KeyboardFocusTraverser will still skip disabled components so this
does not affect keyboard navigation without screen readers.
handlePositionChanged() is called when the window changes z-order, which
may cause a new mouse event to be synthesised if the mouse is over the
window after the z-order is updated. In this situation, we may not have
received a mouse up/down/move event to update the current modifier
flags, so we need to update them ourselves.
This reimplements similar functionality to that removed in
d39789b021.
Unlike the previous implementation, this version will still wait for the
mouse to move over the menu before the countdown timer is allowed to
start. This should avoid the situation where menu items are accidentally
triggered on mouse-up, after a menu opens under the pointer in response
to a mouse-down.
ComponentPeer::setAppStyle() will now update the status and navigation
bar foreground colours, with some caveats:
- Status and nav bar backgrounds are now always completely transparent.
- The navigation bar foreground colour can only be changed on Android
API 26 or higher.
- For platforms using gesture controls instead of button controls, the
system automatically determines the colour of the gesture bar. On
those systems, setAppStyle() will only affect the status bar colour.
This is a different approach to the change introduced in
04f87320d5.
Instead of completely recreating the window, we now just update the
window's style flags. This should ensure that window and component focus
are preserved.