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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/gtk_util.h" 5 #include "chrome/common/gtk_util.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/linux_util.h" 9 #include "base/linux_util.h"
10 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 11 #include "third_party/skia/include/core/SkBitmap.h"
11 12
12 namespace { 13 namespace {
13 14
14 // Callback used in RemoveAllChildren. 15 // Callback used in RemoveAllChildren.
15 void RemoveWidget(GtkWidget* widget, gpointer container) { 16 void RemoveWidget(GtkWidget* widget, gpointer container) {
16 gtk_container_remove(GTK_CONTAINER(container), widget); 17 gtk_container_remove(GTK_CONTAINER(container), widget);
17 } 18 }
18 19
19 } // namespace 20 } // namespace
(...skipping 27 matching lines...) Expand all
47 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right); 48 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right);
48 gtk_container_add(GTK_CONTAINER(alignment), child); 49 gtk_container_add(GTK_CONTAINER(alignment), child);
49 gtk_container_add(GTK_CONTAINER(ebox), alignment); 50 gtk_container_add(GTK_CONTAINER(ebox), alignment);
50 return ebox; 51 return ebox;
51 } 52 }
52 53
53 void RemoveAllChildren(GtkWidget* container) { 54 void RemoveAllChildren(GtkWidget* container) {
54 gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container); 55 gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container);
55 } 56 }
56 57
58 void ForceFontSizePixels(GtkWidget* widget, double size_pixels) {
59 GtkStyle* style = widget->style;
60 PangoFontDescription* font_desc = style->font_desc;
61 // pango_font_description_set_absolute_size sets the font size in device
62 // units, which for us is pixels.
63 pango_font_description_set_absolute_size(font_desc,
64 PANGO_SCALE * size_pixels);
65 gtk_widget_modify_font(widget, font_desc);
66 }
67
57 } // namespace gtk_util 68 } // namespace gtk_util
OLDNEW
« 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