Home | History | Annotate | Download | only in scroll

Lines Matching refs:scrollbar

73 static blink::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
75 if (!scrollbar->enabled())
77 if (!scrollbar->isScrollableAreaActive())
79 if (scrollbar->pressedPart() == ThumbPart)
89 bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
95 scrollbar->getTickmarks(tickmarks);
99 trackInfo.kind = scrollbar->controlSize() == RegularScrollbar ? kThemeMediumScrollBar : kThemeSmallScrollBar;
100 trackInfo.bounds = scrollbar->frameRect();
102 trackInfo.max = scrollbar->maximum();
103 trackInfo.value = scrollbar->currentPos();
104 trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
106 if (scrollbar->orientation() == HorizontalScrollbar)
109 if (!scrollbar->enabled())
112 trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
114 if (!hasButtons(scrollbar))
116 trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
121 // The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation.
126 trackInfo.bounds = IntRect(IntPoint(), scrollbar->frameRect().size());
128 IntRect bufferRect(scrollbar->frameRect());
130 bufferRect.move(-scrollbar->frameRect().x(), -scrollbar->frameRect().y());
144 IntRect tickmarkTrackRect = trackRect(scrollbar, false);
154 paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
156 if (hasThumb(scrollbar)) {
158 scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::ScrollbarOrientationHorizontal : blink::WebThemeEngine::ScrollbarOrientationVertical;
159 scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? blink::WebThemeEngine::ScrollbarParentScrollView : blink::WebThemeEngine::ScrollbarParentRenderLayer;
160 scrollbarInfo.maxValue = scrollbar->maximum();
161 scrollbarInfo.currentValue = scrollbar->currentPos();
162 scrollbarInfo.visibleSize = scrollbar->visibleSize();
163 scrollbarInfo.totalSize = scrollbar->totalSize();
168 scrollbarStateToThemeState(scrollbar),
169 scrollbar->controlSize() == RegularScrollbar ? blink::WebThemeEngine::SizeRegular : blink::WebThemeEngine::SizeSmall,
170 blink::WebRect(scrollbar->frameRect()),
177 FloatRect(scrollbar->frameRect().location(), imageBuffer->size()));
193 bool ScrollbarThemeMacNonOverlayAPI::hasButtons(ScrollbarThemeClient* scrollbar)
195 return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone
196 && (scrollbar->orientation() == HorizontalScrollbar
197 ? scrollbar->width()
198 : scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
201 bool ScrollbarThemeMacNonOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
203 int minLengthForThumb = 2 * cButtonInset[scrollbar->controlSize()] + cThumbMinLength[scrollbar->controlSize()] + 1;
204 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
205 scrollbar->width() :
206 scrollbar->height()) >= minLengthForThumb;
227 IntRect ScrollbarThemeMacNonOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
237 int thickness = scrollbarThickness(scrollbar->controlSize());
240 if (scrollbar->orientation() == HorizontalScrollbar)
241 result = IntRect(scrollbar->x(), scrollbar->y(), cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0), thickness);
243 result = IntRect(scrollbar->x(), scrollbar->y(), thickness, cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0));
248 if (scrollbar->orientation() == HorizontalScrollbar) {
249 int start = part == BackButtonStartPart ? scrollbar->x() : scrollbar->x() + scrollbar->width() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
250 result = IntRect(start, scrollbar->y(), cButtonLength[scrollbar->controlSize()], thickness);
252 int start = part == BackButtonStartPart ? scrollbar->y() : scrollbar->y() + scrollbar->height() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
253 result = IntRect(scrollbar->x(), start, thickness, cButtonLength[scrollbar->controlSize()]);
257 return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == BackButtonStartPart);
261 IntRect ScrollbarThemeMacNonOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
271 int thickness = scrollbarThickness(scrollbar->controlSize());
272 int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
273 int buttonLength = cButtonLength[scrollbar->controlSize()];
277 if (scrollbar->orientation() == HorizontalScrollbar) {
278 result = IntRect(scrollbar->x() + scrollbar->width() - outerButtonLength, scrollbar->y(), outerButtonLength, thickness);
282 result = IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - outerButtonLength, thickness, outerButtonLength);
289 if (scrollbar->orientation() == HorizontalScrollbar) {
290 int start = part == ForwardButtonEndPart ? scrollbar->x() + scrollbar->width() - buttonLength : scrollbar->x() + outerButtonLength;
291 result = IntRect(start, scrollbar->y(), buttonLength, thickness);
293 int start = part == ForwardButtonEndPart ? scrollbar->y() + scrollbar->height() - buttonLength : scrollbar->y() + outerButtonLength;
294 result = IntRect(scrollbar->x(), start, thickness, buttonLength);
297 return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == ForwardButtonStartPart);
301 IntRect ScrollbarThemeMacNonOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
303 if (painting || !hasButtons(scrollbar))
304 return scrollbar->frameRect();
307 int thickness = scrollbarThickness(scrollbar->controlSize());
310 int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
311 int buttonLength = cButtonLength[scrollbar->controlSize()];
333 if (scrollbar->orientation() == HorizontalScrollbar)
334 return IntRect(scrollbar->x() + startWidth, scrollbar->y(), scrollbar->width() - totalWidth, thickness);
335 return IntRect(scrollbar->x(), scrollbar->y() + startWidth, thickness, scrollbar->height() - totalWidth);
338 int ScrollbarThemeMacNonOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
340 return cThumbMinLength[scrollbar->controlSize()];