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

Unified Diff: sky/framework/components/checkbox.dart

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « sky/framework/components/button_base.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/checkbox.dart
diff --git a/sky/framework/components/checkbox.dart b/sky/framework/components/checkbox.dart
deleted file mode 100644
index 1924f5cd6b94b2ddb89b703dcc4cd1cf384c0088..0000000000000000000000000000000000000000
--- a/sky/framework/components/checkbox.dart
+++ /dev/null
@@ -1,87 +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 '../fn.dart';
-import '../layout.dart';
-import 'button_base.dart';
-import 'dart:sky' as sky;
-
-typedef void ValueChanged(value);
-
-class Checkbox extends ButtonBase {
- static final Style _style = new Style('''
- transform: translateX(0);
- justify-content: center;
- align-items: center;
- -webkit-user-select: none;
- cursor: pointer;
- width: 30px;
- height: 30px;'''
- );
-
- static final Style _containerStyle = new Style('''
- border: solid 2px;
- border-color: rgba(90, 90, 90, 0.25);
- width: 10px;
- height: 10px;'''
- );
-
- static final Style _containerHighlightStyle = new Style('''
- border: solid 2px;
- border-color: rgba(90, 90, 90, 0.25);
- width: 10px;
- height: 10px;
- border-radius: 10px;
- background-color: orange;
- border-color: orange;'''
- );
-
- static final Style _uncheckedStyle = new Style('''
- top: 0px;
- left: 0px;'''
- );
-
- static final Style _checkedStyle = new Style('''
- top: 0px;
- left: 0px;
- transform: translate(2px, -15px) rotate(45deg);
- width: 10px;
- height: 20px;
- border-style: solid;
- border-top: none;
- border-left: none;
- border-right-width: 2px;
- border-bottom-width: 2px;
- border-color: #0f9d58;'''
- );
-
- bool checked;
- ValueChanged onChanged;
-
- Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key);
-
- void _handleClick(sky.Event e) {
- onChanged(!checked);
- }
-
- UINode buildContent() {
- return new EventListenerNode(
- new FlexContainer(
- style: _style,
- direction: FlexDirection.Row,
- children: [
- new Container(
- style: highlight ? _containerHighlightStyle : _containerStyle,
- children: [
- new Container(
- style: checked ? _checkedStyle : _uncheckedStyle
- )
- ]
- )
- ]
- ),
- onGestureTap: _handleClick
- );
- }
-}
« no previous file with comments | « sky/framework/components/button_base.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698