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

Unified Diff: chrome/browser/chromeos/input_method/candidate_window.cc

Issue 10537022: Temporary fix for Infolist font issue. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 | chrome/browser/chromeos/input_method/candidate_window_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/candidate_window.cc
diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc
index 030dc0c6b3b84017e383fce067fa65847159c8c7..391de5abe6206e6a6db8b73baab3880600c331b0 100644
--- a/chrome/browser/chromeos/input_method/candidate_window.cc
+++ b/chrome/browser/chromeos/input_method/candidate_window.cc
@@ -66,6 +66,13 @@ const int kFontSizeDelta = 1;
const int kFontSizeDelta = 2;
#endif
+// Currently the infolist window only supports Japanese font.
+#if defined(GOOGLE_CHROME_BUILD)
+const char kJapaneseFontName[] = "MotoyaG04Gothic";
+#else
+const char kJapaneseFontName[] = "IPAPGothic";
+#endif
+
// The minimum width of candidate labels in the vertical candidate
// window. We use this value to prevent the candidate window from being
// too narrow when all candidates are short.
@@ -1290,16 +1297,14 @@ InfolistView::InfolistView(
void InfolistView::Init() {
title_label_ = new views::Label;
title_label_->SetPosition(gfx::Point(0, 0));
- title_label_->SetFont(
- title_label_->font().DeriveFont(kFontSizeDelta + 2));
+ title_label_->SetFont(parent_infolist_window_->GetTitleFont());
title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
title_label_->set_border(
views::Border::CreateEmptyBorder(4, 7, 2, 4));
description_label_ = new views::Label;
description_label_->SetPosition(gfx::Point(0, 0));
- description_label_->SetFont(
- description_label_->font().DeriveFont(kFontSizeDelta - 2));
+ description_label_->SetFont(parent_infolist_window_->GetDescriptionFont());
description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
description_label_->SetMultiLine(true);
description_label_->set_border(
@@ -1367,7 +1372,9 @@ InfolistWindowView::InfolistWindowView(views::Widget* parent_frame,
parent_frame_(parent_frame),
candidate_window_frame_(candidate_window_frame),
infolist_area_(NULL),
- visible_(false) {
+ visible_(false),
+ title_font_(new gfx::Font(kJapaneseFontName, kFontSizeDelta + 15)),
+ description_font_(new gfx::Font(kJapaneseFontName, kFontSizeDelta + 11)) {
}
InfolistWindowView::~InfolistWindowView() {
@@ -1557,11 +1564,19 @@ void InfolistWindowView::VisibilityChanged(View* starting_from,
ResizeAndMoveParentFrame();
}
}
+
void InfolistWindowView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
View::OnBoundsChanged(previous_bounds);
ResizeAndMoveParentFrame();
}
+gfx::Font InfolistWindowView::GetTitleFont() const {
+ return *title_font_.get();
+}
+
+gfx::Font InfolistWindowView::GetDescriptionFont() const {
+ return *description_font_.get();
+}
bool CandidateWindowControllerImpl::Init() {
// Create the candidate window view.
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698