summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 20:57:24 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 20:57:24 +0000
commitade69e978a2da3a0630546c43940c0f1e575b22a (patch)
tree0ae0f07a8eaa965ffe2938d483ef8df3bd53d6db
parent81e824d4d74c074e03ca642c9277d1e6ac5d4e25 (diff)
downloadchromium_src-ade69e978a2da3a0630546c43940c0f1e575b22a.zip
chromium_src-ade69e978a2da3a0630546c43940c0f1e575b22a.tar.gz
chromium_src-ade69e978a2da3a0630546c43940c0f1e575b22a.tar.bz2
[GTK] force standard font size on infobars.
As usual, we'd ideally like to obey the system application font size, but the rest of the UI doesn't scale so it looks bad. BUG=61132 TEST=manual Review URL: http://codereview.chromium.org/4110007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64482 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/infobar_gtk.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/gtk/infobar_gtk.cc b/chrome/browser/gtk/infobar_gtk.cc
index 61992ed..5a061d0 100644
--- a/chrome/browser/gtk/infobar_gtk.cc
+++ b/chrome/browser/gtk/infobar_gtk.cc
@@ -166,6 +166,8 @@ void InfoBar::AddLabelWithInlineLink(const string16& display_text,
UTF16ToUTF8(link_text).c_str());
gtk_chrome_link_button_set_use_gtk_theme(
GTK_CHROME_LINK_BUTTON(link_button), FALSE);
+ gtk_util::ForceFontSizePixels(
+ GTK_CHROME_LINK_BUTTON(link_button)->label, 13.4);
DCHECK(callback);
g_signal_connect(link_button, "clicked", callback, this);
gtk_util::SetButtonTriggersNavigation(link_button);
@@ -182,7 +184,10 @@ void InfoBar::AddLabelWithInlineLink(const string16& display_text,
GtkWidget* trailing_label = gtk_label_new(
UTF16ToUTF8(display_text.substr(link_offset)).c_str());
- // TODO(joth): Unlike the AddLabalAndLink below, none of the label widgets
+ gtk_util::ForceFontSizePixels(initial_label, 13.4);
+ gtk_util::ForceFontSizePixels(trailing_label, 13.4);
+
+ // TODO(joth): Unlike the AddLabelAndLink below, none of the label widgets
// are set as shrinkable here, meaning the text will run under the close
// button etc. when the width is restricted, rather than eliding.
gtk_widget_modify_fg(initial_label, GTK_STATE_NORMAL, &gtk_util::kGdkBlack);
@@ -221,6 +226,7 @@ void InfoBar::AddLabelAndLink(const string16& display_text,
if (link_button)
gtk_box_pack_end(GTK_BOX(hbox), link_button, FALSE, FALSE, 0);
GtkWidget* label = gtk_label_new(UTF16ToUTF8(display_text).c_str());
+ gtk_util::ForceFontSizePixels(label, 13.4);
// In order to avoid the link_button and the label overlapping with each
// other, we make the label shrinkable.
gtk_widget_set_size_request(label, 0, -1);
@@ -384,6 +390,7 @@ ConfirmInfoBar::ConfirmInfoBar(ConfirmInfoBarDelegate* delegate)
std::string label_text = UTF16ToUTF8(delegate->GetMessageText());
GtkWidget* label = gtk_label_new(label_text.c_str());
+ gtk_util::ForceFontSizePixels(label, 13.4);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_util::CenterWidgetInHBox(confirm_hbox_, label, false, kEndOfLabelSpacing);
gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &gtk_util::kGdkBlack);