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

Side by Side Diff: ui/native_theme/native_theme_base.cc

Issue 456473002: MacViews: Implement scrollbar theming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Draw corner view, refine painting. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/native_theme/native_theme_base.h ('k') | ui/native_theme/native_theme_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/native_theme/native_theme_base.h" 5 #include "ui/native_theme/native_theme_base.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 case kPushButton: 229 case kPushButton:
230 PaintButton(canvas, state, rect, extra.button); 230 PaintButton(canvas, state, rect, extra.button);
231 break; 231 break;
232 case kRadio: 232 case kRadio:
233 PaintRadio(canvas, state, rect, extra.button); 233 PaintRadio(canvas, state, rect, extra.button);
234 break; 234 break;
235 case kScrollbarDownArrow: 235 case kScrollbarDownArrow:
236 case kScrollbarUpArrow: 236 case kScrollbarUpArrow:
237 case kScrollbarLeftArrow: 237 case kScrollbarLeftArrow:
238 case kScrollbarRightArrow: 238 case kScrollbarRightArrow:
239 PaintArrowButton(canvas, rect, part, state); 239 if (scrollbar_button_length_ > 0)
240 PaintArrowButton(canvas, rect, part, state);
240 break; 241 break;
241 case kScrollbarHorizontalThumb: 242 case kScrollbarHorizontalThumb:
242 case kScrollbarVerticalThumb: 243 case kScrollbarVerticalThumb:
243 PaintScrollbarThumb(canvas, part, state, rect); 244 PaintScrollbarThumb(canvas, part, state, rect);
244 break; 245 break;
245 case kScrollbarHorizontalTrack: 246 case kScrollbarHorizontalTrack:
246 case kScrollbarVerticalTrack: 247 case kScrollbarVerticalTrack:
247 PaintScrollbarTrack(canvas, part, state, extra.scrollbar_track, rect); 248 PaintScrollbarTrack(canvas, part, state, extra.scrollbar_track, rect);
248 break; 249 break;
249 case kScrollbarHorizontalGripper: 250 case kScrollbarHorizontalGripper:
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1086 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
1086 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1087 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1087 1088
1088 if (hsv1[2] + hsv2[2] > 1.0) 1089 if (hsv1[2] + hsv2[2] > 1.0)
1089 diff = -diff; 1090 diff = -diff;
1090 1091
1091 return SaturateAndBrighten(hsv2, -0.2f, diff); 1092 return SaturateAndBrighten(hsv2, -0.2f, diff);
1092 } 1093 }
1093 1094
1094 } // namespace ui 1095 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme_base.h ('k') | ui/native_theme/native_theme_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698