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

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: Support Chromium OS 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
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..bcc2b135ed77bf06d3b03436b41f79bfd48b0da1 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
+// TODO: Currently the infolist window only supports Japanese font.
Seigo Nonaka 2012/06/08 02:17:38 nit: Please leave user name for TODO or just remov
Yusuke Sato 2012/06/08 02:22:42 TODO requires an assignee.
horo 2012/06/08 03:01:12 Done.
+#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() {
+ return *title_font_.get();
+}
+
+gfx::Font InfolistWindowView::GetDescriptionFont() {
+ return *description_font_.get();
+}
bool CandidateWindowControllerImpl::Init() {
// Create the candidate window view.

Powered by Google App Engine
This is Rietveld 408576698