Lines Matching refs:scrollbar

71 static WebKit::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
73 if (!scrollbar->enabled())
75 if (!scrollbar->isScrollableAreaActive())
77 if (scrollbar->pressedPart() == ThumbPart)
87 bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
91 scrollbar->getTickmarks(tickmarks);
95 trackInfo.kind = scrollbar->controlSize() == RegularScrollbar ? kThemeMediumScrollBar : kThemeSmallScrollBar;
96 trackInfo.bounds = scrollbar->frameRect();
98 trackInfo.max = scrollbar->maximum();
99 trackInfo.value = scrollbar->currentPos();
100 trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
102 if (scrollbar->orientation() == HorizontalScrollbar)
105 if (!scrollbar->enabled())
108 trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
110 if (!hasButtons(scrollbar))
112 trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
117 // The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation.
122 trackInfo.bounds = IntRect(IntPoint(), scrollbar->frameRect().size());
124 IntRect bufferRect(scrollbar->frameRect());
126 bufferRect.move(-scrollbar->frameRect().x(), -scrollbar->frameRect().y());
140 IntRect tickmarkTrackRect = trackRect(scrollbar, false);
150 paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
152 if (hasThumb(scrollbar)) {
154 scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? WebKit::WebThemeEngine::ScrollbarOrientationHorizontal : WebKit::WebThemeEngine::ScrollbarOrientationVertical;
155 scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? WebKit::WebThemeEngine::ScrollbarParentScrollView : WebKit::WebThemeEngine::ScrollbarParentRenderLayer;
156 scrollbarInfo.maxValue = scrollbar->maximum();
157 scrollbarInfo.currentValue = scrollbar->currentPos();
158 scrollbarInfo.visibleSize = scrollbar->visibleSize();
159 scrollbarInfo.totalSize = scrollbar->totalSize();
164 scrollbarStateToThemeState(scrollbar),
165 scrollbar->controlSize() == RegularScrollbar ? WebKit::WebThemeEngine::SizeRegular : WebKit::WebThemeEngine::SizeSmall,
166 WebKit::WebRect(scrollbar->frameRect()),
171 context->drawImageBuffer(imageBuffer.get(), scrollbar->frameRect().location());
186 bool ScrollbarThemeMacNonOverlayAPI::hasButtons(ScrollbarThemeClient* scrollbar)
188 return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone
189 && (scrollbar->orientation() == HorizontalScrollbar
190 ? scrollbar->width()
191 : scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
194 bool ScrollbarThemeMacNonOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
196 int minLengthForThumb = 2 * cButtonInset[scrollbar->controlSize()] + cThumbMinLength[scrollbar->controlSize()] + 1;
197 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
198 scrollbar->width() :
199 scrollbar->height()) >= minLengthForThumb;
220 IntRect ScrollbarThemeMacNonOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
230 int thickness = scrollbarThickness(scrollbar->controlSize());
233 if (scrollbar->orientation() == HorizontalScrollbar)
234 result = IntRect(scrollbar->x(), scrollbar->y(), cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0), thickness);
236 result = IntRect(scrollbar->x(), scrollbar->y(), thickness, cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0));
241 if (scrollbar->orientation() == HorizontalScrollbar) {
242 int start = part == BackButtonStartPart ? scrollbar->x() : scrollbar->x() + scrollbar->width() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
243 result = IntRect(start, scrollbar->y(), cButtonLength[scrollbar->controlSize()], thickness);
245 int start = part == BackButtonStartPart ? scrollbar->y() : scrollbar->y() + scrollbar->height() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
246 result = IntRect(scrollbar->x(), start, thickness, cButtonLength[scrollbar->controlSize()]);
250 return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == BackButtonStartPart);
254 IntRect ScrollbarThemeMacNonOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
264 int thickness = scrollbarThickness(scrollbar->controlSize());
265 int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
266 int buttonLength = cButtonLength[scrollbar->controlSize()];
270 if (scrollbar->orientation() == HorizontalScrollbar) {
271 result = IntRect(scrollbar->x() + scrollbar->width() - outerButtonLength, scrollbar->y(), outerButtonLength, thickness);
275 result = IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - outerButtonLength, thickness, outerButtonLength);
282 if (scrollbar->orientation() == HorizontalScrollbar) {
283 int start = part == ForwardButtonEndPart ? scrollbar->x() + scrollbar->width() - buttonLength : scrollbar->x() + outerButtonLength;
284 result = IntRect(start, scrollbar->y(), buttonLength, thickness);
286 int start = part == ForwardButtonEndPart ? scrollbar->y() + scrollbar->height() - buttonLength : scrollbar->y() + outerButtonLength;
287 result = IntRect(scrollbar->x(), start, thickness, buttonLength);
290 return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == ForwardButtonStartPart);
294 IntRect ScrollbarThemeMacNonOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
296 if (painting || !hasButtons(scrollbar))
297 return scrollbar->frameRect();
300 int thickness = scrollbarThickness(scrollbar->controlSize());
303 int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
304 int buttonLength = cButtonLength[scrollbar->controlSize()];
326 if (scrollbar->orientation() == HorizontalScrollbar)
327 return IntRect(scrollbar->x() + startWidth, scrollbar->y(), scrollbar->width() - totalWidth, thickness);
328 return IntRect(scrollbar->x(), scrollbar->y() + startWidth, thickness, scrollbar->height() - totalWidth);
331 int ScrollbarThemeMacNonOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
333 return cThumbMinLength[scrollbar->controlSize()];