mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
-Make display:flex, flex-direction: column, flex-shrink: 1 the default. -Simplify StyleAdjuster::adjustStyleForAlignment to remove special cases we won't need as we make flex the default and remove absolute positioning. -Fix a bug this exposed in column flexboxes where we'd apply the wrong edge of border/padding/margin. -For now leave the default of align-items:stretch. The main change here is that iframe/img will do width:auto the same as blocks (i.e. the width of the parent). I think this is a good change, but we'll have to see how it feels in practice. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1061163002
45 lines
1.0 KiB
Dart
45 lines
1.0 KiB
Dart
// 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 '../theme/view-configuration.dart';
|
|
import 'material.dart';
|
|
|
|
class ActionBar extends Component {
|
|
static final Style _style = new Style('''
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
height: 56px;
|
|
padding: 0 8px;
|
|
transition: background-color 0.3s;
|
|
padding-top: ${kStatusBarHeight}px;''');
|
|
|
|
static Style _centerStyle = new Style('''
|
|
padding-left: 24px;
|
|
flex: 1;''');
|
|
|
|
UINode left;
|
|
UINode center;
|
|
List<UINode> right;
|
|
|
|
ActionBar({
|
|
String key,
|
|
this.left,
|
|
this.center,
|
|
this.right
|
|
}) : super(key: key);
|
|
|
|
UINode build() {
|
|
List<UINode> children = [left, new StyleNode(center, _centerStyle)];
|
|
|
|
if (right != null)
|
|
children.addAll(right);
|
|
|
|
return new Material(
|
|
content: new Container(style: _style, children: children),
|
|
level: 2);
|
|
}
|
|
}
|