OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Apple 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, tr
ackRect(scrollbar)); | 284 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, tr
ackRect(scrollbar)); |
285 return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackR
ect.x() - scrollbar->x() : constrainedTrackRect.y() - scrollbar->y(); | 285 return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackR
ect.x() - scrollbar->x() : constrainedTrackRect.y() - scrollbar->y(); |
286 } | 286 } |
287 | 287 |
288 int ScrollbarTheme::trackLength(ScrollbarThemeClient* scrollbar) | 288 int ScrollbarTheme::trackLength(ScrollbarThemeClient* scrollbar) |
289 { | 289 { |
290 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, tr
ackRect(scrollbar)); | 290 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, tr
ackRect(scrollbar)); |
291 return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackR
ect.width() : constrainedTrackRect.height(); | 291 return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackR
ect.width() : constrainedTrackRect.height(); |
292 } | 292 } |
293 | 293 |
294 void ScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext* context, co
nst IntRect& cornerRect) | 294 void ScrollbarTheme::paintScrollCorner(GraphicsContext* context, const IntRect&
cornerRect) |
295 { | 295 { |
296 context->fillRect(cornerRect, Color::white); | 296 context->fillRect(cornerRect, Color::white); |
297 } | 297 } |
298 | 298 |
299 IntRect ScrollbarTheme::thumbRect(ScrollbarThemeClient* scrollbar) | 299 IntRect ScrollbarTheme::thumbRect(ScrollbarThemeClient* scrollbar) |
300 { | 300 { |
301 if (!hasThumb(scrollbar)) | 301 if (!hasThumb(scrollbar)) |
302 return IntRect(); | 302 return IntRect(); |
303 | 303 |
304 IntRect track = trackRect(scrollbar); | 304 IntRect track = trackRect(scrollbar); |
305 IntRect startTrackRect; | 305 IntRect startTrackRect; |
306 IntRect thumbRect; | 306 IntRect thumbRect; |
307 IntRect endTrackRect; | 307 IntRect endTrackRect; |
308 splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect); | 308 splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect); |
309 | 309 |
310 return thumbRect; | 310 return thumbRect; |
311 } | 311 } |
312 | 312 |
313 int ScrollbarTheme::thumbThickness(ScrollbarThemeClient* scrollbar) | 313 int ScrollbarTheme::thumbThickness(ScrollbarThemeClient* scrollbar) |
314 { | 314 { |
315 IntRect track = trackRect(scrollbar); | 315 IntRect track = trackRect(scrollbar); |
316 return scrollbar->orientation() == HorizontalScrollbar ? track.height() : tr
ack.width(); | 316 return scrollbar->orientation() == HorizontalScrollbar ? track.height() : tr
ack.width(); |
317 } | 317 } |
318 | 318 |
319 void ScrollbarTheme::paintOverhangBackground(ScrollView*, GraphicsContext* conte
xt, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect,
const IntRect& dirtyRect) | 319 void ScrollbarTheme::paintOverhangBackground(GraphicsContext* context, const Int
Rect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect
& dirtyRect) |
320 { | 320 { |
321 context->setFillColor(Color::white); | 321 context->setFillColor(Color::white); |
322 if (!horizontalOverhangRect.isEmpty()) | 322 if (!horizontalOverhangRect.isEmpty()) |
323 context->fillRect(intersection(horizontalOverhangRect, dirtyRect)); | 323 context->fillRect(intersection(horizontalOverhangRect, dirtyRect)); |
324 if (!verticalOverhangRect.isEmpty()) | 324 if (!verticalOverhangRect.isEmpty()) |
325 context->fillRect(intersection(verticalOverhangRect, dirtyRect)); | 325 context->fillRect(intersection(verticalOverhangRect, dirtyRect)); |
326 } | 326 } |
327 | 327 |
328 } | 328 } |
OLD | NEW |