Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm |
index eed11375dcfe60a43303a211b821ba03238554b6..91d5131b11a9dee30de83fbc5ad6940b13562e22 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm |
@@ -133,7 +133,7 @@ void ScrollbarThemeMacOverlayAPI::setNewPainterForScrollbar(ScrollbarThemeClient |
updateScrollbarOverlayStyle(scrollbar); |
} |
-ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(const ScrollbarThemeClient* scrollbar) |
+ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(const ScrollbarThemeClient* scrollbar) const |
{ |
return [scrollbarPainterMap()->get(const_cast<ScrollbarThemeClient*>(scrollbar)).get() painter]; |
} |
@@ -154,7 +154,6 @@ void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context, |
ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar); |
[scrollbarPainter setEnabled:scrollbar->enabled()]; |
[scrollbarPainter setBoundsSize: NSSizeFromCGSize(frameRect.size)]; |
- |
NSRect trackRect = NSMakeRect(0, 0, frameRect.size.width, frameRect.size.height); |
[scrollbarPainter drawKnobSlotInRect:trackRect highlight:NO]; |
} |
@@ -179,12 +178,17 @@ void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, const Scr |
[scrollbarPainter setBoundsSize:NSSizeFromCGSize(rect.size())]; |
[scrollbarPainter setDoubleValue:0]; |
[scrollbarPainter setKnobProportion:1]; |
+ |
+ CGFloat oldKnobAlpha = [scrollbarPainter knobAlpha]; |
+ [scrollbarPainter setKnobAlpha:1]; |
+ |
if (scrollbar->enabled()) |
[scrollbarPainter drawKnob]; |
// If this state is not set, then moving the cursor over the scrollbar area will only cause the |
// scrollbar to engorge when moved over the top of the scrollbar area. |
[scrollbarPainter setBoundsSize: NSSizeFromCGSize(scrollbar->frameRect().size())]; |
+ [scrollbarPainter setKnobAlpha:oldKnobAlpha]; |
} |
int ScrollbarThemeMacOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize) |
@@ -266,5 +270,10 @@ void ScrollbarThemeMacOverlayAPI::updateEnabledState(const ScrollbarThemeClient* |
[painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()]; |
} |
+float ScrollbarThemeMacOverlayAPI::thumbOpacity(const ScrollbarThemeClient* scrollbar) const { |
+ ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar); |
+ return [scrollbarPainter knobAlpha]; |
+} |
+ |
} // namespace blink |