提交 f21b435d 编写于 作者: A Adam Barth

Make the stocks drawer look more realistic

The menu items don't quite make sense for this app, but they're closer in
visual styling.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951413002
上级 17569631
......@@ -3,9 +3,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<import src="/sky/framework/sky-drawer-header.sky" />
<import src="/sky/framework/sky-drawer.sky" />
<import src="/sky/framework/sky-element.sky" />
<import src="/sky/framework/sky-icon.sky" />
<import src="/sky/framework/sky-menu-divider.sky" />
<import src="/sky/framework/sky-menu-item.sky" />
<import src="/sky/framework/sky-scrollable.sky" />
<import src="/sky/framework/sky-toolbar.sky" />
<import src="stock.sky" as='view'/>
......@@ -35,12 +38,8 @@
color: white;
}
sky-icon {
display: flex;
justify-content: center;
align-items: center;
padding: 8px;
margin: 0 4px;
color: black;
}
#title {
flex: 1;
......@@ -51,7 +50,14 @@
}
</style>
<sky-drawer id="drawer">
I am drawer
<sky-drawer-header>
Stocks
</sky-drawer-header>
<sky-menu-item icon="content/inbox">Inbox</sky-menu-item>
<sky-menu-item icon="content/drafts">Drafts</sky-menu-item>
<sky-menu-divider />
<sky-menu-item icon="action/settings">Settings</sky-menu-item>
<sky-menu-item icon="action/help">Help &amp; feedback</sky-menu-item>
</sky-drawer>
<sky-toolbar level="2">
<sky-icon id="menu" type="navigation/menu_white" size="24" />
......
<!--
// 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 src="sky-element.sky" />
<import src="sky-icon.sky" />
<sky-element attributes="icon:string">
<template>
<style>
:host {
display: flex;
flex-direction: column;
height: 140px;
-webkit-user-select: none;
background-color: #E3ECF5;
border-bottom: 1px solid #D1D9E1;
padding-bottom: 7px;
margin-bottom: 8px;
}
#spacer {
flex: 1;
}
#label {
padding: 0 16px;
font-family: 'Roboto Medium', 'Helvetica';
color: #212121;
}
</style>
<div id="spacer" />
<div id="label">
<content />
</div>
</template>
<script>
import "dart:sky";
@Tagname('sky-drawer-header')
class SkyDrawerHeader extends SkyElement {
}
_init(script) => register(script, SkyDrawerHeader);
</script>
</sky-element>
......@@ -19,7 +19,7 @@
right: 0;
}
#content {
background-color: white;
background-color: #FAFAFA;
will-change: transform;
position: absolute;
width: 256px;
......
<!--
// 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 src="sky-element.sky" />
<sky-element>
<template>
<style>
:host {
margin: 8px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
</style>
</template>
<script>
import "dart:sky";
@Tagname('sky-menu-divider')
class SkyMenuDivider extends SkyElement {
}
_init(script) => register(script, SkyMenuDivider);
</script>
</sky-element>
<!--
// 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 src="sky-element.sky" />
<import src="sky-icon.sky" />
<sky-element attributes="icon:string">
<template>
<style>
:host {
display: flex;
align-items: center;
height: 48px;
-webkit-user-select: none;
}
sky-icon {
padding: 0px 16px;
}
#label {
font-family: 'Roboto Medium', 'Helvetica';
color: #212121;
padding: 0px 16px;
flex: 1;
}
</style>
<sky-icon size="24" />
<div id="label">
<content />
</div>
</template>
<script>
import "dart:sky";
@Tagname('sky-menu-item')
class SkyMenuItem extends SkyElement {
SkyIcon _icon;
Element _label;
void shadowRootReady() {
_icon = shadowRoot.querySelector('sky-icon');
_icon.type = "${icon}_grey600";
}
void iconChanged(String oldValue, String newValue) {
if (_icon != null)
_icon.type = "${newValue}_grey600";
}
}
_init(script) => register(script, SkyMenuItem);
</script>
</sky-element>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册