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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 15779010: Correct vertical positioning for the IME autocompletion. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
===================================================================
--- chrome/browser/ui/views/location_bar/location_bar_view.cc (revision 203496)
+++ chrome/browser/ui/views/location_bar/location_bar_view.cc (working copy)
@@ -281,7 +281,9 @@
// Initialize the inline autocomplete view which is visible only when IME is
// turned on. Use the same font with the omnibox and highlighted background.
- ime_inline_autocomplete_view_ = new views::Label();
+ ime_inline_autocomplete_view_ = new views::Label(string16(), font);
+ ime_inline_autocomplete_view_->set_border(
+ views::Border::CreateEmptyBorder(font_y_offset, 0, 0, 0));
ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false);
ime_inline_autocomplete_view_->set_background(
@@ -290,7 +292,6 @@
ime_inline_autocomplete_view_->SetEnabledColor(
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldSelectionColor));
- ime_inline_autocomplete_view_->SetFont(font);
ime_inline_autocomplete_view_->SetVisible(false);
AddChildView(ime_inline_autocomplete_view_);
@@ -922,20 +923,16 @@
ime_inline_autocomplete_view_->GetInsets().width();
// All the target languages (IMEs) are LTR, and we do not need to support
// RTL so far. In other words, no testable RTL environment so far.
- int x;
- if (width > entry_width) {
+ int x = location_needed_width;
+ if (width > entry_width)
x = 0;
- } else if (location_needed_width + width > entry_width) {
+ else if (location_needed_width + width > entry_width)
x = entry_width - width;
- } else {
- x = location_needed_width;
- }
location_bounds.set_width(x);
ime_inline_autocomplete_view_->SetBounds(
- location_bounds.right(),
- location_bounds.y(),
+ location_bounds.right(), location_bounds.y(),
std::min(width, entry_width),
- location_bounds.height());
+ ime_inline_autocomplete_view_->GetPreferredSize().height());
}
location_entry_view_->SetBoundsRect(location_bounds);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698