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

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2346893002: Share a common alpha value used for displaying disabled state in Harmony (Closed)
Patch Set: compiling is underrated Created 4 years, 3 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
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | ui/views/controls/focusable_border.cc » ('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/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 // slightly less than half full and come out a little lighter. 826 // slightly less than half full and come out a little lighter.
827 const SkScalar kEpsilon = 0.0001f; 827 const SkScalar kEpsilon = 0.0001f;
828 path.moveTo(x - kEpsilon, y); 828 path.moveTo(x - kEpsilon, y);
829 path.rLineTo(height, height); 829 path.rLineTo(height, height);
830 path.rLineTo(2 * kEpsilon, 0); 830 path.rLineTo(2 * kEpsilon, 0);
831 path.rLineTo(height, -height); 831 path.rLineTo(height, -height);
832 path.close(); 832 path.close();
833 SkPaint paint; 833 SkPaint paint;
834 SkColor arrow_color = GetNativeTheme()->GetSystemColor( 834 SkColor arrow_color = GetNativeTheme()->GetSystemColor(
835 ui::NativeTheme::kColorId_ButtonEnabledColor); 835 ui::NativeTheme::kColorId_ButtonEnabledColor);
836 // TODO(estade): share this disabled alpha value with other places that use
837 // it.
838 if (!enabled()) 836 if (!enabled())
839 arrow_color = SkColorSetA(arrow_color, 0x61); 837 arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha);
840 paint.setColor(arrow_color); 838 paint.setColor(arrow_color);
841 paint.setAntiAlias(true); 839 paint.setAntiAlias(true);
842 canvas->DrawPath(path, paint); 840 canvas->DrawPath(path, paint);
843 } else { 841 } else {
844 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); 842 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y());
845 } 843 }
846 } 844 }
847 845
848 void Combobox::PaintButtons(gfx::Canvas* canvas) { 846 void Combobox::PaintButtons(gfx::Canvas* canvas) {
849 DCHECK(style_ == STYLE_ACTION); 847 DCHECK(style_ == STYLE_ACTION);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 } 987 }
990 988
991 int Combobox::GetArrowContainerWidth() const { 989 int Combobox::GetArrowContainerWidth() const {
992 int padding = style_ == STYLE_NORMAL 990 int padding = style_ == STYLE_NORMAL
993 ? PlatformStyle::kComboboxNormalArrowPadding * 2 991 ? PlatformStyle::kComboboxNormalArrowPadding * 2
994 : kActionLeftPadding + kActionRightPadding; 992 : kActionLeftPadding + kActionRightPadding;
995 return ArrowSize().width() + padding; 993 return ArrowSize().width() + padding;
996 } 994 }
997 995
998 } // namespace views 996 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | ui/views/controls/focusable_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698