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

Unified Diff: ui/views/style/mac/combobox_background_mac.cc

Issue 1569113002: MacViews: Style BUTTON_STYLE buttons using the "modern" UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments, desktop linux Created 4 years, 8 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/views/style/mac/combobox_background_mac.cc
diff --git a/ui/views/style/mac/combobox_background_mac.cc b/ui/views/style/mac/combobox_background_mac.cc
index 31997b15b781c824649b60f9cc7ae002ba5ee1e3..0e6eab06d4806b67338e234b056c547efaa944ff 100644
--- a/ui/views/style/mac/combobox_background_mac.cc
+++ b/ui/views/style/mac/combobox_background_mac.cc
@@ -11,6 +11,8 @@
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/view.h"
+using ui::NativeThemeMac;
+
namespace views {
ComboboxBackgroundMac::ComboboxBackgroundMac() {}
@@ -27,15 +29,17 @@ void ComboboxBackgroundMac::Paint(gfx::Canvas* canvas, View* view) const {
// paint outside the border.
bounds.Inset(bounds.width() - combobox->GetArrowButtonWidth(), 0.5, 0.5, 0.5);
- ui::NativeTheme::State state = ui::NativeTheme::kNormal;
+ // TODO(tapted): Check whether the Widget is active, and use the NORMAL
+ // BackgroundType if it is inactive. Handling this properly also requires the
+ // control to observe the Widget for activation changes and invalidate.
+ NativeThemeMac::BackgroundType type =
+ NativeThemeMac::BackgroundType::HIGHLIGHTED;
if (!combobox->enabled())
- state = ui::NativeTheme::kDisabled;
+ type = NativeThemeMac::BackgroundType::DISABLED;
SkPaint paint;
paint.setShader(
- ui::NativeThemeMac::GetButtonBackgroundShader(
- state,
- bounds.height()));
+ NativeThemeMac::GetButtonBackgroundShader(type, bounds.height()));
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);

Powered by Google App Engine
This is Rietveld 408576698