- 08 Aug, 2015 1 commit
-
-
Adam Barth authored
There were two problems: 1) When starting the mimic, we put up a bad frame because although we set the `begin` value of the animation, we were building using the current `value`, which hadn't been updated. 2) When stoping the mimic, we'd dirty a component during didUnmount, which wouldn't get cleaned until the next frame. Now we're sure to clean all the components before leaving flushBuild.
-
- 07 Aug, 2015 1 commit
-
-
Hans Muller authored
-
- 06 Aug, 2015 1 commit
-
-
Adam Barth authored
Wrap widgets you want to reparent in a Mimicable widget and assign the Mimicable widget a global key. Then, given the same global key to a Mimic widget to make it appear elsewhere in the view hierarchy.
-
- 05 Aug, 2015 1 commit
-
-
Adam Barth authored
We still need to tune the various parameters, but this patch is a start.
-
- 04 Aug, 2015 2 commits
-
-
Adam Barth authored
It was confusing to have both widget.dart and widgets.dart
-
James Robinson authored
This introduces the notion of event disposition and allows event targets (widgets and render objects) to consume events that should not be processed further. This is needed by the Switch component in the Drawer in the stocks example. The Switch is embedded in a DrawerItem. The Switch handles the gesture tap event to toggle its state and should handle pointer events to allow swiping and draw its own radial reaction. The DrawerItem also handles gesture taps to allow toggling the switch value when tapping anywhere on the drawer and to draw its own ink splash. When tapping on the switch, both the switch's render object and the DrawerItem's listener are in the event dispatch path. The Switch needs to signal in some fashion that it consumed the event so the DrawerItem does not also try to toggle the switch's state.
-
- 31 Jul, 2015 1 commit
-
-
Adam Barth authored
We were marking the parent *Widget's* render object as needing layout, but we actually need to walk up the component tree until we find the parent *RenderObjectWrapper* so we can mark actually mark the parent render object as needing layout. Fixes #408
-
- 28 Jul, 2015 3 commits
-
-
Adam Barth authored
Rather than using a microtask to schedule component build functions, instead use the scheduler. We now tread building just like layout and painting as a visual update.
-
Chinmay Garde authored
-
Chinmay Garde authored
-
- 25 Jul, 2015 2 commits
-
-
Hixie authored
Scoped focus, so you can have a dialog with input controls and not lose your focus in the background. This introduces a GlobalKey registry so that you can tell when a key has gone away (so you can unfocus dead dialogs). Also I added an assert that you're not calling setState() during a build. It turns out that doing so means you have a bug, because since you're dirty already (you're building), you won't get rebuilt. The focus code itself is gnarly. It uses a Component and an internal Inherited TagNode to manage the focus state, and does crazy things like updating its state during build to pretend retroactively that it was built with some other state, once someone asks for focus the first time (i.e. the first time it's examined, so you can't tell that it was in a different state before). It does this so that it can autofocus controls which otherwise wouldn't be focused. This moves all the focus management into Navigator and showDialog(), so the complexity is all buried deep and not visible to apps, hopefully. To do something like two tabs that each have an Input widget that needs to be focused when you switch panes, you'd need to have two Focus objects, one in each tab, and you need to set their autofocus to true (maybe that should be the default?).
-
Hixie authored
-
- 23 Jul, 2015 3 commits
-
-
Hixie authored
I've noticed an anti-pattern emerge where people call scheduleBuild() when they think they've changed enough state that they should rebuild, instead of just wrapping their changes in setState(). This leads to them missing state changes, having extraneous scheduleBuild() calls, and other similar bugs. By removing scheduleBuild(), the only way to actually schedule a build now is to call setState(), and hopefully that'll make it much clearer that you're only supposed to do this when you change state.
-
Hixie authored
Assert that there are no duplicates. Export GlobalKey from basic.dart, so that people don't have to import widgets.dart just for that. Fix the "initialFocus" feature which actually didn't work.
-
Eric Seidel authored
This patch provides a class to manage focus, Focus, and a class to manage ownership of the keyboard, KeyboardHandle. Inherited (in widgets.dart) is adjusted to support subclasses that need to copy state from instance to instance. A GlobalKey key type is introduced that is basically the same as UniqueKey. Component classes that need a globally-unique key can specify that their 'key' constructor argument is a GlobalKey. Focus ----- You can use `Focus.at(this)` to determine if you, a Component, are currently focused. You can use `Focus.moveTo(this)` to take the focus or give it to a particular component. For this to work, there has to be a Focus class in the widget hierarchy. Currently, there can only be one Focus class, because nested scopes aren't supported. We should add support for that in a future patch. See issue #229. KeyboardHandle -------------- Instead of directly interacting with the keyboard service, you now ask for a KeyboardHandle using `_keyboard.show(client)`. This returns a KeyboardHandle class. On that class, you can call `handle.release()` when you want to hide the keyboard. If `handle.attached` is still true, and you need to reshow the keyboard after the user hid it, then you can can `handle.showByRequest()`. The point of this is that the `keyboard.show()` method maintains the invariant that only one KeyboardHandle is live at a time. There are some issues with the keyboard service that I filed as a result of doing this patch: #226 #227
-
- 22 Jul, 2015 3 commits
-
-
Adam Barth authored
-
Hixie authored
This fixes some theoretical bugs whereby we were using hashCode to try to get unique keys for objects, but really we wanted object identity. It also lays the groundwork for a new GlobalKey concept. I tried to keep the impact on the code minimal, which is why the "Key" constructor is actually a factory that returns a StringKey. The code has this class hierarchy: ``` KeyBase | Key--------------+---------------+ | | | StringKey ObjectKey UniqueKey ``` ...where the constructors are Key and Key.stringify (StringKey), Key.fromObjectIdentity (ObjectKey), and Key.unique (UniqueKey). We could instead of factory methods use regular constructors with the following hierarchy: ``` KeyBase | LocalKey---------+---------------+ | | | Key ObjectIdentityKey UniqueKey ``` ...with constructors Key, Key.stringify, ObjectIdentityKey, and UniqueKey, but I felt that that was maybe a more confusing hierarchy. I don't have a strong opinion on this.
-
Adam Barth authored
We were declaring that the function passed to setState should return a Function. In reality, we want the function to return void (and everyone calls it with a function that returns void).
-
- 21 Jul, 2015 1 commit
-
-
Adam Barth authored
When we build widgets during layout we weren't notifying those widgets that they were mounted. Now we notify mount status changes when exiting build phases inside layout. Fixes #176
-
- 16 Jul, 2015 2 commits
-
-
Hixie authored
The primary goal of this change was to remove EventTarget from the sky_engine C++ code. Since EventTarget is so core to the entire event system that sky_engine was based on, this is a rather invasive change. As such, it had some knock-on effects. I deleted some of the files that were affected, and cauterised the remainder. In many cases, a file would depend on another file that it didn't include directly, but instead included indirectly via another file that I deleted. When this happened, if the features that this broke were obsolete, I sometimes just removed the features instead. Specifically: - removed EventTarget - removed EventQueue, since without a target, what's a queue going to do? - same with EventDispatch* - removed ExecutionContext, since it had an EventQueue and nothing else it did was relevant to Sky anymore - removed ActiveDOMObject, which was all about ExecutionContexts - removed ContextLifecycleNotifier since it dependend on ExecutionContext and ActiveDOMObject - removed the other Lifecycle classes for consistency, and replaced them with four booleans in the Document class - removed some of the attributes that are no longer relevant from IDLExtendedAttributes (ConstructorCallWith and CallWith=ExecutionContext) - removed the Document member on DOMDartState since we never set it to anything but null. - removed BuiltinSky::InstallWindow since it relied on the Document member of DOMDartState - removed EventHandler, EventListener, and mentions of those in various binding scripts - removed NewEventHandler, since we're not using that either - removed the following interfaces from the Sky Dart API: - EventTarget - EventListener (since without a target, there's no way to listen) - FocusEvent (since it's only member was an EventTarget) - HashChangeEvent (mostly by accident, but it's defunct anyway) - FontFace (it used ConstructorCallWith=ExecutionContext) - changed the following interfaces of the Sky DART API: - MediaQueryList is no longer an EventTarget - Node is no longer an EventTarget - Document no longer has defaultView (depended on DOMDartState's document) - DocumentFragment, Element, Range, and Text no longer have a constructor (they all depended on DOMDartState's document, which is now gone) - Event lost its EventTarget members and path. - Window lost its WindowTimers partial interface (it used EventTarget and ExecutionContext a lot) - removed numerous hacks in the bindings around features that are now gone, like addEventListener - removed a bunch of console logging code, since that relied on ExecutionContext - cauterised the wound in FontFace.cpp by removing constructors and methods that called now-removed features - same with MediaQuery and friends - same with some editor features and focus-related features - same with Document - removed DOMTimer classes since they use ExecutionContexts
-
Collin Jackson authored
-