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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm

Issue 2512033002: RTL overlay scrollbar on Mac is left aligned. (Closed)
Patch Set: Layouttest draft deleted. Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm
index 7b8c08cb22356b66ae2de29293c82575301d1fd0..88c92c377cb7d67cb53f5accb11b736f57d456b0 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm
@@ -293,7 +293,16 @@ void ScrollbarThemeMac::paintThumb(GraphicsContext& context,
ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
[scrollbarPainter setEnabled:scrollbar.enabled()];
- [scrollbarPainter setBoundsSize:NSSizeFromCGSize(rect.size())];
+ // drawKnob aligns the thumb to right side of the draw rect.
+ // If the vertical overlay scrollbar is on the left, use trackWidth instead
+ // of scrollbar width, to avoid the gap on the left side of the thumb.
jbroman 2016/11/22 23:21:54 One question here: what happens if the Mac system
sahel 2016/11/23 18:22:07 I set the OS language to Farsi. The window scrollb
+ IntRect drawRect = IntRect(rect);
+ if (usesOverlayScrollbars() && scrollbar.isLeftSideVerticalScrollbar()) {
+ int thumbWidth = [scrollbarPainter trackWidth];
+ drawRect.setWidth(thumbWidth);
+ }
+ [scrollbarPainter setBoundsSize:NSSizeFromCGSize(drawRect.size())];
+
[scrollbarPainter setDoubleValue:0];
[scrollbarPainter setKnobProportion:1];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698