summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 21:28:49 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 21:28:49 +0000
commit13ee61d7b61d186baeb2fec423e7b2b0a17c7e98 (patch)
tree3b67bf691e186fbdd7bf83f7520c7c8c67346f56 /chrome/browser/autocomplete
parent3c53cfa23d26b9477e3ca46e141c820e9793a5f2 (diff)
downloadchromium_src-13ee61d7b61d186baeb2fec423e7b2b0a17c7e98.zip
chromium_src-13ee61d7b61d186baeb2fec423e7b2b0a17c7e98.tar.gz
chromium_src-13ee61d7b61d186baeb2fec423e7b2b0a17c7e98.tar.bz2
Force the font size in the omnibox, tabs, find bar, and download shelf
so we don't get layout overflow issues. Ideally, we would have vector graphics for buttons and stuff so this wouldn't be an issue, but for now, this will have to do. BUG=11128 Review URL: http://codereview.chromium.org/113546 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc3
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc4
2 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 566c8d2..4e6be71 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/gtk/location_bar_view_gtk.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/toolbar_model.h"
+#include "chrome/common/gtk_util.h"
#include "chrome/common/notification_service.h"
#include "googleurl/src/gurl.h"
@@ -86,6 +87,8 @@ void AutocompleteEditViewGtk::Init() {
tag_table_ = gtk_text_tag_table_new();
text_buffer_ = gtk_text_buffer_new(tag_table_);
text_view_ = gtk_text_view_new_with_buffer(text_buffer_);
+ // Until we switch to vector graphics, force the font size.
+ gtk_util::ForceFontSizePixels(text_view_, 13.4); // 13.4px == 10pt @ 96dpi
// The text view was floating. It will now be owned by the alignment.
gtk_container_add(GTK_CONTAINER(alignment_.get()), text_view_);
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index 718b76c..ec74e648 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -248,7 +248,9 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk(
// TODO(deanm): We might want to eventually follow what Windows does and
// plumb a gfx::Font through. This is because popup windows have a
// different font size, although we could just derive that font here.
- PangoFontDescription* pfd = PangoFontFromGfxFont(gfx::Font());
+ // For now, force the font size to 10pt.
+ gfx::Font font = gfx::Font::CreateFont(gfx::Font().FontName(), 10);
+ PangoFontDescription* pfd = PangoFontFromGfxFont(font);
pango_layout_set_font_description(layout_, pfd);
pango_font_description_free(pfd);