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

Side by Side Diff: samples/ui_lib/touch/Scrollbar.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/ui_lib/touch/Momentum.dart ('k') | samples/ui_lib/touch/Scroller.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Implementation of a scrollbar for the custom scrolling behavior 6 * Implementation of a scrollbar for the custom scrolling behavior
7 * defined in [:Scroller:]. 7 * defined in [:Scroller:].
8 */ 8 */
9 class Scrollbar implements ScrollListener { 9 class Scrollbar implements ScrollListener {
10 /** 10 /**
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bool _hovering = false; 56 bool _hovering = false;
57 57
58 Scrollbar(Scroller scroller, [displayOnHover = true]) : 58 Scrollbar(Scroller scroller, [displayOnHover = true]) :
59 _displayOnHover = displayOnHover, 59 _displayOnHover = displayOnHover,
60 _scroller = scroller, 60 _scroller = scroller,
61 _frame = scroller.getFrame(), 61 _frame = scroller.getFrame(),
62 _cachedSize = new Map<String, num>() { 62 _cachedSize = new Map<String, num>() {
63 _boundHideFn = () { _showScrollbars(false); }; 63 _boundHideFn = () { _showScrollbars(false); };
64 } 64 }
65 65
66 bool get _scrollBarDragInProgress() => _scrollBarDragInProgressValue; 66 bool get _scrollBarDragInProgress => _scrollBarDragInProgressValue;
67 67
68 void set _scrollBarDragInProgress(bool value) { 68 void set _scrollBarDragInProgress(bool value) {
69 _scrollBarDragInProgressValue = value; 69 _scrollBarDragInProgressValue = value;
70 _toggleClass(_verticalElement, DRAG_CLASS_NAME, 70 _toggleClass(_verticalElement, DRAG_CLASS_NAME,
71 value && _currentScrollVertical); 71 value && _currentScrollVertical);
72 _toggleClass(_horizontalElement, DRAG_CLASS_NAME, 72 _toggleClass(_horizontalElement, DRAG_CLASS_NAME,
73 value && !_currentScrollVertical); 73 value && !_currentScrollVertical);
74 } 74 }
75 75
76 // TODO(jacobr): move this helper method into the DOM. 76 // TODO(jacobr): move this helper method into the DOM.
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 style.setProperty(cssPos, '${pos}px', ''); 343 style.setProperty(cssPos, '${pos}px', '');
344 if (_cachedSize[cssSize] != size) { 344 if (_cachedSize[cssSize] != size) {
345 _cachedSize[cssSize] = size; 345 _cachedSize[cssSize] = size;
346 style.setProperty(cssSize, '${size}px', ''); 346 style.setProperty(cssSize, '${size}px', '');
347 } 347 }
348 if (element.parent == null) { 348 if (element.parent == null) {
349 _frame.nodes.add(element); 349 _frame.nodes.add(element);
350 } 350 }
351 } 351 }
352 } 352 }
OLDNEW
« no previous file with comments | « samples/ui_lib/touch/Momentum.dart ('k') | samples/ui_lib/touch/Scroller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698