| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 m_elasticOverscroll = elasticOverscroll; | 166 m_elasticOverscroll = elasticOverscroll; |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Use setNeedsPaintInvalidation to cause the scrollbar (or parts thereof) | 169 // Use setNeedsPaintInvalidation to cause the scrollbar (or parts thereof) |
| 170 // to repaint. | 170 // to repaint. |
| 171 bool trackNeedsRepaint() const { return m_trackNeedsRepaint; } | 171 bool trackNeedsRepaint() const { return m_trackNeedsRepaint; } |
| 172 void clearTrackNeedsRepaint() { m_trackNeedsRepaint = false; } | 172 void clearTrackNeedsRepaint() { m_trackNeedsRepaint = false; } |
| 173 bool thumbNeedsRepaint() const { return m_thumbNeedsRepaint; } | 173 bool thumbNeedsRepaint() const { return m_thumbNeedsRepaint; } |
| 174 void clearThumbNeedsRepaint() { m_thumbNeedsRepaint = false; } | 174 void clearThumbNeedsRepaint() { m_thumbNeedsRepaint = false; } |
| 175 | 175 |
| 176 bool overlapsResizer() const { return m_overlapsResizer; } | |
| 177 void setOverlapsResizer(bool overlapsResizer) { | |
| 178 m_overlapsResizer = overlapsResizer; | |
| 179 } | |
| 180 | |
| 181 // DisplayItemClient methods. | 176 // DisplayItemClient methods. |
| 182 String debugName() const final { | 177 String debugName() const final { |
| 183 return m_orientation == HorizontalScrollbar ? "HorizontalScrollbar" | 178 return m_orientation == HorizontalScrollbar ? "HorizontalScrollbar" |
| 184 : "VerticalScrollbar"; | 179 : "VerticalScrollbar"; |
| 185 } | 180 } |
| 186 LayoutRect visualRect() const override; | 181 LayoutRect visualRect() const override; |
| 187 | 182 |
| 188 // Marks the scrollbar as needing to be redrawn. | 183 // Marks the scrollbar as needing to be redrawn. |
| 189 // | 184 // |
| 190 // If invalid parts are provided, then those parts will also be repainted. | 185 // If invalid parts are provided, then those parts will also be repainted. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 ScrollbarPart m_hoveredPart; | 227 ScrollbarPart m_hoveredPart; |
| 233 ScrollbarPart m_pressedPart; | 228 ScrollbarPart m_pressedPart; |
| 234 int m_pressedPos; | 229 int m_pressedPos; |
| 235 float m_scrollPos; | 230 float m_scrollPos; |
| 236 bool m_draggingDocument; | 231 bool m_draggingDocument; |
| 237 int m_documentDragPos; | 232 int m_documentDragPos; |
| 238 | 233 |
| 239 bool m_enabled; | 234 bool m_enabled; |
| 240 | 235 |
| 241 Timer<Scrollbar> m_scrollTimer; | 236 Timer<Scrollbar> m_scrollTimer; |
| 242 bool m_overlapsResizer; | |
| 243 | 237 |
| 244 float m_elasticOverscroll; | 238 float m_elasticOverscroll; |
| 245 | 239 |
| 246 private: | 240 private: |
| 247 bool isScrollbar() const override { return true; } | 241 bool isScrollbar() const override { return true; } |
| 248 | 242 |
| 249 void invalidate() override { setNeedsPaintInvalidation(AllParts); } | 243 void invalidate() override { setNeedsPaintInvalidation(AllParts); } |
| 250 void invalidateRect(const IntRect&) override { | 244 void invalidateRect(const IntRect&) override { |
| 251 setNeedsPaintInvalidation(AllParts); | 245 setNeedsPaintInvalidation(AllParts); |
| 252 } | 246 } |
| 253 | 247 |
| 254 float scrollableAreaCurrentPos() const; | 248 float scrollableAreaCurrentPos() const; |
| 255 float scrollableAreaTargetPos() const; | 249 float scrollableAreaTargetPos() const; |
| 256 bool thumbWillBeUnderMouse() const; | 250 bool thumbWillBeUnderMouse() const; |
| 257 | 251 |
| 258 bool m_trackNeedsRepaint; | 252 bool m_trackNeedsRepaint; |
| 259 bool m_thumbNeedsRepaint; | 253 bool m_thumbNeedsRepaint; |
| 260 }; | 254 }; |
| 261 | 255 |
| 262 DEFINE_TYPE_CASTS(Scrollbar, | 256 DEFINE_TYPE_CASTS(Scrollbar, |
| 263 Widget, | 257 Widget, |
| 264 widget, | 258 widget, |
| 265 widget->isScrollbar(), | 259 widget->isScrollbar(), |
| 266 widget.isScrollbar()); | 260 widget.isScrollbar()); |
| 267 | 261 |
| 268 } // namespace blink | 262 } // namespace blink |
| 269 | 263 |
| 270 #endif // Scrollbar_h | 264 #endif // Scrollbar_h |
| OLD | NEW |