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

Side by Side Diff: ui/chromeos/ime/candidate_view.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 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 | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/canvas_skia.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "ui/base/ime/candidate_window.h" 7 #include "ui/base/ime/candidate_window.h"
8 #include "ui/chromeos/ime/candidate_view.h" 8 #include "ui/chromeos/ime/candidate_view.h"
9 #include "ui/chromeos/ime/candidate_window_constants.h" 9 #include "ui/chromeos/ime/candidate_window_constants.h"
10 #include "ui/gfx/color_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // The label text is not set in this function. 47 // The label text is not set in this function.
48 views::Label* CreateShortcutLabel( 48 views::Label* CreateShortcutLabel(
49 ui::CandidateWindow::Orientation orientation, 49 ui::CandidateWindow::Orientation orientation,
50 const ui::NativeTheme& theme) { 50 const ui::NativeTheme& theme) {
51 // Create the shortcut label. The label will be owned by 51 // Create the shortcut label. The label will be owned by
52 // |wrapped_shortcut_label|, hence it's deleted when 52 // |wrapped_shortcut_label|, hence it's deleted when
53 // |wrapped_shortcut_label| is deleted. 53 // |wrapped_shortcut_label| is deleted.
54 views::Label* shortcut_label = new views::Label; 54 views::Label* shortcut_label = new views::Label;
55 55
56 if (orientation == ui::CandidateWindow::VERTICAL) { 56 if (orientation == ui::CandidateWindow::VERTICAL) {
57 shortcut_label->SetFontList( 57 shortcut_label->SetFontList(shortcut_label->font_list().Derive(
58 shortcut_label->font_list().Derive(kFontSizeDelta, gfx::Font::BOLD)); 58 kFontSizeDelta, gfx::Font::NORMAL, gfx::Font::Weight::BOLD));
59 } else { 59 } else {
60 shortcut_label->SetFontList( 60 shortcut_label->SetFontList(
61 shortcut_label->font_list().DeriveWithSizeDelta(kFontSizeDelta)); 61 shortcut_label->font_list().DeriveWithSizeDelta(kFontSizeDelta));
62 } 62 }
63 // TODO(satorux): Maybe we need to use language specific fonts for 63 // TODO(satorux): Maybe we need to use language specific fonts for
64 // candidate_label, like Chinese font for Chinese input method? 64 // candidate_label, like Chinese font for Chinese input method?
65 shortcut_label->SetEnabledColor(theme.GetSystemColor( 65 shortcut_label->SetEnabledColor(theme.GetSystemColor(
66 ui::NativeTheme::kColorId_LabelEnabledColor)); 66 ui::NativeTheme::kColorId_LabelEnabledColor));
67 shortcut_label->SetDisabledColor(theme.GetSystemColor( 67 shortcut_label->SetDisabledColor(theme.GetSystemColor(
68 ui::NativeTheme::kColorId_LabelDisabledColor)); 68 ui::NativeTheme::kColorId_LabelDisabledColor));
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 // Reserves the margin for infolist_icon even if it's not visible. 304 // Reserves the margin for infolist_icon even if it's not visible.
305 size.Enlarge( 305 size.Enlarge(
306 kInfolistIndicatorIconWidth + kInfolistIndicatorIconPadding * 2, 0); 306 kInfolistIndicatorIconWidth + kInfolistIndicatorIconPadding * 2, 0);
307 return size; 307 return size;
308 } 308 }
309 309
310 } // namespace ime 310 } // namespace ime
311 } // namespace ui 311 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698