summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
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/gtk
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/gtk')
-rw-r--r--chrome/browser/gtk/download_item_gtk.cc4
-rw-r--r--chrome/browser/gtk/download_shelf_gtk.cc4
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc3
-rw-r--r--chrome/browser/gtk/link_button_gtk.h2
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.cc4
5 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc
index 2a3f926..02f2f3f 100644
--- a/chrome/browser/gtk/download_item_gtk.cc
+++ b/chrome/browser/gtk/download_item_gtk.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/gtk/download_shelf_gtk.h"
#include "chrome/browser/gtk/menu_gtk.h"
#include "chrome/browser/gtk/nine_box.h"
+#include "chrome/common/gtk_util.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -181,6 +182,9 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf,
// Left align and vertically center the labels.
gtk_misc_set_alignment(GTK_MISC(name_label_), 0, 0.5);
gtk_misc_set_alignment(GTK_MISC(status_label_), 0, 0.5);
+ // Until we switch to vector graphics, force the font size.
+ gtk_util::ForceFontSizePixels(name_label_, 13.4); // 13.4px == 10pt @ 96dpi
+ gtk_util::ForceFontSizePixels(status_label_, 13.4); // 13.4px == 10pt @ 96dpi
// Stack the labels on top of one another.
GtkWidget* text_stack = gtk_vbox_new(FALSE, 0);
diff --git a/chrome/browser/gtk/download_shelf_gtk.cc b/chrome/browser/gtk/download_shelf_gtk.cc
index f594a7f..00e81c8 100644
--- a/chrome/browser/gtk/download_shelf_gtk.cc
+++ b/chrome/browser/gtk/download_shelf_gtk.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/gtk/link_button_gtk.h"
#include "chrome/browser/gtk/slide_animator_gtk.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/gtk_util.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -96,6 +97,9 @@ DownloadShelfGtk::DownloadShelfGtk(TabContents* tab_contents)
link_button_.reset(new LinkButtonGtk(link_text.c_str()));
g_signal_connect(link_button_->widget(), "clicked",
G_CALLBACK(OnButtonClick), this);
+ // Until we switch to vector graphics, force the font size.
+ // 13.4px == 10pt @ 96dpi
+ gtk_util::ForceFontSizePixels(link_button_->label(), 13.4);
// Make the download arrow icon.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 922cafb..d4c3c9b 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -167,6 +167,9 @@ void FindBarGtk::InitWidgets() {
// font size.
gtk_widget_set_size_request(text_entry_, -1, 20);
gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE);
+ // Until we switch to vector graphics, force the font size.
+ gtk_util::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi
+ gtk_util::ForceFontSizePixels(match_count_label_, 13.4);
gtk_box_pack_end(GTK_BOX(content_hbox), match_count_label_, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(content_hbox), text_entry_, TRUE, TRUE, 0);
diff --git a/chrome/browser/gtk/link_button_gtk.h b/chrome/browser/gtk/link_button_gtk.h
index 745c943..3a37fed 100644
--- a/chrome/browser/gtk/link_button_gtk.h
+++ b/chrome/browser/gtk/link_button_gtk.h
@@ -17,6 +17,8 @@ class LinkButtonGtk {
GtkWidget* widget() { return widget_.get(); }
+ GtkWidget* label() { return label_; }
+
private:
// Called when the pointer enters or leaves the button.
static gboolean OnEnter(GtkWidget* widget, LinkButtonGtk* link_button);
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
index 07d644f..67212e03 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
@@ -600,7 +600,9 @@ void TabRendererGtk::InitResources() {
LoadTabImages();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- title_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont));
+ // Force the font size to 10pt.
+ gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont);
+ title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 10));
title_font_height_ = title_font_->height();
InitializeLoadingAnimationData(&rb, &loading_animation_data);