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

Unified Diff: ui/views/style/platform_style_mac.mm

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
« ui/views/style/platform_style.h ('K') | « ui/views/style/platform_style_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/style/platform_style_mac.mm
diff --git a/ui/views/style/platform_style_mac.mm b/ui/views/style/platform_style_mac.mm
index cbe9be51ce15d0094f4546ee536b1cf0bf603def..878071e032743132ef04d82eb71f2f96f8f9ce2c 100644
--- a/ui/views/style/platform_style_mac.mm
+++ b/ui/views/style/platform_style_mac.mm
@@ -17,6 +17,10 @@
namespace views {
+const int PlatformStyle::kMinLabelButtonWidth = 32;
+const int PlatformStyle::kMinLabelButtonHeight = 30;
+const bool PlatformStyle::kDefaultLabelButtonHasBoldFont = false;
+
// static
gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled,
Combobox::Style style) {
@@ -56,4 +60,28 @@ scoped_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) {
return make_scoped_ptr(new CocoaScrollBar(is_horizontal));
}
+// static
+SkColor PlatformStyle::TextColorForButton(
+ const ButtonColorByState& color_by_state,
+ const LabelButton& button) {
+ Button::ButtonState state = button.state();
+ if (button.style() == Button::STYLE_BUTTON &&
+ DialogButtonBorderMac::ShowsDefault(button)) {
+ // For convenience, we currently assume Mac wants the color corresponding to
+ // the pressed state for default buttons.
+ state = Button::STATE_PRESSED;
+ }
+ return color_by_state[state];
+}
+
+// static
+void PlatformStyle::ApplyLabelButtonTextStyle(
+ views::Label* label,
+ ButtonColorByState* color_by_state) {
+ const ui::NativeTheme* theme = label->GetNativeTheme();
+ ButtonColorByState& colors = *color_by_state;
+ colors[Button::STATE_PRESSED] =
+ theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor);
+}
+
} // namespace views
« ui/views/style/platform_style.h ('K') | « ui/views/style/platform_style_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698