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

Unified Diff: chrome/common/gtk_util.cc

Issue 113546: Force the font size in the omnibox, tabs, find bar, and download shelf (Closed)
Patch Set: Created 11 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 | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/gtk_util.cc
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index f0d5ea1b2992f0f1bf5f8aa41039912e2de7f55a..0bef00340bf2e197097fd4eaf06c2bcc82a4171e 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
#include "base/linux_util.h"
+#include "base/logging.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace {
@@ -54,4 +55,14 @@ void RemoveAllChildren(GtkWidget* container) {
gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container);
}
+void ForceFontSizePixels(GtkWidget* widget, double size_pixels) {
+ GtkStyle* style = widget->style;
+ PangoFontDescription* font_desc = style->font_desc;
+ // pango_font_description_set_absolute_size sets the font size in device
+ // units, which for us is pixels.
+ pango_font_description_set_absolute_size(font_desc,
+ PANGO_SCALE * size_pixels);
+ gtk_widget_modify_font(widget, font_desc);
+}
+
} // namespace gtk_util
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698