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

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 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
« no previous file with comments | « ui/views/examples/button_example.cc ('k') | ui/views/style/mac/dialog_button_border_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..805f97d2751c6aad18effdb7c714467dbef9548d 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::ButtonBackgroundType type =
+ NativeThemeMac::ButtonBackgroundType::HIGHLIGHTED;
if (!combobox->enabled())
- state = ui::NativeTheme::kDisabled;
+ type = NativeThemeMac::ButtonBackgroundType::DISABLED;
SkPaint paint;
paint.setShader(
- ui::NativeThemeMac::GetButtonBackgroundShader(
- state,
- bounds.height()));
+ NativeThemeMac::GetButtonBackgroundShader(type, bounds.height()));
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
« no previous file with comments | « ui/views/examples/button_example.cc ('k') | ui/views/style/mac/dialog_button_border_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698