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

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

Issue 2685273002: Fix regression where font size too small for IME short name (Closed)
Patch Set: sync Created 3 years, 10 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/common/system/chromeos/ime_menu/ime_list_view.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_list_view.cc b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
index e858d695a5210097218fdd30d02054f7c7cdb70c..e3303da79416f6fba95b100b298ba4a97ec2f7f5 100644
--- a/ash/common/system/chromeos/ime_menu/ime_list_view.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
@@ -105,7 +105,8 @@ class ImeListItemView : public ActionableView {
// |kMenuIconSize| is not enough. The label will trigger eliding as "I..."
// or "...". So we shrink the font size until it fits within the bounds.
int size_delta = -1;
- while (id_label->GetPreferredSize().width() > kMenuIconSize &&
+ while ((id_label->GetPreferredSize().width() -
+ id_label->GetInsets().width()) > kMenuIconSize &&
size_delta >= kMinFontSizeDelta) {
id_label->SetFontList(base_font_list.DeriveWithSizeDelta(size_delta));
--size_delta;
« 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