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

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

Issue 2826543002: Chrome OS: truncate text in virtual keyboard tray item (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/ime_menu/ime_menu_tray.cc
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc
index d8ba180dae148d268960237d7de210572319b905..daa09b1426c43a2f30730e1d9db0e70a0f75b0b7 100644
--- a/ash/system/ime_menu/ime_menu_tray.cc
+++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -98,7 +98,12 @@ bool IsInPasswordInputContext() {
class ImeMenuLabel : public views::Label {
public:
- ImeMenuLabel() {}
+ ImeMenuLabel() {
+ // Sometimes the label will be more than 2 characters, e.g. INTL and EXTD.
+ // This border makes sure we only leave room for ~2 and the others are
+ // truncated.
+ SetBorder(views::CreateEmptyBorder(gfx::Insets(0, 6)));
+ }
~ImeMenuLabel() override {}
// views:Label:
@@ -281,6 +286,7 @@ ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf)
show_bubble_after_keyboard_hidden_(false) {
SetInkDropMode(InkDropMode::ON);
SetupLabelForTray(label_);
+ label_->SetElideBehavior(gfx::TRUNCATE);
tray_container()->AddChildView(label_);
SystemTrayNotifier* tray_notifier = Shell::Get()->system_tray_notifier();
tray_notifier->AddIMEObserver(this);
« 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