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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/input_method/candidate_window.h" 5 #include "chrome/browser/chromeos/input_method/candidate_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 InfolistWindowView* parent_infolist_window) 1283 InfolistWindowView* parent_infolist_window)
1284 : parent_infolist_window_(parent_infolist_window), 1284 : parent_infolist_window_(parent_infolist_window),
1285 title_label_(NULL), 1285 title_label_(NULL),
1286 description_label_(NULL), 1286 description_label_(NULL),
1287 selected_(false) { 1287 selected_(false) {
1288 } 1288 }
1289 1289
1290 void InfolistView::Init() { 1290 void InfolistView::Init() {
1291 title_label_ = new views::Label; 1291 title_label_ = new views::Label;
1292 title_label_->SetPosition(gfx::Point(0, 0)); 1292 title_label_->SetPosition(gfx::Point(0, 0));
1293 title_label_->SetFont( 1293 title_label_->SetFont(parent_infolist_window_->GetTitleFont());
1294 title_label_->font().DeriveFont(kFontSizeDelta + 2));
1295 title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 1294 title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
1296 title_label_->set_border( 1295 title_label_->set_border(
1297 views::Border::CreateEmptyBorder(4, 7, 2, 4)); 1296 views::Border::CreateEmptyBorder(4, 7, 2, 4));
1298 1297
1299 description_label_ = new views::Label; 1298 description_label_ = new views::Label;
1300 description_label_->SetPosition(gfx::Point(0, 0)); 1299 description_label_->SetPosition(gfx::Point(0, 0));
1301 description_label_->SetFont( 1300 description_label_->SetFont(parent_infolist_window_->GetDescriptionFont());
1302 description_label_->font().DeriveFont(kFontSizeDelta - 2));
1303 description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 1301 description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
1304 description_label_->SetMultiLine(true); 1302 description_label_->SetMultiLine(true);
1305 description_label_->set_border( 1303 description_label_->set_border(
1306 views::Border::CreateEmptyBorder(2, 17, 4, 4)); 1304 views::Border::CreateEmptyBorder(2, 17, 4, 4));
1307 AddChildView(title_label_); 1305 AddChildView(title_label_);
1308 AddChildView(description_label_); 1306 AddChildView(description_label_);
1309 UpdateLabelBackgroundColors(); 1307 UpdateLabelBackgroundColors();
1310 } 1308 }
1311 1309
1312 void InfolistView::SetTitleAndDescriptionText(const string16& title, 1310 void InfolistView::SetTitleAndDescriptionText(const string16& title,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 title_label_->SetBackgroundColor(color); 1358 title_label_->SetBackgroundColor(color);
1361 description_label_->SetBackgroundColor(color); 1359 description_label_->SetBackgroundColor(color);
1362 } 1360 }
1363 1361
1364 InfolistWindowView::InfolistWindowView(views::Widget* parent_frame, 1362 InfolistWindowView::InfolistWindowView(views::Widget* parent_frame,
1365 views::Widget* candidate_window_frame) 1363 views::Widget* candidate_window_frame)
1366 : usages_(new mozc::commands::InformationList), 1364 : usages_(new mozc::commands::InformationList),
1367 parent_frame_(parent_frame), 1365 parent_frame_(parent_frame),
1368 candidate_window_frame_(candidate_window_frame), 1366 candidate_window_frame_(candidate_window_frame),
1369 infolist_area_(NULL), 1367 infolist_area_(NULL),
1370 visible_(false) { 1368 visible_(false),
1369 title_font_(new gfx::Font("MotoyaG04Gothic", kFontSizeDelta + 15)),
1370 description_font_(new gfx::Font("MotoyaG04Gothic", kFontSizeDelta + 11)) {
Seigo Nonaka 2012/06/06 06:20:16 IIRC Motoya font is only available official Chrome
Yusuke Sato 2012/06/07 05:16:19 Or you can just do something like: namespace { #
horo 2012/06/08 02:09:56 Done. Thank you for the suggestion.
1371 } 1371 }
1372 1372
1373 InfolistWindowView::~InfolistWindowView() { 1373 InfolistWindowView::~InfolistWindowView() {
1374 if (infolist_area_ != NULL) { 1374 if (infolist_area_ != NULL) {
1375 infolist_area_->RemoveAllChildViews(false); 1375 infolist_area_->RemoveAllChildViews(false);
1376 } 1376 }
1377 1377
1378 for (size_t i = 0; i < infolist_views_.size(); ++i) { 1378 for (size_t i = 0; i < infolist_views_.size(); ++i) {
1379 delete infolist_views_[i]; 1379 delete infolist_views_[i];
1380 } 1380 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 } 1550 }
1551 1551
1552 void InfolistWindowView::VisibilityChanged(View* starting_from, 1552 void InfolistWindowView::VisibilityChanged(View* starting_from,
1553 bool is_visible) { 1553 bool is_visible) {
1554 if (is_visible) { 1554 if (is_visible) {
1555 // If the visibility of candidate window is changed, 1555 // If the visibility of candidate window is changed,
1556 // we should move the frame to the right position. 1556 // we should move the frame to the right position.
1557 ResizeAndMoveParentFrame(); 1557 ResizeAndMoveParentFrame();
1558 } 1558 }
1559 } 1559 }
1560
1560 void InfolistWindowView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 1561 void InfolistWindowView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
1561 View::OnBoundsChanged(previous_bounds); 1562 View::OnBoundsChanged(previous_bounds);
1562 ResizeAndMoveParentFrame(); 1563 ResizeAndMoveParentFrame();
1563 } 1564 }
1564 1565
1566 gfx::Font InfolistWindowView::GetTitleFont() {
1567 return *title_font_.get();
1568 }
1569
1570 gfx::Font InfolistWindowView::GetDescriptionFont() {
1571 return *description_font_.get();
1572 }
1565 1573
1566 bool CandidateWindowControllerImpl::Init() { 1574 bool CandidateWindowControllerImpl::Init() {
1567 // Create the candidate window view. 1575 // Create the candidate window view.
1568 CreateView(); 1576 CreateView();
1569 1577
1570 // The observer should be added before Connect() so we can capture the 1578 // The observer should be added before Connect() so we can capture the
1571 // initial connection change. 1579 // initial connection change.
1572 ibus_ui_controller_->AddObserver(this); 1580 ibus_ui_controller_->AddObserver(this);
1573 ibus_ui_controller_->Connect(); 1581 ibus_ui_controller_->Connect();
1574 return true; 1582 return true;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 } 1763 }
1756 1764
1757 // static 1765 // static
1758 CandidateWindowController* 1766 CandidateWindowController*
1759 CandidateWindowController::CreateCandidateWindowController() { 1767 CandidateWindowController::CreateCandidateWindowController() {
1760 return new CandidateWindowControllerImpl; 1768 return new CandidateWindowControllerImpl;
1761 } 1769 }
1762 1770
1763 } // namespace input_method 1771 } // namespace input_method
1764 } // namespace chromeos 1772 } // namespace chromeos
OLDNEW
« 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