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

Unified Diff: ui/message_center/views/notification_view_md.cc

Issue 2971123002: Adjust action button styling in MD notification. (Closed)
Patch Set: Add comment. Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view_md.cc
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc
index 7a86c5bc7e9e7e2414f81900eaea6e48f5110a06..5426c6f889632a8d1da6236046340d5950f5de7a 100644
--- a/ui/message_center/views/notification_view_md.cc
+++ b/ui/message_center/views/notification_view_md.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include "base/i18n/case_conversion.h"
#include "base/strings/string_util.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/l10n/l10n_util.h"
@@ -221,12 +222,15 @@ void CompactTitleMessageView::OnPaint(gfx::Canvas* canvas) {
// This class is needed in addition to LabelButton mainly becuase we want to set
// visible_opacity of InkDropHighlight.
+// This button capitalizes the given label string.
class NotificationButtonMD : public views::LabelButton {
public:
NotificationButtonMD(views::ButtonListener* listener,
const base::string16& text);
~NotificationButtonMD() override;
+ void SetText(const base::string16& text) override;
+
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
const override;
@@ -236,7 +240,10 @@ class NotificationButtonMD : public views::LabelButton {
NotificationButtonMD::NotificationButtonMD(views::ButtonListener* listener,
const base::string16& text)
- : views::LabelButton(listener, text, views::style::CONTEXT_BUTTON_MD) {
+ : views::LabelButton(listener,
+ base::i18n::ToUpper(text),
+ views::style::CONTEXT_BUTTON_MD) {
+ SetHorizontalAlignment(gfx::ALIGN_CENTER);
SetInkDropMode(views::LabelButton::InkDropMode::ON);
set_has_ink_drop_action_on_click(true);
set_ink_drop_base_color(kActionButtonInkDropBaseColor);
@@ -249,6 +256,10 @@ NotificationButtonMD::NotificationButtonMD(views::ButtonListener* listener,
NotificationButtonMD::~NotificationButtonMD() = default;
+void NotificationButtonMD::SetText(const base::string16& text) {
+ views::LabelButton::SetText(base::i18n::ToUpper(text));
+}
+
std::unique_ptr<views::InkDropHighlight>
NotificationButtonMD::CreateInkDropHighlight() const {
std::unique_ptr<views::InkDropHighlight> highlight =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698