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

Unified Diff: ui/native_theme/native_theme_aura.cc

Issue 2763373002: Overlay scrollbars flush with window edge (Closed)
Patch Set: evan and bokan comments addressed Created 3 years, 9 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
Index: ui/native_theme/native_theme_aura.cc
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc
index 76283878e06a13f8cb77b8adbc90799dfea2aa28..688f821d888f5ef59a6e46b0ca30403ffb118284 100644
--- a/ui/native_theme/native_theme_aura.cc
+++ b/ui/native_theme/native_theme_aura.cc
@@ -17,6 +17,7 @@
#include "ui/gfx/animation/tween.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
@@ -251,7 +252,16 @@ void NativeThemeAura::PaintScrollbarThumb(
canvas->drawRect(gfx::RectFToSkRect(stroke_rect), flags);
// Inset the all the edges edges so we fill-in the stroke below.
- thumb_rect.Inset(kStrokeWidth, kStrokeWidth);
+ // The edge to which the scrollbar is attached shouldn't have a border.
+ // For left vertical scrollbar, we will horizontally flip the canvas in
+ // ScrollbarThemeOverlay::paintThumb.
+ gfx::Insets insets(kStrokeWidth);
+ if (part == NativeTheme::kScrollbarHorizontalThumb)
+ insets -= gfx::Insets(0, 0, kStrokeWidth, 0);
+ else
+ insets -= gfx::Insets(0, 0, 0, kStrokeWidth);
+
+ thumb_rect.Inset(insets);
} else {
switch (state) {
case NativeTheme::kDisabled:

Powered by Google App Engine
This is Rietveld 408576698