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

Side by Side Diff: samples/calculator/settings.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « samples/calculator/calcui.dart ('k') | samples/calculator/tape.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Settings { 5 class Settings {
6 // theme values: 6 // theme values:
7 static const THEME_SIMPLE = 1; 7 static const THEME_SIMPLE = 1;
8 static const THEME_BUTTON = 2; 8 static const THEME_BUTTON = 2;
9 9
10 SettingsDialog ui; 10 SettingsDialog ui;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } else { 42 } else {
43 close(); 43 close();
44 } 44 }
45 } 45 }
46 46
47 void decorateDropdown() { 47 void decorateDropdown() {
48 ui.settings.style.backgroundColor = _dialogOpened ? 48 ui.settings.style.backgroundColor = _dialogOpened ?
49 "transparent" : "#333"; 49 "transparent" : "#333";
50 } 50 }
51 51
52 bool get isOpen() => _dialogOpened; 52 bool get isOpen => _dialogOpened;
53 53
54 /* 54 /*
55 * Optional MouseEvent if passed if the source of event is from outside of 55 * Optional MouseEvent if passed if the source of event is from outside of
56 * the dialog then the dialog can be closed. 56 * the dialog then the dialog can be closed.
57 */ 57 */
58 void close([MouseEvent e]) { 58 void close([MouseEvent e]) {
59 if (isOpen) { 59 if (isOpen) {
60 if (ui.simple.checked) { 60 if (ui.simple.checked) {
61 theme = THEME_SIMPLE; 61 theme = THEME_SIMPLE;
62 } else if (ui.buttons.checked) { 62 } else if (ui.buttons.checked) {
63 theme = THEME_BUTTON; 63 theme = THEME_BUTTON;
64 } 64 }
65 65
66 if (e == null || !ui.settingsDialog.contains(e.srcElement)) { 66 if (e == null || !ui.settingsDialog.contains(e.srcElement)) {
67 decorateDropdown(); 67 decorateDropdown();
68 ui.settingsDialog.style.visibility = "hidden"; 68 ui.settingsDialog.style.visibility = "hidden";
69 _dialogOpened = false; 69 _dialogOpened = false;
70 } 70 }
71 } 71 }
72 } 72 }
73 73
74 bool get isSimple() => theme == THEME_SIMPLE; 74 bool get isSimple => theme == THEME_SIMPLE;
75 bool get isButton() => theme == THEME_BUTTON; 75 bool get isButton => theme == THEME_BUTTON;
76 76
77 } 77 }
OLDNEW
« no previous file with comments | « samples/calculator/calcui.dart ('k') | samples/calculator/tape.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698