summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 02:17:02 +0000
committerzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 02:17:02 +0000
commit9902c201466fe4a701f43a124f4d22b6829c87e6 (patch)
tree9a741fb382991170a6bebb8da8f12a509ea93e51
parenta8b8598f94bd49c3684bde66bf062fc38a658c4a (diff)
downloadchromium_src-9902c201466fe4a701f43a124f4d22b6829c87e6.zip
chromium_src-9902c201466fe4a701f43a124f4d22b6829c87e6.tar.gz
chromium_src-9902c201466fe4a701f43a124f4d22b6829c87e6.tar.bz2
Tweak the horizontal mode UI in candidate_window to make it look nicer
BUG=chromium-os:2760 TEST=Use any IME, and examine the candidate window. Review URL: http://codereview.chromium.org/2450001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48690 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/text_input/candidate_window.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/text_input/candidate_window.cc b/chrome/browser/chromeos/text_input/candidate_window.cc
index 149db70..2f32d40 100644
--- a/chrome/browser/chromeos/text_input/candidate_window.cc
+++ b/chrome/browser/chromeos/text_input/candidate_window.cc
@@ -386,12 +386,17 @@ void CandidateView::Init() {
// Create the shortcut label. The label will eventually be part of the
// tree of |this| via |wrapped_shortcut_label|, hence it's deleted when
// |this| is deleted.
- shortcut_label_ = new views::Label(
- StringPrintf(L"%lc", shortcut_character));
+ if (orientation_ == InputMethodLookupTable::kVertical) {
+ shortcut_label_ = new views::Label(
+ StringPrintf(L"%lc", shortcut_character));
+ } else {
+ shortcut_label_ = new views::Label(
+ StringPrintf(L"%lc.", shortcut_character));
+ }
// Wrap it with padding.
const gfx::Insets kVerticalShortcutLabelInsets(1, 6, 1, 6);
- const gfx::Insets kHorizontalShortcutLabelInsets(1, 1, 1, 1);
+ const gfx::Insets kHorizontalShortcutLabelInsets(1, 3, 1, 0);
const gfx::Insets insets =
(orientation_ == InputMethodLookupTable::kVertical ?
kVerticalShortcutLabelInsets :
@@ -402,8 +407,13 @@ void CandidateView::Init() {
// in the candidate window.
const int kFontSizeDelta = 2; // Two size bigger.
// Make the font bold, and change the size.
- shortcut_label_->SetFont(
- shortcut_label_->font().DeriveFont(kFontSizeDelta, gfx::Font::BOLD));
+ if (orientation_ == InputMethodLookupTable::kVertical) {
+ shortcut_label_->SetFont(
+ shortcut_label_->font().DeriveFont(kFontSizeDelta, gfx::Font::BOLD));
+ } else {
+ shortcut_label_->SetFont(
+ shortcut_label_->font().DeriveFont(kFontSizeDelta));
+ }
// TODO(satorux): Maybe we need to use language specific fonts for
// candidate_label, like Chinese font for Chinese input method?
@@ -433,10 +443,16 @@ void CandidateView::Init() {
views::ColumnSet* column_set = layout->AddColumnSet(0);
column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
0, views::GridLayout::USE_PREF, 0, 0);
- column_set->AddPaddingColumn(0, 4);
+ if (orientation_ == InputMethodLookupTable::kVertical) {
+ column_set->AddPaddingColumn(0, 4);
+ }
column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
0, views::GridLayout::USE_PREF, 0, 0);
- column_set->AddPaddingColumn(0, 4);
+ if (orientation_ == InputMethodLookupTable::kVertical) {
+ column_set->AddPaddingColumn(0, 4);
+ } else {
+ column_set->AddPaddingColumn(0, 6);
+ }
// Add the shortcut label and the candidate label.
layout->StartRow(0, 0);