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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 12524011: Fix GetPartSize to account for customized themes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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
« 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: ui/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 5b43b29681720e4b11d667e874e7acbdfe73db03..356dfc0e0cb8d859373af8bf052b644b16d409a5 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -233,7 +233,23 @@ gfx::Size NativeThemeWin::GetPartSize(Part part,
if (!size.IsEmpty())
return size;
}
+
+ // The GetThemePartSize call below returns the default size without
+ // accounting for user customization (crbug/218291).
SIZE size;
+ switch (part) {
+ case kScrollbarDownArrow:
+ case kScrollbarLeftArrow:
+ case kScrollbarRightArrow:
+ case kScrollbarUpArrow:
+ case kScrollbarHorizontalThumb:
+ case kScrollbarVerticalThumb:
+ case kScrollbarHorizontalTrack:
+ case kScrollbarVerticalTrack:
+ size.cx = size.cy = ui::win::GetSystemMetricsInDIP(SM_CXVSCROLL);
+ return gfx::Size(size.cx, size.cy);
+ }
+
int part_id = GetWindowsPart(part, state, extra);
int state_id = GetWindowsState(part, state, extra);
@@ -254,17 +270,6 @@ gfx::Size NativeThemeWin::GetPartSize(Part part,
size.cx = 13;
size.cy = 13;
break;
- case kScrollbarDownArrow:
- case kScrollbarLeftArrow:
- case kScrollbarRightArrow:
- case kScrollbarUpArrow:
- case kScrollbarHorizontalThumb:
- case kScrollbarVerticalThumb:
- case kScrollbarHorizontalTrack:
- case kScrollbarVerticalTrack:
- size.cx = size.cy = GetSystemMetrics(SM_CXVSCROLL) /
- ui::win::GetDeviceScaleFactor();
- break;
default:
size.cx = 0;
size.cy = 0;
« 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