OLD | NEW |
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // we want the widgets inside to resize themselves rather than making the | 186 // we want the widgets inside to resize themselves rather than making the |
187 // dialog bigger. | 187 // dialog bigger. |
188 GtkWidget* content_hbox = gtk_hbox_new(FALSE, 0); | 188 GtkWidget* content_hbox = gtk_hbox_new(FALSE, 0); |
189 gtk_widget_set_size_request(content_hbox, kTextEntryWidth, -1); | 189 gtk_widget_set_size_request(content_hbox, kTextEntryWidth, -1); |
190 | 190 |
191 text_entry_ = gtk_entry_new(); | 191 text_entry_ = gtk_entry_new(); |
192 gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, &kEntryBackgroundColor); | 192 gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, &kEntryBackgroundColor); |
193 gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, &kEntryTextColor); | 193 gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, &kEntryTextColor); |
194 | 194 |
195 match_count_label_ = gtk_label_new(NULL); | 195 match_count_label_ = gtk_label_new(NULL); |
| 196 gtk_misc_set_padding(GTK_MISC(match_count_label_), 2, 0); |
196 match_count_event_box_ = gtk_event_box_new(); | 197 match_count_event_box_ = gtk_event_box_new(); |
197 GtkWidget* match_count_centerer = gtk_vbox_new(FALSE, 0); | 198 GtkWidget* match_count_centerer = gtk_vbox_new(FALSE, 0); |
198 gtk_box_pack_start(GTK_BOX(match_count_centerer), match_count_event_box_, | 199 gtk_box_pack_start(GTK_BOX(match_count_centerer), match_count_event_box_, |
199 TRUE, TRUE, 0); | 200 TRUE, TRUE, 0); |
200 gtk_container_set_border_width(GTK_CONTAINER(match_count_centerer), 3); | 201 gtk_container_set_border_width(GTK_CONTAINER(match_count_centerer), 1); |
201 gtk_container_add(GTK_CONTAINER(match_count_event_box_), match_count_label_); | 202 gtk_container_add(GTK_CONTAINER(match_count_event_box_), match_count_label_); |
202 UpdateMatchLabelAppearance(false); | 203 UpdateMatchLabelAppearance(false); |
203 | 204 |
204 gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE); | 205 gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE); |
205 // Until we switch to vector graphics, force the font size. | 206 // Until we switch to vector graphics, force the font size. |
206 gtk_util::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi | 207 gtk_util::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi |
207 gtk_util::ForceFontSizePixels(match_count_centerer, 13.4); | 208 gtk_util::ForceFontSizePixels(match_count_centerer, 13.4); |
208 | 209 |
209 gtk_box_pack_end(GTK_BOX(content_hbox), match_count_centerer, | 210 gtk_box_pack_end(GTK_BOX(content_hbox), match_count_centerer, |
210 FALSE, FALSE, 0); | 211 FALSE, FALSE, 0); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 539 } |
539 | 540 |
540 // static | 541 // static |
541 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e, | 542 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e, |
542 FindBarGtk* find_bar) { | 543 FindBarGtk* find_bar) { |
543 find_bar->StoreOutsideFocus(); | 544 find_bar->StoreOutsideFocus(); |
544 | 545 |
545 // Continue propagating the event. | 546 // Continue propagating the event. |
546 return FALSE; | 547 return FALSE; |
547 } | 548 } |
OLD | NEW |