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

Unified Diff: ash/common/system/tray/tray_item_more.cc

Issue 2244003002: Materialized font style for TrayItemMore type system tray rows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-ordered static function in Label. Created 4 years, 3 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 | « ash/common/system/tray/tray_item_more.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_item_more.cc
diff --git a/ash/common/system/tray/tray_item_more.cc b/ash/common/system/tray/tray_item_more.cc
index 62f37cdd4a3b67b761e43a302d09d98c9e26dd84..003026c18cefcaab66dc43c752f8c2240b9e5c4a 100644
--- a/ash/common/system/tray/tray_item_more.cc
+++ b/ash/common/system/tray/tray_item_more.cc
@@ -8,6 +8,7 @@
#include "ash/common/system/tray/fixed_sized_image_view.h"
#include "ash/common/system/tray/system_tray_item.h"
#include "ash/common/system/tray/tray_constants.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "grit/ash_resources.h"
#include "ui/accessibility/ax_view_state.h"
@@ -69,6 +70,15 @@ void TrayItemMore::SetAccessibleName(const base::string16& name) {
accessible_name_ = name;
}
+void TrayItemMore::UpdateStyle() {
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ return;
+
+ TrayPopupItemStyle style(GetNativeTheme(),
+ TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ style.SetupLabel(label_);
+}
+
bool TrayItemMore::PerformAction(const ui::Event& event) {
if (!show_more_)
return false;
@@ -106,4 +116,17 @@ void TrayItemMore::GetAccessibleState(ui::AXViewState* state) {
state->name = accessible_name_;
}
+void TrayItemMore::ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) {
+ ActionableView::ViewHierarchyChanged(details);
+
+ if (details.is_add && details.child == this)
+ UpdateStyle();
+}
+
+void TrayItemMore::OnNativeThemeChanged(const ui::NativeTheme* theme) {
+ ActionableView::OnNativeThemeChanged(theme);
+ UpdateStyle();
+}
+
} // namespace ash
« no previous file with comments | « ash/common/system/tray/tray_item_more.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698