Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1441)

Unified Diff: Source/platform/scroll/ScrollView.cpp

Issue 383603002: Update scrollbar layer opacity when scrollbar theme changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectations Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollView.cpp
diff --git a/Source/platform/scroll/ScrollView.cpp b/Source/platform/scroll/ScrollView.cpp
index 56bc53593a29dea66d28b8b11cab74951a4a420a..1e0aa28329bec7defe878d5305d37ecbf6e0065a 100644
--- a/Source/platform/scroll/ScrollView.cpp
+++ b/Source/platform/scroll/ScrollView.cpp
@@ -240,6 +240,18 @@ IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint& scrollPoint
return newScrollPosition;
}
+void ScrollView::adjustScrollbarOpacity()
+{
+ if (m_horizontalScrollbar && layerForHorizontalScrollbar()) {
+ bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar();
+ layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar);
+ }
+ if (m_verticalScrollbar && layerForVerticalScrollbar()) {
+ bool isOpaqueScrollbar = !m_verticalScrollbar->isOverlayScrollbar();
+ layerForVerticalScrollbar()->setContentsOpaque(isOpaqueScrollbar);
+ }
+}
+
int ScrollView::scrollSize(ScrollbarOrientation orientation) const
{
Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
@@ -812,6 +824,7 @@ bool ScrollView::isScrollCornerVisible() const
void ScrollView::scrollbarStyleChanged()
{
+ adjustScrollbarOpacity();
contentsResized();
updateScrollbars(scrollOffset());
positionScrollbarLayers();
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698