| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 int _currentScrollStartMouse; | 49 int _currentScrollStartMouse; |
| 50 num _currentScrollStartOffset; | 50 num _currentScrollStartOffset; |
| 51 bool _currentScrollVertical; | 51 bool _currentScrollVertical; |
| 52 num _currentScrollRatio; | 52 num _currentScrollRatio; |
| 53 num _timerId; | 53 num _timerId; |
| 54 | 54 |
| 55 bool _displayOnHover; | 55 bool _displayOnHover; |
| 56 bool _hovering = false; | 56 bool _hovering = false; |
| 57 | 57 |
| 58 Scrollbar(Scroller scroller, [this._displayOnHover = true]) : | 58 Scrollbar(Scroller scroller, [displayOnHover = true]) : |
| 59 _displayOnHover = displayOnHover, |
| 59 _scroller = scroller, | 60 _scroller = scroller, |
| 60 _frame = scroller.getFrame(), | 61 _frame = scroller.getFrame(), |
| 61 _cachedSize = new Map<String, num>() { | 62 _cachedSize = new Map<String, num>() { |
| 62 _boundHideFn = () { _showScrollbars(false); }; | 63 _boundHideFn = () { _showScrollbars(false); }; |
| 63 } | 64 } |
| 64 | 65 |
| 65 bool get _scrollBarDragInProgress() => _scrollBarDragInProgressValue; | 66 bool get _scrollBarDragInProgress() => _scrollBarDragInProgressValue; |
| 66 | 67 |
| 67 void set _scrollBarDragInProgress(bool value) { | 68 void set _scrollBarDragInProgress(bool value) { |
| 68 _scrollBarDragInProgressValue = value; | 69 _scrollBarDragInProgressValue = value; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 style.setProperty(cssPos, '${pos}px', ''); | 343 style.setProperty(cssPos, '${pos}px', ''); |
| 343 if (_cachedSize[cssSize] != size) { | 344 if (_cachedSize[cssSize] != size) { |
| 344 _cachedSize[cssSize] = size; | 345 _cachedSize[cssSize] = size; |
| 345 style.setProperty(cssSize, '${size}px', ''); | 346 style.setProperty(cssSize, '${size}px', ''); |
| 346 } | 347 } |
| 347 if (element.parent == null) { | 348 if (element.parent == null) { |
| 348 _frame.nodes.add(element); | 349 _frame.nodes.add(element); |
| 349 } | 350 } |
| 350 } | 351 } |
| 351 } | 352 } |
| OLD | NEW |