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

Side by Side Diff: chrome/common/gtk_util.cc

Issue 160025: GTK Themes: Theme the bookmark bubble. (And first run bubble). (Closed)
Patch Set: Remove text_color for estade Created 11 years, 5 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 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 9
10 #include <cstdarg> 10 #include <cstdarg>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 case GDK_GRAB_BROKEN: 133 case GDK_GRAB_BROKEN:
134 default: 134 default:
135 return 0; 135 return 0;
136 } 136 }
137 } 137 }
138 138
139 } // namespace event_utils 139 } // namespace event_utils
140 140
141 namespace gtk_util { 141 namespace gtk_util {
142 142
143 GtkWidget* CreateLabeledControlsGroup(const GdkColor* text_color, 143 GtkWidget* CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels,
144 const char* text, ...) { 144 const char* text, ...) {
145 va_list ap; 145 va_list ap;
146 va_start(ap, text); 146 va_start(ap, text);
147 GtkWidget* table = gtk_table_new(0, 2, FALSE); 147 GtkWidget* table = gtk_table_new(0, 2, FALSE);
148 gtk_table_set_col_spacing(GTK_TABLE(table), 0, kLabelSpacing); 148 gtk_table_set_col_spacing(GTK_TABLE(table), 0, kLabelSpacing);
149 gtk_table_set_row_spacings(GTK_TABLE(table), kControlSpacing); 149 gtk_table_set_row_spacings(GTK_TABLE(table), kControlSpacing);
150 150
151 for (guint row = 0; text; ++row) { 151 for (guint row = 0; text; ++row) {
152 gtk_table_resize(GTK_TABLE(table), row + 1, 2); 152 gtk_table_resize(GTK_TABLE(table), row + 1, 2);
153 GtkWidget* control = va_arg(ap, GtkWidget*); 153 GtkWidget* control = va_arg(ap, GtkWidget*);
154 GtkWidget* label = gtk_label_new(text); 154 GtkWidget* label = gtk_label_new(text);
155 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 155 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
156 if (text_color) 156 if (labels)
157 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, text_color); 157 labels->push_back(label);
158 158
159 gtk_table_attach(GTK_TABLE(table), label, 159 gtk_table_attach(GTK_TABLE(table), label,
160 0, 1, row, row + 1, 160 0, 1, row, row + 1,
161 GTK_FILL, GTK_FILL, 161 GTK_FILL, GTK_FILL,
162 0, 0); 162 0, 0);
163 gtk_table_attach_defaults(GTK_TABLE(table), control, 163 gtk_table_attach_defaults(GTK_TABLE(table), control,
164 1, 2, row, row + 1); 164 1, 2, row, row + 1);
165 text = va_arg(ap, const char*); 165 text = va_arg(ap, const char*);
166 } 166 }
167 va_end(ap); 167 va_end(ap);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void SetWindowIcon(GtkWindow* window) { 400 void SetWindowIcon(GtkWindow* window) {
401 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 401 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
402 GList* icon_list = NULL; 402 GList* icon_list = NULL;
403 icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_ICON_32)); 403 icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_ICON_32));
404 icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_LOGO_16)); 404 icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_LOGO_16));
405 gtk_window_set_icon_list(window, icon_list); 405 gtk_window_set_icon_list(window, icon_list);
406 g_list_free(icon_list); 406 g_list_free(icon_list);
407 } 407 }
408 408
409 } // namespace gtk_util 409 } // 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