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

Side by Side Diff: sky/sdk/lib/widgets/tabs.dart

Issue 1218153005: Refactoring to support dark theme better (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix import issues Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/switch.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 6
7 import 'package:sky/rendering/box.dart'; 7 import 'package:sky/rendering/box.dart';
8 import 'package:sky/rendering/object.dart'; 8 import 'package:sky/rendering/object.dart';
9 import 'package:sky/widgets/basic.dart'; 9 import 'package:sky/widgets/basic.dart';
10 import 'package:sky/widgets/icon.dart'; 10 import 'package:sky/widgets/icon.dart';
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 bool textAndIcons = false; 288 bool textAndIcons = false;
289 int tabIndex = 0; 289 int tabIndex = 0;
290 for (TabLabel label in labels) { 290 for (TabLabel label in labels) {
291 tabs.add(_toTab(label, tabIndex++)); 291 tabs.add(_toTab(label, tabIndex++));
292 if (label.text != null && label.icon != null) 292 if (label.text != null && label.icon != null)
293 textAndIcons = true; 293 textAndIcons = true;
294 } 294 }
295 return new TabBarWrapper( 295 return new TabBarWrapper(
296 children: tabs, 296 children: tabs,
297 selectedIndex: selectedIndex, 297 selectedIndex: selectedIndex,
298 backgroundColor: Theme.of(this).primary[500], 298 backgroundColor: Theme.of(this).primaryColor,
299 indicatorColor: Theme.of(this).accent[200], 299 indicatorColor: Theme.of(this).accentColor,
300 textAndIcons: textAndIcons 300 textAndIcons: textAndIcons
301 ); 301 );
302 } 302 }
303 } 303 }
304 304
305 class TabNavigatorView { 305 class TabNavigatorView {
306 TabNavigatorView({ this.label, this.builder }); 306 TabNavigatorView({ this.label, this.builder });
307 307
308 final TabLabel label; 308 final TabLabel label;
309 final Builder builder; 309 final Builder builder;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 onChanged: _handleSelectedIndexChanged, 342 onChanged: _handleSelectedIndexChanged,
343 selectedIndex: selectedIndex 343 selectedIndex: selectedIndex
344 ); 344 );
345 345
346 Widget content = views[selectedIndex].buildContent(); 346 Widget content = views[selectedIndex].buildContent();
347 return new Flex([tabBar, new Flexible(child: content)], 347 return new Flex([tabBar, new Flexible(child: content)],
348 direction: FlexDirection.vertical 348 direction: FlexDirection.vertical
349 ); 349 );
350 } 350 }
351 } 351 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/switch.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698