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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 9985012: Adjust location of text in omnibox edit control for Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index e1dc5368eb5704d8744af69085e792c2d3cc4ca0..e4282bdc6e61910732a97e50208df8bcaba3166d 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -51,6 +51,7 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
+#include "ui/base/scale.h"
#include "ui/base/win/mouse_wheel_util.h"
#include "ui/gfx/canvas.h"
#include "ui/views/button_drag_utils.h"
@@ -504,8 +505,20 @@ OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller,
tm.tmInternalLeading) * kXHeightRatio) + 0.5);
// The distance from the top of the field to the desired baseline of the
// rendered text.
- const int kTextBaseline = popup_window_mode_ ? 15 : 18;
- font_y_adjustment_ = kTextBaseline - font_.GetBaseline();
+ int text_baseline = popup_window_mode_ ? 15 : 18;
+ switch (ui::GetDisplayScale()) {
+ case ui::SCALE_METRO_100:
+ case ui::SCALE_METRO_140:
+ case ui::SCALE_METRO_180:
+ // TODO(joi): Metro scales other than 100% will probably need a
+ // different value.
+ text_baseline = 21;
Peter Kasting 2012/04/19 17:39:55 If I understand correctly, this is because in metr
+ break;
+ default:
+ // Leave the default as calculated above.
+ break;
+ }
+ font_y_adjustment_ = text_baseline - font_.GetBaseline();
// Get the number of twips per pixel, which we need below to offset our text
// by the desired number of pixels.
« 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