Chromium Code Reviews
DescriptionMake the menu items in the drawer change colour when tapped, per Material spec.
This is done by the following steps:
- Make Inherited classes notify their descendants when their state
changes.
- Make Components track which Inherited classes they looked at.
- Make Components handle being notified of state changes by rebuilding
if the changed ancestor is of a type we've looked at.
- Refactor setState() and scheduleBuild().
- Make the "buildDirtyComponents" phase support incrementally building
more components as each one finds it needs to update itself.
The way this works is that when the menu item updates its color, it
does so by changing a DefaultTextStyle (Inherited) node in its tree.
That node then notifies its ancestors, which include in particular the
Text component, which uses DefaultTextStyle. The notification is
received, and, even though we're already in the rebuild phase, the
Text queues itself up to be rebuilt as well. Since we now support
adding people to the rebuild phase while it's active, it gets rebuilt
as well, and all is well.
This CL depends on the fix in https://codereview.chromium.org/1218183009
R=abarth@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/8a1462dbfce551e5db01ab83377e5c3c28179cd0
Patch Set 1 #
Total comments: 2
Messages
Total messages: 3 (1 generated)
|
|||||||||||||||||||||||||||||||||||||