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

Unified Diff: ui/views/style/platform_style.h

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/style/mac/dialog_button_border_mac.cc ('k') | ui/views/style/platform_style.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/style/platform_style.h
diff --git a/ui/views/style/platform_style.h b/ui/views/style/platform_style.h
index 3103691642a72c4a6d2b8444a942123a63bac170..36bc1fcfd28c6a321b40754d2eff5996013ce202 100644
--- a/ui/views/style/platform_style.h
+++ b/ui/views/style/platform_style.h
@@ -9,18 +9,30 @@
#include "base/memory/scoped_ptr.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/combobox/combobox.h"
+#include "ui/views/views_export.h"
namespace views {
class Border;
class FocusableBorder;
+class Label;
class LabelButton;
class LabelButtonBorder;
class ScrollBar;
// Cross-platform API for providing platform-specific styling for toolkit-views.
-class PlatformStyle {
+class VIEWS_EXPORT PlatformStyle {
public:
+ // Type used by LabelButton to map button states to text colors.
+ using ButtonColorByState = SkColor[Button::STATE_COUNT];
+
+ // Minimum size for platform-styled buttons (Button::STYLE_BUTTON).
+ static const int kMinLabelButtonWidth;
+ static const int kMinLabelButtonHeight;
+
+ // Whether dialog-default buttons are given a bold font style.
+ static const bool kDefaultLabelButtonHasBoldFont;
+
// Creates an ImageSkia containing the image to use for the combobox arrow.
// The |is_enabled| argument is true if the control the arrow is for is
// enabled, and false if the control is disabled. The |style| argument is the
@@ -39,12 +51,22 @@ class PlatformStyle {
static scoped_ptr<LabelButtonBorder> CreateLabelButtonBorder(
Button::ButtonStyle style);
- // Applies the current system theme to the default border created by |button|.
- static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button);
-
// Creates the default scrollbar for the given orientation.
static scoped_ptr<ScrollBar> CreateScrollBar(bool is_horizontal);
+ // Returns the current text color for the current button state.
+ static SkColor TextColorForButton(const ButtonColorByState& color_by_state,
+ const LabelButton& button);
+
+ // Applies platform styles to |label| and fills |color_by_state| with the text
+ // colors for normal, pressed, hovered, and disabled states, if the colors for
+ // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme.
+ static void ApplyLabelButtonTextStyle(Label* label,
+ ButtonColorByState* color_by_state);
+
+ // Applies the current system theme to the default border created by |button|.
+ static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle);
};
« no previous file with comments | « ui/views/style/mac/dialog_button_border_mac.cc ('k') | ui/views/style/platform_style.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698