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

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

Issue 2540103003: Update the layout of opt-in IME menu. (Closed)
Patch Set: Addressed comments. Created 4 years 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/system_tray.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 cf8bf8c3a79e8adb3a62d84b5be2359a438d569d..38b1c0ad7d2b65ebd0de676c33af6441b11c7dff 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -114,8 +114,8 @@ class ImeTitleView : public views::View, public views::ButtonListener {
SetLayoutManager(box_layout);
title_label_ =
new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME));
- title_label_->SetBorder(
- views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 0, 0));
+ title_label_->SetBorder(views::CreateEmptyBorder(
+ 0, kMenuEdgeEffectivePadding, kTrayMenuBottomRowPadding, 0));
title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(title_label_);
box_layout->SetFlexForView(title_label_, 1);
@@ -324,9 +324,12 @@ ImeMenuTray::~ImeMenuTray() {
}
void ImeMenuTray::ShowImeMenuBubble() {
+ int minimum_menu_width = MaterialDesignController::IsSystemTrayMenuMaterial()
+ ? kTrayMenuMinimumWidthMd
+ : kTrayMenuMinimumWidth;
should_block_shelf_auto_hide_ = true;
views::TrayBubbleView::InitParams init_params(
- GetAnchorAlignment(), kTrayPopupMinWidth, kTrayPopupMaxWidth);
+ GetAnchorAlignment(), minimum_menu_width, minimum_menu_width);
init_params.can_activate = true;
init_params.close_on_deactivate = true;
@@ -357,10 +360,10 @@ void ImeMenuTray::ShowImeMenuBubble() {
height_range.end());
} else if (current_height > height_range.end()) {
ime_list_view_->scroller()->SetFixedSize(
- gfx::Size(kTrayPopupMaxWidth, height_range.end()));
+ gfx::Size(minimum_menu_width, height_range.end()));
} else if (current_height < height_range.start()) {
ime_list_view_->scroller()->SetFixedSize(
- gfx::Size(kTrayPopupMaxWidth, height_range.start()));
+ gfx::Size(minimum_menu_width, height_range.start()));
}
bubble_view->AddChildView(ime_list_view_);
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698