301 Commits

Author SHA1 Message Date
Collin Jackson
fe8c1e6b52 Tab bar should have white indicator if primary and accent color are the same
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1215313004 .
2015-07-07 15:35:19 -07:00
Eric Seidel
63cefd8bc1 Use sky_shell instead of mojo_shell for testing.
This does way more than a single CL should do, sorry.
- Fixed a bunch of logging/error reporting during loads.
- Made it possible for --package-root to be absolute.
- Fixed (hypothetically) parts of iOS build to be clang-plugin-compliant.
- Made all tests pass in sky_shell
- Removed a bunch of layout_tests including windows support.

I'll remove all the mojo test harness stuff in a follow-up patch.

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

Review URL: https://codereview.chromium.org/1215953006.
2015-07-06 17:45:49 -07:00
Collin Jackson
07d3108e86 Use red as floating action button color rather than accent color
R=ianh@google.com

Review URL: https://codereview.chromium.org/1222243007.
2015-07-06 16:04:42 -07:00
Adam Barth
749bd906db Set the default whitespace mode to pre-wrap
This CL makes it easier to insert line breaks into text runs.

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

Review URL: https://codereview.chromium.org/1221913003.
2015-07-06 15:44:54 -07:00
Adam Barth
3dd427d6f5 Update test expectations after view padding change
We no longer have view padding during testing so these values change a bit.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1225703003.
2015-07-06 12:40:19 -07:00
Hans Muller
c06fc9580a Scrollable TabBar Version 0
TODO:
- Make fling-scrolling work
- Tune scrolling performance
- When a tab is selected, snap it to the center if possible

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1221673006.
2015-07-06 10:23:31 -07:00
Collin Jackson
88b6042846 Refactoring to support dark theme better
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218153005.
2015-07-06 08:05:29 -07:00
Matt Perry
604c13d57f Fix test failures from my previous animation patch.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216923008.
2015-07-01 19:02:24 -04:00
Hans Muller
aecdef8ac2 Add a TabNavigator to the Stocks demo
Changed FixedHeightScrollable so that if the list shrinks past the current scrollOffset, the scrollOffset is adjusted so that the last/only page of the list remains visible.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216323002.
2015-06-30 17:08:14 -07:00
Adam Barth
661906e733 Port remaining Sky tests to the new world
These tests now run in the DOM-less world.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1212163009.
2015-06-30 13:53:20 -07:00
Hans Muller
42490925a6 Fix tabs.dart test results
TBR=abarth

Review URL: https://codereview.chromium.org/1214413002.
2015-06-30 13:32:40 -07:00
Hans Muller
28c753500a Gratuitous tabs example enhancement
Demo all three varieties of TabLabels in 3 different
TabNavigators. Use another TabNavigator to select
among the three Card-encapsulated demos.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217243005.
2015-06-30 12:59:51 -07:00
Hixie
1351488a17 Remove Material's opinion about background colours, since in fact the background colour varies dramatically with the kind of material involved.
Also:
- give users of Material who previously relied on Material's defaults
  opinions about background colours
- reindent stock_row.dart
- import colors as colors in example/widgets/styled_text.dart, rather
  than in global scope, for consistency with other files
- import typography as typograpyh in example/widgets/tabs.dart, rather
  than in global scope, for consistency with other files
- make flat_button actually be transparent by not painting a
  background, rather than painting 0x00000000. This is the what I
  actually originally set out to do here.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217293003.
2015-06-30 12:48:04 -07:00
Adam Barth
560477f3ba Remove Sky tests that we don't intend to port to the new world
These tests are for aspects of the Sky engine we plan to remove along with
support for the old world.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1215063003.
2015-06-30 12:42:54 -07:00
Adam Barth
0080da1fe6 Fix import typo in network.sky test
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1218903004.
2015-06-30 12:27:34 -07:00
Adam Barth
ecc5134416 Remove package:sky/framework
Please use package:sky/widgets instead.

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

Review URL: https://codereview.chromium.org/1221883002.
2015-06-30 12:01:54 -07:00
Hixie
80d6a881ca Fix all the components to pick the right colours from the theme.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217573003.
2015-06-30 11:50:14 -07:00
Ian Fischer
1dd9c9a5f8 Fix tests broken by default text color change.
R=abarth@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1215023003.
2015-06-29 14:57:58 -07:00
Ian Fischer
c4db2df60f Rename RenderCanvas to PaintingCanvas to avoid confusion with other classes that inherit from RenderObject.
R=ianh@google.com, abarth@google.com

Review URL: https://codereview.chromium.org/1217933002.
2015-06-29 14:19:30 -07:00
Hixie
6818693903 Fix tests which broke in https://codereview.chromium.org/1216013003.
Actually the tests broke in 136e0d4da5
...but I had reset the results because I had changed all the coordinates, and didn't realise some of the changes were bad.

TBR=abarth

Review URL: https://codereview.chromium.org/1212803003.
2015-06-29 14:04:58 -07:00
Adam Barth
9062c56136 Make it possible to run a test in sky_shell
This CL makes it possible to run sky/tests/raw/bogus_import.dart in sky_shell
on Linux. We'd eventually like to scale this up to running all the tests.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1218633003.
2015-06-29 10:39:44 -07:00
Hans Muller
ad3fae3931 Add TabNavigator
A simple container for a TabBar. It is defined by a list of
TabNavigatorViews, each of which is just a TabLabel and
the tab's content.

The content of each tab is represented by a function
that produces a Widget called "content". I couldn't
bring myself to call it buildTabContentCallback or something
else more specific.

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

Review URL: https://codereview.chromium.org/1212993003.
2015-06-29 10:03:28 -07:00
Hixie
6ed5b43877 Instead of applying a transform for every RenderObject, pass down an Offset for where to paint.
This should be a perf win, but I haven't tested it.

Also adds an operator overloading such that Offset + Size -> Rect.
Also adds Rect.fromLTWH().

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1209413004.
2015-06-29 09:07:13 -07:00
Adam Barth
46363355ba Cleanup sky/sdk/examples
* Remove all the DOM-based examples except for the old stocks app
* Rename stocks2 to stocks
* Promote hello_widgets.dart to a top-level hello_world example

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1219493003.
2015-06-27 00:00:18 -07:00
Adam Barth
06adbc9aa6 Move examples to //sky/sdk/example
We're trying to follow the pattern described in https://www.dartlang.org/tools/pub/package-layout.html

TBR=iansf@google.com

Review URL: https://codereview.chromium.org/1210173004.
2015-06-26 22:52:40 -07:00
Hans Muller
dcabb54ad9 Make TabBar conform to the Material spec for icon/text tabs
When both icons and text are specified, the icon goes on top,
10 pixels of margin goes in between, and the TabBar's height
grows to 72.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1213043002.
2015-06-26 16:16:00 -07:00
Hixie
fa70eb0982 Split Size into Size and Offset.
Added a OffsetBase class that Size now inherits from, and added a new
Offset class that also inherits from OffsetBase.

Offset has:
 - dx and dy members
 - zero and infinite static constants
 - a method that returns a new Offset that's the existing one scaled
   by a scalar
 - a unary minus operator
 - operators overloads such that subtracting or adding two Offsets
   gives another Offset
 - a toPoint() method

Added Offset and Size to the dart bindings, so they can be used from C++.

Changed the Canvas API to use Point, Size, and Offset where appropriate:
 - drawLine uses Points now
 - drawCircle uses a Point now
 - drawImage uses a Paint now
 - the constructor uses a Size

Changed Point as follows:
 - added a unary minus
 - Point difference now gives an Offset rather than a Size
 - You can add an Offset to a Point to get a new Point
 - toSize() has been replaced by toOffset()

Changed Rect as follows:
 - renamed upperLeft and lowerRight to topLeft and bottomRight for
   consistency with our other APIs
 - added bottomLeft and topRight for completeness

Changed Size as follows:
 - now inherits from OffsetBase
 - added *, /, ~/, and % operators for scaling sizes
 - subtracting a Size from a Size gives an Offset
 - subtracting an Offset from a Size gives a Size
 - changed the + operator to take an Offset instead of a Size
 - added topLeft, bottomLeft, topRight, bottomRight to match Rect
 - added center for the same reason
 - added shortestSide getter since that was a common pattern
 - removed toPoint()

Changed DrawLooperLayerInfo as follows:
 - setOffset member takes an Offset instead of a Point

Changed BoxConstraints as follows:
 - added biggest getter since it was a common pattern
 - added smallest getter for symmetry

Changed BoxShadow as follows:
 - offset member is an Offset rather than a Size

Changed ViewConstraints as follows:
 - replaced height and width members by a single size member

I did some minor code cleanup in nearby files while I was there,
including sorting sky/engine/core/core.gni alphabetically, and fixing
some warnings in the examples.

BUG=
R=abarth@chromium.org, chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1214833004.
2015-06-26 15:21:29 -07:00
Ian Fischer
6ae1de6c46 Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218593002.
2015-06-26 15:06:40 -07:00
Hans Muller
ce7e8260c3 Use Theme to define the colors and TextStyles for Tab, TabBar
Also added a smoke test for examples/widgets/tabs.dart.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1213873002.
2015-06-26 09:30:53 -07:00
Hixie
02b651f7d6 Let's hide double.INFINITY a bit more, by providing cleaner APIs for the cases where we're currently trying to use it.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1209233002.
2015-06-25 17:27:43 -07:00
Hixie
a2ba25d0ba Add support for line-height in TextStyle.
Also, some minor cleanup in TextStyle to make it more readable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1203253002.
2015-06-24 13:25:17 -07:00
Ian Fischer
1799eacef5 Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia counterparts.
Also changes the framework dart code to use the
refactored APIs and fixes the various examples and
tests.

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

Review URL: https://codereview.chromium.org/1190123003.
2015-06-24 10:21:45 -07:00
Viktor Lidholt
c89c751937 Adds basic sprite sheet support to sprites
Adds drawImageRect to Canvas bindings

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1204783003.
2015-06-23 16:38:28 -07:00
Collin Jackson
ad4757b747 Add a confirmation dialog to stock app Settings page and style it by default
R=ianh@google.com, abarth, hixie

Review URL: https://codereview.chromium.org/1201273002.
2015-06-23 14:19:00 -07:00
Collin Jackson
2b73e7288b Teach Sky buttons and dialogs how to use the new Theme system
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1192773004.
2015-06-23 10:12:58 -07:00
Collin Jackson
5ab01574f4 Add Material light and dark themes to Sky widgets
R=ianh@google.com, hixie

Review URL: https://codereview.chromium.org/1204523002.
2015-06-22 17:14:27 -07:00
Hixie
3ed42112b0 Update README.md and HACKING.md and resulting yak shave.
Update sky_server:
 - update its help string to admit that it wants the package path as well.
 - be quiet by default, since it makes the build chatty.
 - have a -v for verbose mode, for people who like it chatty.
 - have a default port of 8000, since that's what everyone used.
 - have a -p option to set the port, for people who don't use the default.
 - remove its mapping for gen/, since a TODO told me to.
 - remove the dependency on the build configuration, since it's no longer used.
 - teach it about .dart files.
 - rename sky_server/README to README.md, for consistency with other READMEs.
Update shelldb to speak the new sky_server protocol.
Update tests/services/iframe-embed-vmc.sky since the sky_server change broke the hack it was using.
Update skyserver.py to speak the new sky_server protocol.
Make webkitpy use SkyServer instead of spawning sky_server itself, since a TODO told me to.
Teach webkitpy about dart files.
Teach test_perf about dart files. (untested)
Teach sky_tool about main.dart, main.sky is deprecated. (untested)

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1200993002.
2015-06-22 13:39:16 -07:00
Hans Muller
2b126efbc8 StyledText is just a convenient way to specify a
tree of InlineStyle and InlineText elements.
StyledText builds an Inline that renders the tree.

For example this StyledText object:

  new StyledText(["FOO", [boldLargerStyle, [greenStyle "BAR"], "BAZ"] BORF]);

Renders the same way the following HTML would,
assuming that TextStyles boldLargerStyle and
greenStyle were defined.

<style>
div {
  display: inline;
}
</style>
<p>
  <div>
    FOO
    <div style="font-weight:bold; font-size:larger">
      <div style="color:green">
        BAR
      </div>
      BAZ
    </div>
    BORF
  </div>
</p>

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1194693002.
2015-06-18 14:35:11 -07:00
Hixie
ee4a7bc925 Rename editing2/ and theme2/ to editing/ and theme/.
Flesh out a README.md file for the SDK.
Make the stocks app test wait for the app to be mounted, to catch some more errors, like typos in the mount callback.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182053012.
2015-06-18 12:44:10 -07:00
Adam Barth
fd4527dd4a Don't crash if you call document.createText(null)
Fixes #165.

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

Review URL: https://codereview.chromium.org/1196463002.
2015-06-18 12:17:05 -07:00
Adam Barth
f360479e1a Demonstrate that we don't crash on a bogus import
Fixes #167

R=ianh@google.com

Review URL: https://codereview.chromium.org/1193713002.
2015-06-18 12:13:31 -07:00
Matt Perry
edff56d399 Add a Paint::toString() method to describe our Paint objects.
Add a test for RenderDecoratedBox sets up the Paint object correctly.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1185423003.
2015-06-18 13:47:28 -04:00
Adam Barth
381c19e075 If Color constructor is passed a value > 0xFFFFFFFF, Sky crashes
We now ensure the color is <= 0xFFFFFFFF.

Fixes #245

R=ianh@google.com

Review URL: https://codereview.chromium.org/1179413008.
2015-06-18 10:32:26 -07:00
Hixie
0038e78ed6 Rename AppView to SkyBinding.
Move app/view.dart to rendering/sky_binding.dart since it's part of the RenderObject API, really (it knows about RenderView intimately).
The tests pass. I didn't check every last example.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183913006.
2015-06-17 17:07:31 -07:00
Hixie
da3e55c837 Add a test for the sector app.
This also moves the test for stocks into a new tests/examples/
directory, where we can put tests that test the examples.

TBR=abarth

Review URL: https://codereview.chromium.org/1182223004.
2015-06-17 15:44:20 -07:00
Hixie
1339d2bcc5 Clean up the tests to be more maintainable.
- removes the unit testing framework from tests that don't use it
- use 'async' where that makes the code less convoluted

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1192003003.
2015-06-17 15:10:06 -07:00
Hixie
8bd7781755 Clean up how we remove nodes from the render tree, and make sure we reinsert them in the right place.
Fixes weird behaviours when the old and new children of TagNodes can't be synced.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182463006.
2015-06-17 13:56:06 -07:00
Adam Barth
a2b8ddd5c5 Settings menu item in stock2 doesn't work
The underlying problem is that we lacked a RenderObjectWrapper for the
RenderView, which meant we couldn't handle changing the RenderObject that was
the root of the RenderView. This CL introduces a RenderViewWrapper and uses it
in a new AppContainer widget root. This change allows us to make App a
non-magical Component that is inserted into the AppContainer in the newly
introduced runApp function.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1184823006.
2015-06-17 12:36:56 -07:00
Hans Muller
34c746270d Fix a typo in Dialog
If action: was specified, content: was added twice.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1188303002.
2015-06-17 10:06:44 -07:00
Adam Barth
c4a7aa33d5 Delete sky-element framework
This framework is two generations old and has no clients.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1177843010.
2015-06-17 10:05:04 -07:00