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

Unified Diff: sky/sdk/lib/widgets/widget.dart

Issue 1215023002: Fix theme changing: turns out we were not reparenting stateful surviving nodes when their parents c… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/painting/box_painter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/widget.dart
diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart
index d8b575a30ba3bb23cb7ab7c577719a62d3ca81ad..2d48825eed853e2942464f5a5bba9ba9e0eb7288 100644
--- a/sky/sdk/lib/widgets/widget.dart
+++ b/sky/sdk/lib/widgets/widget.dart
@@ -50,6 +50,8 @@ abstract class Widget {
void setParent(Widget newParent) {
assert(!_notifyingMountStatus);
+ if (_parent == newParent)
+ return;
_parent = newParent;
if (newParent == null) {
if (_mounted) {
@@ -146,6 +148,7 @@ abstract class Widget {
if (node._retainStatefulNodeIfPossible(oldNode)) {
assert(oldNode.mounted);
assert(!node.mounted);
+ oldNode.setParent(this);
oldNode._sync(node, slot);
assert(oldNode.root is RenderObject);
return oldNode;
@@ -957,9 +960,14 @@ class AppContainer extends AbstractWidgetRoot {
Widget build() => new RenderViewWrapper(child: app);
}
-void runApp(App app, { RenderView renderViewOverride }) {
+void runApp(App app, { RenderView renderViewOverride, bool enableProfilingLoop: false }) {
WidgetSkyBinding.initWidgetSkyBinding(renderViewOverride: renderViewOverride);
new AppContainer(app);
+ if (enableProfilingLoop) {
+ new Timer.periodic(const Duration(milliseconds: 20), (_) {
+ app.scheduleBuild();
+ });
+ }
}
typedef Widget Builder();
« no previous file with comments | « sky/sdk/lib/painting/box_painter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698