2592 Commits

Author SHA1 Message Date
Adam Barth
193ed22b63 Merge pull request #1197 from abarth/rm_clamp
Remove clamp() in favour of double.clamp()
2016-01-13 11:01:41 -08:00
Adam Barth
d444ae7dc8 Update engine
Also, update callers of deprecated methods.
2016-01-12 12:24:07 -08:00
Hans Muller
cafea7f51f Floating Action Button transitions 2016-01-12 11:42:20 -08:00
Adam Barth
84957e5be8 Fix time picker
We were painting the contents of the RRect clip at the wrong offset. This patch
makes RRect match Rect and Path clips.

Fixes #1194
2016-01-12 10:07:09 -08:00
Adam Barth
8e5dd7a385 Remove clamp() in favour of double.clamp()
Fixes #961
2016-01-12 09:19:33 -08:00
Ian Hickson
867bbcc9bd Provide a safe time to update a WidgetToRenderBoxAdapter
If you change the RenderObject tree between frames, you'll assert if
you subsequently hit test. So e.g. if you get two button presses back
to back, and you mutate the tree synchronously in response to the
first one, the second will assert.

This adds an onBuild callback to WidgetToRenderBoxAdapter to make it
easier to do the updates at the right time, i.e., during widget build.
It'll be called whenever you rebuild the WidgetToRenderBoxAdapter
itself, so all you have to do to use it is call setState() on whoever
is building the WidgetToRenderBoxAdapter.
2016-01-11 23:14:37 -08:00
Adam Barth
f10f79f8fd Merge pull request #1196 from abarth/rm_layer_bounds
Stop passing bogus bounds to SceneBuilder
2016-01-11 22:29:09 -08:00
Ian Hickson
e20ec39b81 Merge pull request #1195 from Hixie/raised-button
Fixed the RaisedButton shadow issue
2016-01-11 22:23:23 -08:00
Adam Barth
d2c22a490d Stop passing bogus bounds to SceneBuilder
We no longer need to pass bounds to SceneBuilder. Instead, the
compositor computes these bounds itself from the RTrees in the
SkPictures.
2016-01-11 22:18:43 -08:00
Ian Hickson
ac616df0bd Fixed the RaisedButton shadow issue
The onHighlightChanged callback was being given "true" every time
instead of the actual value.
2016-01-11 22:06:29 -08:00
Adam Barth
82bb3bd40d ShaderMask needs to play nicely with compositing
This patch adds ShaderLayer and makes ShaderMask use it.

Fixes #1155
2016-01-11 21:57:54 -08:00
Ian Hickson
8f894f3757 Merge pull request #1140 from Hixie/concat
Transition callers from 'concat' to 'transform'
2016-01-11 20:05:07 -08:00
Adam Barth
00359a4f96 RenderPerformanceOverlay needs alwaysNeedsCompositing
The performance overlay is always drawn using the compositor. We should tell
the rest of the system that it's going to make a composited layer.

Fixes #1177
2016-01-11 14:23:49 -08:00
Adam Barth
056766414c Use a named argument for Widget children
Previously we used a positional argument for widgets that had multiple
children. Now we use a named argument that defaults to an empty list.

Fixes #241
2016-01-11 13:17:09 -08:00
Ian Hickson
d869c01035 Merge pull request #1181 from Hixie/stats-box-rename
Rename StatisticsOverlay to PerformanceOverlay.
2016-01-11 12:21:32 -08:00
Adam Barth
b2cef9f2b2 Rename ScrollDirection to Axis
We use the ScrollDirection for more than just scrolling.

Fixes #151
2016-01-11 11:28:42 -08:00
Adam Barth
635168d9f9 Always using OpacityLayer for blending
We don't know how to accuately compute paint bounds in the render tree.
Instead, we can rely on the compositor to compute the paint bounds for
us if we use OpacityLayer to do our opacity blends.

Fixes the shadow when closing the menu in the stocks app.
2016-01-11 00:18:26 -08:00
Adam Barth
0b7759841e Rename RenderObject.hasLayer to isRepaintBoundary
Also, introduce alwaysNeedsCompositing to force the "needs compositing"
bit to true without necessarily introducing a ContainerLayer into the
layer tree. A future patch will make use of alwaysNeedsCompositing to
optimize opacity layers.
2016-01-10 23:59:34 -08:00
Ian Hickson
88c43c3f4e Rename StatisticsOverlay to PerformanceOverlay. 2016-01-10 23:47:42 -08:00
Adam Barth
07a9cc758a DoubleTap gesture asserts when rejected
The pointer router was using an iteration pattern that always delivers
handleEvent calls even if you remove a route during the iteration.
That's awkward to program against and causes trouble for the double-tap
gesture.

This patch switches PointerRouter to using a re-entrant iteration
pattern that supports removing routes (but not adding routes) during the
iteration.
2016-01-10 23:12:37 -08:00
Ian Hickson
17ae19e8b2 Merge pull request #1166 from Hixie/stock-debugging
Add more debugging options to the stocks app.
2016-01-10 23:03:48 -08:00
Ian Hickson
48e1350e73 Add more debugging options to the stocks app.
- Add an option to enable debugPaintSizeEnabled.
- Add an option to enable the StatisticsOverlay.
- Add support for the StatisticsOverlay in MaterialApp.
- Change the layout behaviour of RenderStatisticsBox:
   - Give it a zero intrinsic width.
   - Give it an accurate intrinsic height that depends on the flags
     set. (Also, move the enum to the rendering/ layer from the
     widgets/ layer to enable this.)
   - Make the box automatically size itself full-width and the correct
     height, so that you can actually embed it (though most of the
     time you'd just put it in a Stack so this doesn't matter as
     much, really).
- Some style nit fixes in statistics_box.dart.
2016-01-10 22:42:16 -08:00
Adam Barth
432b179395 TabView fails to update tab contents
When the TabView widget's children change, we don't change the children
we give to the PageViewport because we fail to update _items. This patch
watches didChangeConfig and updates _items appropriately.

Fixes #1134
Fixes #1168
2016-01-10 22:18:56 -08:00
Adam Barth
dd08bf7973 Simplify TabView API
Instead of taking a builder and a generic type, we can just take a
List<Widget>.
2016-01-10 21:44:24 -08:00
Ian Hickson
0379744c92 Merge Container's width, height, and constraints
Without this, FlatButton ends up using two RenderConstrainedBoxes back
to back for no good reason.
2016-01-10 20:19:15 -08:00
Ian Hickson
c21b565f0b tightenWidth(), tightenHeight() => tighten(width:, height:)
This makes it more consistent with tightFor(), and also makes it
easier to tighten both directions at once when you're not sure you
will always do so (e.g. if you have a height and width that might be
null, and want to tighten whichever ones aren't null).
2016-01-10 19:49:07 -08:00
Ian Hickson
63c2ac9c4e AnimatedPositioned 2016-01-10 11:35:20 -08:00
Ian Hickson
f37c29dddd Move AnimatedContainer to a new file so AnimatedPositioned can live with it. 2016-01-10 11:14:54 -08:00
Ian Hickson
948f3db270 Refactor AnimatedContainer to be reusable.
This will allow AnimatedPositioned to reuse all the same logic.
2016-01-10 11:14:46 -08:00
Adam Barth
682243efef Merge pull request #1156 from abarth/edge_swipe
Drawer edge swipe convers entire screen
2016-01-10 10:50:11 -08:00
Ian Hickson
f07a0c9873 Fix crazy assertion.
Not sure what I was doing when I wrote this assertion, but I'm pretty
sure it's wrong. I'm guessing the change here is what I actually meant
to write.
2016-01-09 13:30:51 -08:00
Ian Hickson
20a01b425e Add more debugPaintSizeEnabled construction lines.
- padding is shown in blue with a darker blue around the child
- spacing (empty size boxes or padding) is shown in gray
- alignment from a RenderPositionedBox is shown with yellow arrows
2016-01-08 23:13:20 -08:00
Adam Barth
1ef3f82e0f Drawer edge swipe convers entire screen
When I tightened up the layout constraints for the Drawer in the
Scaffold, I ended up making the edge swipe detector cover the entire
screen.  This patch fixes that issue by putting the gesture detector for
the edge swipe just around the container with the proper width. We now
use a global key to maintain the state across hierarchy changes.
2016-01-08 19:40:04 -08:00
Ian Hickson
d9d3114d14 Material baseline grid
See https://www.google.com/design/spec/layout/metrics-keylines.html#
2016-01-08 11:18:15 -08:00
Ian Hickson
99112425e2 Merge pull request #1143 from Hixie/GridPaper
GridPaper updates
2016-01-08 11:03:23 -08:00
Hans Muller
d71afc3445 Fixed a typo 2016-01-08 10:29:10 -08:00
Ian Hickson
d502d2376c GridPaper updates
Change how GridPaper works so that it's easier to plug in anywhere.
It now takes a child that it will paint the grid over.
It defaults to semi-transparent grid-paper-blue.
The line spacing is also more configurable now.
2016-01-08 10:27:43 -08:00
Adam Barth
d8fd537ce3 Merge pull request #1136 from abarth/optimize_scaffold
Optimize repainting in Scaffold
2016-01-08 09:06:35 -08:00
Ian Hickson
17ef9488ff Transition callers from 'concat' to 'transform'
See: https://github.com/flutter/flutter/issues/1080
2016-01-08 08:58:31 -08:00
Hans Muller
606887a12c Merge pull request #1127 from HansMuller/fix_tabs
Fix tab fling scrolling when the last tab is selected
2016-01-08 07:58:48 -08:00
Adam Barth
ee88a685f8 Optimize repainting in Scaffold
Previously, we triggered a layout (and hence a repaint) when sliding the
draw because we gave the draw loose constraints. The drawer uses an
Align to move itself to the proper side of the screen, so it can have
tight constraints, which makes it a layout boundary.

Also, don't trigger a layout just because the Scaffold rebuilds. There
isn't any state in the scaffold custom layout, so it doesn't need to
repaint just because we created a new instance of the delegate.

Finally, add the debugging infrastructure I used to find these issues.
2016-01-08 01:57:30 -08:00
Ian Hickson
892cc272a6 Reimplement TabBarSelectionState.of() using new methods 2016-01-07 22:09:36 -08:00
Hans Muller
5966f67627 fix #1126 2016-01-07 16:31:30 -08:00
Adam Barth
51d066473f Merge pull request #1122 from abarth/fix_tabs
Tabs don't display items other than 0 and 1
2016-01-07 14:22:22 -08:00
Adam Barth
5e2badad40 Tabs don't display items other than 0 and 1
The TabBarView wants to remap page indices during tab transitions, which
I broke when I refactored TabBarView.

Fixes #1119
2016-01-07 13:04:31 -08:00
Adam Barth
52a7479dd1 Limit the size of the image cache
Fixed #1009
2016-01-07 12:07:17 -08:00
Adam Barth
dfcc0c71ba Merge pull request #1110 from abarth/widgets_back
Move default back behavior to FlutterWidgetBinding
2016-01-07 10:59:03 -08:00
Adam Barth
c44f0a57e8 Merge pull request #1114 from abarth/rm_block_direction
Remove BlockDirection in favor of ScrollDirection
2016-01-07 10:47:11 -08:00
Adam Barth
76dd6228b4 Remove BlockDirection in favor of ScrollDirection
We'll probably renaming ScrollDirection to Axis in a future patch.

Fixes #151
2016-01-07 10:11:39 -08:00
Adam Barth
e3d587ea52 Move default back behavior to FlutterWidgetBinding
Previously MaterialApp was responsible for ending the activity when the
back stack was empty. However, this behavior is more general than
material. This patch moves the behavior to FlutterWidgetBinding, which
has a global view of all the binding observers.

Fixes #1086
2016-01-07 09:24:51 -08:00