示例#1
0
QRect QWebFrameAdapter::scrollBarGeometry(Qt::Orientation orientation) const
{
    Scrollbar* sb;
    sb = (orientation == Qt::Horizontal) ? horizontalScrollBar() : verticalScrollBar();
    if (sb)
        return sb->frameRect();
    return QRect();
}
void FramePainter::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect)
{
    bool needsBackground = bar.isCustomScrollbar() && frameView().frame().isMainFrame();
    if (needsBackground) {
        IntRect toFill = bar.frameRect();
        toFill.intersect(rect);
        context.fillRect(toFill, frameView().baseBackgroundColor());
    }

    bar.paint(context, CullRect(rect));
}
IntRect ScrollbarThemeSafari::trackRect(Scrollbar& scrollbar, bool painting)
{
    if (painting || !hasButtons(scrollbar))
        return scrollbar.frameRect();
    
    IntRect result;
    int thickness = scrollbarThickness(scrollbar.controlSize());
    if (scrollbar.orientation() == HorizontalScrollbar) 
        return IntRect(scrollbar.x() + cButtonLength[scrollbar.controlSize()], scrollbar.y(), scrollbar.width() - 2 * cButtonLength[scrollbar.controlSize()], thickness);
    return IntRect(scrollbar.x(), scrollbar.y() + cButtonLength[scrollbar.controlSize()], thickness, scrollbar.height() - 2 * cButtonLength[scrollbar.controlSize()]);
}
示例#4
0
IntRect ScrollbarThemeMock::trackRect(Scrollbar& scrollbar, bool)
{
    return scrollbar.frameRect();
}