357 Commits

Author SHA1 Message Date
Adam Barth
865e3cc0ce Update engine
This change brings in a new version of Mojo, which has improved Mozart
interfaces.
2016-03-02 18:32:49 -08:00
Hixie
438f209088 SizeObserver crusade: ScrollableMixedWidgetListState 2016-02-26 18:40:05 -08:00
Hixie
be865e1e1a SizeObserver crusade: RawInputLine 2016-02-26 10:17:47 -08:00
Hixie
f808055756 Remove size observers from scrollables.
Also:
 - add operator==/hashCode/toString to ViewportDimensions
 - add toString to BindingBase
 - add toString and debugFillDescription to ScrollBehavior
 - fix a bug in the RawGestureDetectorState's replaceGestureRecognizers
 - rename MixedViewport's onExtentsUpdate to onExtentChanged
 - replace ExtentsUpdateCallback with ValueChanged<double>
 - remove a microtask for dispatching scroll start, since it
   did not appear to have any purpose
 - added dartdocs to Instrumentation until I understood it
 - made all event dispatch in Instrumentation drain microtasks
2016-02-25 10:55:12 -08:00
Adam Barth
4b1a9ff14c Remove PointerRouter and GestureArena arguments
There's no reason to make clients supply a PointerRounter and a
GestureArena when constructing gesture recognizers. These objects are
statics and the gesture recognizers can just grab them directly.

Also, remove the callback constructor arguments. Almost no code used
them. Instead, people seem to prefer using the `..` operator to set
callbacks on the recognizers. Removing the arguments removes a bunch of
boilerplate.
2016-02-24 22:23:00 -08:00
Adam Barth
9d4e0e8551 Merge pull request #2142 from abarth/interactive_text
Add the ability to recognize gestures on text spans
2016-02-24 17:32:30 -08:00
Hixie
512b2e1972 Fix move() to call markNeedsLayout().
Otherwise, changing the order of your children (e.g. shuffling a list of
children) will have no visible effect.
2016-02-24 17:10:59 -08:00
Adam Barth
8e326d724a Add the ability to recognize gestures on text spans
Currently the interface for recognizing gestures on text spans is pretty ugly,
but hopefully we can improve it with time.

Fixes #156
2016-02-24 17:07:35 -08:00
Eric Seidel
fbe4cdf5c6 Merge pull request #2129 from eseidelGoogle/space_per_flex
Don't give children negative sizes when overconstrained
2016-02-24 15:30:16 -08:00
Eric Seidel
4e7a9de578 Fix two bugs in Flex exposed by the Game in landscape mode
One bug was masking the other, hence they both needed to be fixed
and tested separately.

@Hixie
2016-02-24 15:30:05 -08:00
Adam Barth
fb4dbf4584 Improve TextSpan
Now we just have one TextSpan class that handles both simple strings, trees of
children, and styling both. This approach simplifies the interface for most
clients.

This patch also removes StyledText, which was weakly typed and tricky to use
correctly. The replacement is RichText, which is strongly typed and uses
TextSpan.
2016-02-24 14:07:10 -08:00
Hixie
16e7c3a61c Trivial cleanup of getDistanceToBaseline
Turns out we don't need 'parent' outside the assert at all.
2016-02-23 12:56:07 -08:00
Hans Muller
ec6ed72e6a updated per review feedback 2016-02-17 08:38:40 -08:00
Hans Muller
ba3930cc88 Changed grid layout padding and inter row/column spacing 2016-02-16 16:51:27 -08:00
Adam Barth
6a9de1d735 Add docs for RepaintBoundary 2016-02-16 13:41:44 -08:00
Adam Barth
4408c820e1 Rename AutoLayoutParams to AutoLayoutRect
This object represents a rect the auto-layout system.
2016-02-15 16:29:27 -08:00
Adam Barth
c7d71d8ab1 Simplify the AutoLayout API
This patch makes it easier to use the auto layout API:

* We no longer use operator== because that requires an ugly cast by the
  API user.
* Also, "leftEdge" is now just "left" for less verbosity.
* AutoLayoutChild not implies its key from the AutoLayoutParam object.
* We now correctly layout every child of a RenderAutoLayout object even
  if the solver doesn't flush any updates to that child.
2016-02-15 15:25:21 -08:00
Adam Barth
262dd7a63b Add support for autolayout to widgets
This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.
2016-02-15 03:01:40 -08:00
Ian Hickson
0334a833ef Rename debugDescribeSettings to debugFillDescription.
...so that it's easier to copy/paste between the rendering and settings layers.
2016-02-13 23:23:45 -08:00
Ian Hickson
f54b8ad510 Use Image.toString instead of rolling our own each time
I meant to check this in as part of https://github.com/flutter/flutter/pull/1852
but forgot to commit the local change, d'oh.
2016-02-13 17:54:10 -08:00
Ian Hickson
3eb1b412e0 Fix color of icons in drawers in dark theme.
This makes it match the material spec more.
https://www.google.com/design/spec/style/icons.html

Fixes https://github.com/flutter/flutter/issues/1357
2016-02-13 17:10:10 -08:00
Adam Barth
deb9d0b3a0 Remove references to dart:ui_internals
This library is being folded into dart:ui.

Fixes #83
2016-02-13 13:12:30 -08:00
Ian Hickson
ca4d10d33a Merge pull request #1820 from Hixie/rainbox
Expose more debugging tools in Stocks
2016-02-12 17:21:16 -08:00
Adam Barth
ad2fa5a6e7 Fix padding for ScrollableList
Previously we had totally wrong behavior. Now we have more correct behavior and
testing.

Fixes #1808
2016-02-12 13:39:05 -08:00
Hixie
a95c866bf3 Expose more debugging tools in Stocks 2016-02-12 11:41:17 -08:00
Hixie
0d1a3cfcff Assert that custom painters balance save/restores. 2016-02-12 08:35:45 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.

- In painting.dart, export from dart:ui all the Canvas-related APIs
  that make sense to be used at higher levels, e.g. PaintingStyle.

- Delete painting/shadows.dart. It was dead code.

- In rendering/object.dart, export all of painting.dart.

- In widgets/basic.dart, export all of painting.dart and
  animation.dart. Some classes in animation/ are renamed to make this
  less disruptive and confusing to the namespace.

- Split out Stocks back into an import model rather than a part model,
  so that it's easier to manage its dependencies on a per-file basis.

- Move Ticker to scheduler library.

- Remove as many redundant imports as possible now.

- Some minor nit picking cleanup in various files.
2016-02-11 00:06:23 -08:00
Hixie
296540168a More BoxConstraints asserts
The asserting will continue until morale improves!

* Convert all assert(*.isNormalized) checks to use the new
  debugAssertIsNormalized technology.
* Convert CustomMultiChildLayout to use the new RenderingError
  technology to greatly improve the detail in errors you get when
  writing CustomMultiChildLayout delegates.
* Add BoxConstraints.copyWith().
* Indent the descendants in the rendering exception data dump so that
  when you have multiple children it's clearer what's going on.
2016-02-10 13:32:04 -08:00
Hixie
3bd8bc3362 Improve asserts around BoxConstraints
Negative constraints never make sense, so catch those too.

Make RenderObject.layout's isNormalized assert use the newer more fancy
debug version of isNormalized.
2016-02-10 11:12:13 -08:00
Adam Barth
b07203a887 Merge pull request #1749 from abarth/viewport_scroll_anchor
Teach ScrollableList about scroll anchors
2016-02-10 09:47:41 -08:00
Adam Barth
d6ae53fec4 Teach ScrollableList about scroll anchors 2016-02-10 09:25:49 -08:00
Hixie
4d5e40675b Tapping through drag targets.
Factor out the HitTestBehavior logic so that RenderMetaData can use it.

Use that in DragTarget.
2016-02-09 17:03:46 -08:00
Adam Barth
efd5aea004 Merge pull request #1736 from abarth/scroll_anchor3
Add scroll anchor for Block
2016-02-09 15:23:37 -08:00
Adam Barth
f0276d09e4 Add scroll anchor for Block
This patch teaches block how to anchor its scrolling to the end rather than the
start.

Fixes #136
2016-02-09 15:17:39 -08:00
Devon Carew
284db8cc76 rename the service protocol extensions 2016-02-09 11:53:52 -08:00
Adam Barth
7458ed226a Merge pull request #1710 from abarth/scroll_anchor
Preliminaries for scroll anchoring
2016-02-09 10:37:43 -08:00
Adam Barth
3c8cbef973 Rationalize RenderViewport and RenderVirtualViewport
These classes now share more code and have feature parity.
2016-02-09 10:30:52 -08:00
Hixie
9cea6c50f5 Fix drawer in accessibility mode
The "leaf merge" feature was getting confused when we reset the
SemanticsNode. We now separately track whether the node itself is marked
as being merged vs whether we inherited that state, and we don't reset
the inherited state until you're reattached or reserialised. In the
latter case, we do a "just in time" clearing of the flag just like we
previously did a "just in time" setting of the flag, except now the flag
we're setting or clearing is the inherited flag not the actual flag.
2016-02-09 10:05:16 -08:00
Adam Barth
70d96ecb0b Improve unit conversions in Scrollable 2016-02-09 09:50:35 -08:00
Adam Barth
2cb534dc11 Merge pull request #1584 from abarth/populate_view_host
Actually populate the view host proxy
2016-02-08 18:15:44 -08:00
Adam Barth
d0240c4eae Remove ParentData#merge
There aren't any clients anymore.

Fixes #1684
2016-02-08 16:58:39 -08:00
Adam Barth
256af1433c Actually populate the view host proxy
Now that the engine lets us take the view host handle, we can actually
access the view host from Dart.
2016-02-08 15:14:09 -08:00
Adam Barth
68f33d3012 Merge pull request #1642 from abarth/rm_viewport
Remove HomogeneousViewport
2016-02-05 20:30:46 -08:00
Adam Barth
9251504a57 Add more dartdoc to widgets.dart
This patch includes documentation for transitions.dart and for
scrollable.dart.
2016-02-05 20:21:42 -08:00
Adam Barth
5b89669424 Remove HomogeneousViewport
The virtual viewport machinery now handles all of these use cases.
Previous clients of ScrollableWidgetList can use ScrollableLazyList
instead.
2016-02-05 20:12:18 -08:00
Hixie
1a0484cc7e Improve exceptions and asserts for rendering lib.
* Use actual exceptions rather than assertions containing code
  containing strings when trying to give messages to authors.
* Introduce RenderingError which is an AssertionError that takes a
  string argument, to support the above.
* Provide a BoxDimensions.hasBoundedWidth/hasBoundedHeight API.
* Document BoxDimensions.isNormalized.
* Provide more useful information when we assert isNormalized and find
  that it is false.
* When finding the size is infinite, crawl the tree to figure out which
  render box is likely responsible for the infinite constraints.
* Provide more information when size doesn't match the constraints.
* Provide more information when intrinsic dimension methods violate the
  constraints.
* Only spam a huge amount of information for the first exception from
  the rendering library. I've noticed a lot of people looking at the
  last exception printed rather than the first and that's very
  misleading -- after the rendering library hits an exception, all bets
  are off regarding what'll happen in the future. All kinds of asserts
  might fire.
* Improve docs around the debug methods and flags for the above.
* Make Block default to have no children. Previously, giving no children
  crashed with a confusing message about a null deref in an assert.
2016-02-05 13:55:40 -08:00
Devon Carew
68fa1a636d remove no longer needed code from the service protocol extensions 2016-02-04 14:56:49 -08:00
Adam Barth
488285f112 Merge pull request #1553 from abarth/child_view
Initial work to add Mozart child views
2016-02-03 14:21:40 -08:00
Ian Hickson
517288c2dd Merge pull request #1532 from Hixie/semantics-2
Actually return a SemanticsServer service.
2016-02-03 09:50:06 -08:00
Adam Barth
f30398a4c4 Initial work to add Mozart child views
This patch sketches out the basic widgets for creating Mozart child
views. We're still missing some of the machinery, so we can't quite
create child views yet, but once we supply the ViewHost and teach the
compositor how to actually display the child scenes, we'll have
something that works.
2016-02-03 09:07:11 -08:00