Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: sky/examples/lib/solid_color_box.dart

Issue 1218593002: Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/examples/lib/solid_color_box.dart
diff --git a/sky/examples/lib/solid_color_box.dart b/sky/examples/lib/solid_color_box.dart
deleted file mode 100644
index b6624c666fbb353de51c00d3be1098271d912447..0000000000000000000000000000000000000000
--- a/sky/examples/lib/solid_color_box.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:sky' as sky;
-import 'package:sky/rendering/object.dart';
-import 'package:sky/rendering/box.dart';
-
-class RenderSolidColorBox extends RenderDecoratedBox {
- final Size desiredSize;
- final Color backgroundColor;
-
- RenderSolidColorBox(Color backgroundColor, { this.desiredSize: Size.infinite })
- : backgroundColor = backgroundColor,
- super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
-
- double getMinIntrinsicWidth(BoxConstraints constraints) {
- return constraints.constrainHeight(
- this.desiredSize == Size.infinite ? 0.0 : desiredSize.width
- );
- }
-
- double getMaxIntrinsicWidth(BoxConstraints constraints) {
- return constraints.constrainWidth(
- this.desiredSize == Size.infinite ? 0.0 : desiredSize.width
- );
- }
-
- double getMinIntrinsicHeight(BoxConstraints constraints) {
- return constraints.constrainHeight(
- this.desiredSize == Size.infinite ? 0.0 : desiredSize.height
- );
- }
-
- double getMaxIntrinsicHeight(BoxConstraints constraints) {
- return constraints.constrainHeight(
- this.desiredSize == Size.infinite ? 0.0 : desiredSize.height
- );
- }
-
- void performLayout() {
- size = constraints.constrain(desiredSize);
- }
-
- void handleEvent(sky.Event event, BoxHitTestEntry entry) {
- if (event.type == 'pointerdown')
- decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
- else if (event.type == 'pointerup')
- decoration = new BoxDecoration(backgroundColor: backgroundColor);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698