Ejemplo n.º 1
0
void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext& graphicsContext, Scrollbar& scrollbar, const IntRect& trackRect)
{
    if (!SafariThemeLibrary())
        return;
    NSControlSize size = scrollbar.controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
    ThemeControlState state = 0;
    if (scrollbar.isScrollableAreaActive())
        state |= ActiveState;
    if (hasButtons(scrollbar))
        state |= EnabledState;
    paintThemePart(scrollbar.orientation() == VerticalScrollbar ? VScrollTrackPart : HScrollTrackPart, graphicsContext.platformContext(), trackRect, size, state); 
}
Ejemplo n.º 2
0
void ScrollbarThemeSafari::paintButton(GraphicsContext& graphicsContext, Scrollbar& scrollbar, const IntRect& buttonRect, ScrollbarPart part)
{
    if (!SafariThemeLibrary())
        return;
    NSControlSize size = scrollbar.controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
    ThemeControlState state = 0;
    if (scrollbar.isScrollableAreaActive())
        state |= ActiveState;
    if (hasButtons(scrollbar))
        state |= EnabledState;
    if (scrollbar.pressedPart() == part)
        state |= PressedState;
    if (part == BackButtonStartPart)
        paintThemePart(scrollbar.orientation() == VerticalScrollbar ? ScrollUpArrowPart : ScrollLeftArrowPart, graphicsContext.platformContext(),
                       buttonRect, size, state);
    else if (part == ForwardButtonEndPart)
        paintThemePart(scrollbar.orientation() == VerticalScrollbar ? ScrollDownArrowPart : ScrollRightArrowPart, graphicsContext.platformContext(),
                       buttonRect, size, state);
}