diff options
author | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 09:31:44 +0000 |
---|---|---|
committer | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 09:31:44 +0000 |
commit | 543a80e68d6c9ce5362d0fc016b325d7307ba309 (patch) | |
tree | 8769d72f2dc0692787d07e550d897db5a0606940 /ui/native_theme | |
parent | 13fa0f79a16e184f41f24f7cbbe64859880024cc (diff) | |
download | chromium_src-543a80e68d6c9ce5362d0fc016b325d7307ba309.zip chromium_src-543a80e68d6c9ce5362d0fc016b325d7307ba309.tar.gz chromium_src-543a80e68d6c9ce5362d0fc016b325d7307ba309.tar.bz2 |
Fix GetPartSize to account for customized themes.
BUG=218291
Review URL: https://chromiumcodereview.appspot.com/12524011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/native_theme')
-rw-r--r-- | ui/native_theme/native_theme_win.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc index 5b43b29..356dfc0 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; |