59 Commits

Author SHA1 Message Date
Collin Jackson
56d1aa0b94 Fix cross size of flex items in stocks app (more tests incoming)
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1176053002
2015-06-10 12:54:26 -07:00
Collin Jackson
950b3d40c5 Extend Sky's RenderFlex with intrinsic sizes and compute cross-size height
Renders interactive_flex and stocks demos fine. Could use more testing,
so I'm going to work on that after I land this.

R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1173493003
2015-06-10 10:11:58 -07:00
Matt Perry
42892c733b Add LinearBoxGradient and RadialBoxGradient decorations for RenderDecoratedBox.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175763002.
2015-06-10 12:23:57 -04:00
Hixie
d54c213b24 Clean up a bunch of our Dart code.
- constructors first
 - have either a blank line at the top and bottom of each class, or no blank line in either place (it's still inconsistent about which we should do)
 - hide clamp()

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1172173002
2015-06-09 15:27:58 -07:00
Hixie
8198a29b67 Remove a bogus .ceilToDouble() call.
TBR=abarth

Review URL: https://codereview.chromium.org/1173783002
2015-06-09 14:12:28 -07:00
Adam Barth
a68b53ae91 Fix the Sky tests
Instead of triggering layout synchronously during AppView construction, we now
schedule the initial layout using a magic bootstrapping function.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1172123003.
2015-06-09 14:07:17 -07:00
Adam Barth
4011ec97b8 SkyView should handle screen rotation
This CL implements a basic version of screen rotation where we just relayout at
the new size. In the future, we'll want a fancy version where we transition
between the two layouts.

R=ianh@google.com
BUG=

Review URL: https://codereview.chromium.org/1177563002.
2015-06-09 13:56:18 -07:00
Hixie
6495ef0710 Add asserts to prevent people from setting box.parentData.position or box.size except during layout.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1176623002
2015-06-09 13:11:11 -07:00
Matt Perry
7cbe385e8f Add a shadow to the FloatingActionButton.
Also added a helper class to Sky framework for building shadow DrawLoopers.

R=abarth@chromium.org, eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1175683002.
2015-06-09 15:51:04 -04:00
Adam Barth
3e5993eeee Give the popup menu a 2px border radius
This matches the material design spec.

R=ianh@google.com, jackson@chromium.org

Review URL: https://codereview.chromium.org/1169873003.
2015-06-09 12:43:27 -07:00
Adam Barth
2368f9b985 Add boxShadow to BoxDecoration#toString
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1174623002.
2015-06-09 10:39:52 -07:00
Adam Barth
7a930b8352 Add a proper material shadow the popup menu
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1172723002.
2015-06-09 10:31:39 -07:00
Adam Barth
f183f6a173 Position the popup menu in stocks2 correctly
This CL pulled an implementation of position: absolute in RenderStackContainer.

R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1166363002.
2015-06-09 09:22:50 -07:00
Adam Barth
e50d0e622b ShrinkWrap the Stocks menu
The popup menu in the stocks app is supposed to size its width to the max
intrinsic width of the menu. This CL teaches it how to do that.

It's a shame that we need to ceilToDouble the output of RenderParagraph. If we
don't do that, we run into floating point layout trouble and the menu triggers
a line break. The correct fix is to do layout in fixed point.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1168113005
2015-06-08 16:20:11 -07:00
Eric Seidel
92fd88b73f Fix RenderParagraph to respect text color.
I don't think this is the final API we're going to use.

I suspect we'll add a TextStyle struct to hold
color and size, etc. which back-ends into CSS like
this does today.

Currently no one uses this color even though it exists.

This is one step towards fixing:
https://github.com/domokit/mojo/issues/213

R=ianh@google.com

Review URL: https://codereview.chromium.org/1162573007
2015-06-08 15:22:18 -07:00
Adam Barth
903ef07abb Split getIntrinsicDimensions into four pieces
This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1167293003
2015-06-08 14:40:34 -07:00
Collin Jackson
d4ef9dcb26 Sky support for flexbox justify content
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1164363002
2015-06-08 14:14:02 -07:00
Adam Barth
5a14f03f7b Add Point.origin for new Point(0.0, 0.0)
R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1166183002
2015-06-08 13:36:52 -07:00
Adam Barth
c0d900414f Add |constraints| to Container for PopupMenuItem
This CL is the first step towards getting PopupMenuItem working in fn2. We
introduce the ability to add a minWidth to a Container by creating a
RenderConstrainedBox class to apply the new constraints.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1155683011
2015-06-08 12:22:52 -07:00
Adam Barth
2384779263 Introduce sky.Sky.zero
And deploy it in a few places.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1164303002
2015-06-08 10:09:03 -07:00
Eric Seidel
9af8d548e5 Make Text size to its content instead of always 100% width
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1156383006
2015-06-05 14:20:16 -07:00
Adam Barth
e6ad96e3e1 Don't crash when removing a radio button
We were hitting an assert in RenderCustomPaint that the callback wasn't null.

R=eseidel@chromium.org, jackson@chromium.org

Review URL: https://codereview.chromium.org/1162023010
2015-06-05 12:17:21 -07:00
Hixie
12aa568fc4 Export Point, Size, Rect, Color, Paint, Path, BoxDecoration, Border, BorderSide, EdgeDims, and FlexDirection from fn2.dart
That way most of our libraries don't have to use sky.Foo all over the place, and we can reduce the number of imports in most Dart components.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161323004
2015-06-05 10:18:50 -07:00
Adam Barth
247344193d Add the floating action button to stocks2
The + isn't quite centered properly, but the button is a circle in the right
place.

R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1156383004
2015-06-05 10:07:51 -07:00
Hixie
3cf7368d97 Silence a bunch of annoying bogus dartanalyzer warnings.
- several places where we use a getter knowing that it will return a
   subclass of its declared type, even asserting that it does, but
   where the analyzer is worried that the getter might start returning
   a new value unexpectedly, solved by having a temporary local
   variable shadow the getter and asserting that it doesn't change
   value
 - many many places where we do this with parentData specifically,
   solved by type-erasing parentData.
 - a place where a mixin wants to be subclassing another class, and
   uses its methods, solved by saying that the mixin is abstract but
   implements the superclass

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1160923008
2015-06-05 09:44:09 -07:00
Collin Jackson
45cbbc0fae Implement radio button for Sky’s fn2
R=abarth@chromium.org, eseidel@chromium.org, abarth

Review URL: https://codereview.chromium.org/1157573012
2015-06-04 17:24:38 -07:00
Hixie
96aadc99b4 Rename "BorderSide.None" to "BorderSide.none", since it's a constant, and change the sky.Size.infinite() constructor to a constant.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1158263005
2015-06-04 16:17:20 -07:00
Hixie
10cda2fe28 Include DETACHED, NEEDS-LAYOUT, and relayoutSubtreeRoot info in the debug output for the render tree
R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1149083011
2015-06-04 15:58:43 -07:00
Hixie
9b0cb975cb Improve the RenderObject.toString() logic so that there's not blank lines everywhere and to generally be better.
Adds sizes, positions, transforms, improves RenderParagraph's output.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1160233004
2015-06-04 15:45:44 -07:00
Eric Seidel
54d01bc005 Attempt to write a RenderShadowedBox
The goal of this is to have a Renderer-layer abstraction
around the Sky Engine c++ apis for drawing a shadow.

R=mpcomplete@chromium.org

Review URL: https://codereview.chromium.org/1146893004
2015-06-04 14:49:24 -07:00
Hixie
67d883c506 We don't necessarily have a child, so debugDescribeChildren() needs to check for null.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1151533006
2015-06-04 14:30:17 -07:00
Hixie
77ef219796 Fix some minor warnings from the analyzer in the framework.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1162623011
2015-06-04 14:11:02 -07:00
Hixie
8ee5aa0bc6 Give RenderObject a useful toString().
This makes debugging the render tree a lot easier. Just print the node
you care about, and you get an indented tree view of its subtree,
including settings. New subclasses should implement the new virtual
method debugDescribeSettings() to expose new settings.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1157993005
2015-06-04 14:10:07 -07:00
Adam Barth
0fcbeef342 Make FixedHeightScrollable understand heights
This CL makes FixedHeightScrollable able to measure heights. In the DOM-based
version, FixedHeightScrollable forced a synchronous layout in a microtask in
order to measure the size of itself and its children. In the DOM-less version,
we now require the subclass to tell us the item height and we measure our own
height using a layout callback.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1161063005
2015-06-04 13:42:16 -07:00
Hixie
6a0d1ffb2f Style guide says enum values should be lowerCamelCase.
https://www.dartlang.org/articles/style-guide/#names

R=jackson@google.com

Review URL: https://codereview.chromium.org/1158813004
2015-06-04 12:24:10 -07:00
Matt Perry
e584f258fe Fix regression in RenderTransform caused by change to Canvas.concat.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1169583002
2015-06-04 14:31:19 -04:00
Hixie
9706fc588f Assert that you can't mutate the tree during paint or layout.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144933007
2015-06-04 11:14:39 -07:00
Adam Barth
22b39a9f88 Add RenderClip and use it in FixedHeightScrollable
In the future, we might want to extend this class to clip to a configurable
rect in addition to clipping to its bounds.

R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1145263006
2015-06-04 11:14:30 -07:00
Collin Jackson
ab90994194 Stub out InkWell and implement Sky’s fn2 menu item
R=abarth@chromium.org, ianh@google.com, abarth, hixie

Review URL: https://codereview.chromium.org/1165983002
2015-06-04 11:04:01 -07:00
Hixie
08b2a30e0f Enable RenderDecoratedBox to draw borders.
Currently supports only solid borders, but of any colour and size, independently controlling each side.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1154903006
2015-06-04 10:50:59 -07:00
Hixie
8e34567652 Rename RenderNode to RenderObject.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1165013003
2015-06-04 10:45:21 -07:00
Hixie
04f10fbf64 Fix the crash when the drawer is hidden.
The root cause of the crash was threefold:
 - you can't enumerate enums, in dart; you have to enumerate their values.
 - RenderNodeWrapper was trying to call remove(child.root) on its root, but that's
   not something that all RenderNodes have
 - when a RenderNode was deparented, its relayoutSubtreeRoot wasn't removed, so
   the node ended up in an inconsistent state regarding its parent tree

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1151573020
2015-06-04 10:39:34 -07:00
Hixie
0e06bfbee0 Make EdgeDims and BoxConstraints printable (for debugging)
R=jackson@google.com

Review URL: https://codereview.chromium.org/1166523006
2015-06-03 17:24:31 -07:00
Adam Barth
16f8b21601 Fix gesture events in fn2
This CL makes gesture events work again in fn2.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1146923005
2015-06-03 16:06:15 -07:00
Collin Jackson
7552bf79d1 Fix Sky issue where RenderNode was not painting automatically in interactive situations
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1168623002
2015-06-03 15:42:21 -07:00
Collin Jackson
e16e10d830 Implement RenderImage and Image for Sky
This also fixes a bug that was preventing markNeedsLayout from working

R=abarth@chromium.org, eseidel@chromium.org, abarth, eseidel

Review URL: https://codereview.chromium.org/1160013004
2015-06-03 15:17:12 -07:00
Adam Barth
6d5227ea0c Make Drawer in components2 work
This CL introduces RenderStack and fixes a number of bugs to make the Drawer in
components2 work.

R=ianh@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1147143005
2015-06-03 14:52:13 -07:00
Matt Perry
8c097b0892 Update BoxDecoration and RenderParagraph to use sky.Color instead of int.
Also add operator==, hashCode, toString, and some basic Color constants to
Color.

R=abarth@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1162023004
2015-06-03 16:57:04 -04:00
Eric Seidel
a90cc80a88 Fix min/max typo in BoxConstraints.deflate
R=ianh@google.com

Review URL: https://codereview.chromium.org/1153413003
2015-06-03 11:12:17 -07:00
Hixie
3fe1c0b38c Fix logic in RenderPadding.
Previously, we were not adjusting the minimum width, so we ended up
offsetting the child but not shrinking it, when the parent expected
the child to be exactly fit to its dimensions.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1155303005
2015-06-03 10:25:05 -07:00