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

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc

Issue 2592583002: UI changes on opt-in IME menu. (Closed)
Patch Set: sync Created 3 years, 11 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 | ash/common/system/tray/tray_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index fd98926e7c4597d5002344dea2123b814ab197c8..bce557d962b6701e476241d715a4386f2d3c59c9 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -131,6 +131,7 @@ class ImeTitleView : public views::View, public views::ButtonListener {
new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME));
title_label_->SetBorder(views::CreateEmptyBorder(
0, kMenuEdgeEffectivePadding, kTrayMenuBottomRowPadding, 0));
+ UpdateStyle();
title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(title_label_);
box_layout->SetFlexForView(title_label_, 1);
@@ -144,10 +145,19 @@ class ImeTitleView : public views::View, public views::ButtonListener {
}
}
+ void UpdateStyle() {
+ if (!GetNativeTheme() || !title_label_) {
+ return;
+ }
+
+ TrayPopupItemStyle style(GetNativeTheme(),
+ TrayPopupItemStyle::FontStyle::TITLE);
+ style.SetupLabel(title_label_);
+ }
+
// views::View:
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
- TrayPopupItemStyle style(theme, TrayPopupItemStyle::FontStyle::TITLE);
- style.SetupLabel(title_label_);
+ UpdateStyle();
}
// views::ButtonListener:
@@ -253,8 +263,11 @@ class ImeButtonsView : public views::View,
bool show_voice_button,
bool show_settings_button) {
if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
- SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+ auto* box_layout =
+ new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+ box_layout->set_minimum_cross_axis_size(
+ GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT));
+ SetLayoutManager(box_layout);
SetBorder(views::CreatePaddedBorder(
views::CreateSolidSidedBorder(kSeparatorWidth, 0, 0, 0,
kHorizontalSeparatorColor),
« no previous file with comments | « no previous file | ash/common/system/tray/tray_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698