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

Side by Side Diff: chrome/browser/gtk/find_bar_gtk.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/browser/gtk/download_shelf_gtk.cc ('k') | chrome/browser/gtk/link_button_gtk.h » ('j') | 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/browser/gtk/find_bar_gtk.h" 5 #include "chrome/browser/gtk/find_bar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/gfx/gtk_util.h" 10 #include "base/gfx/gtk_util.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 GtkWidget* content_hbox = gtk_hbox_new(false, 0); 157 GtkWidget* content_hbox = gtk_hbox_new(false, 0);
158 gtk_widget_set_size_request(content_hbox, 300, -1); 158 gtk_widget_set_size_request(content_hbox, 300, -1);
159 159
160 text_entry_ = gtk_entry_new(); 160 text_entry_ = gtk_entry_new();
161 match_count_label_ = gtk_label_new(NULL); 161 match_count_label_ = gtk_label_new(NULL);
162 162
163 // Force the text widget height so it lines up with the buttons regardless of 163 // Force the text widget height so it lines up with the buttons regardless of
164 // font size. 164 // font size.
165 gtk_widget_set_size_request(text_entry_, -1, 20); 165 gtk_widget_set_size_request(text_entry_, -1, 20);
166 gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE); 166 gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE);
167 // Until we switch to vector graphics, force the font size.
168 gtk_util::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi
169 gtk_util::ForceFontSizePixels(match_count_label_, 13.4);
167 170
168 gtk_box_pack_end(GTK_BOX(content_hbox), match_count_label_, FALSE, FALSE, 0); 171 gtk_box_pack_end(GTK_BOX(content_hbox), match_count_label_, FALSE, FALSE, 0);
169 gtk_box_pack_end(GTK_BOX(content_hbox), text_entry_, TRUE, TRUE, 0); 172 gtk_box_pack_end(GTK_BOX(content_hbox), text_entry_, TRUE, TRUE, 0);
170 173
171 // We fake anti-aliasing by having two borders. 174 // We fake anti-aliasing by having two borders.
172 GtkWidget* border_bin = gtk_util::CreateGtkBorderBin(content_hbox, 175 GtkWidget* border_bin = gtk_util::CreateGtkBorderBin(content_hbox,
173 &kTextBorderColor, 176 &kTextBorderColor,
174 1, 1, 1, 0); 177 1, 1, 1, 0);
175 GtkWidget* border_bin_aa = gtk_util::CreateGtkBorderBin(border_bin, 178 GtkWidget* border_bin_aa = gtk_util::CreateGtkBorderBin(border_bin,
176 &kTextBorderColorAA, 179 &kTextBorderColorAA,
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 412 }
410 413
411 // static 414 // static
412 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e, 415 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e,
413 FindBarGtk* find_bar) { 416 FindBarGtk* find_bar) {
414 find_bar->StoreOutsideFocus(); 417 find_bar->StoreOutsideFocus();
415 418
416 // Continue propagating the event. 419 // Continue propagating the event.
417 return FALSE; 420 return FALSE;
418 } 421 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/download_shelf_gtk.cc ('k') | chrome/browser/gtk/link_button_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698