Mercurial > pidgin
comparison src/gtkimhtmltoolbar.c @ 10125:ee50e4797352
[gaim-migrate @ 11162]
I fixed the problem described in patch 1038166 in a slightly different way.
While I was at it I got carried away and made it not show size and stuff
in the dialog. The way I did it is probably very evil, and someone will
probably revert it. Just delete the realize_ function.
But this is HEAD, so we can try it anyway.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Tue, 19 Oct 2004 04:39:55 +0000 |
parents | 9c174a7f9afc |
children | 0aca774bef87 |
comparison
equal
deleted
inserted
replaced
10124:b4efa002dad8 | 10125:ee50e4797352 |
---|---|
123 toolbar->font_dialog = NULL; | 123 toolbar->font_dialog = NULL; |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 static void | 127 static void |
128 realize_toolbar_font(GtkWidget *widget, GtkIMHtmlToolbar *toolbar) | |
129 { | |
130 GtkFontSelection *sel; | |
131 | |
132 sel = GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog)->fontsel); | |
133 gtk_widget_hide_all(gtk_widget_get_parent(sel->size_entry)); | |
134 gtk_widget_show_all(sel->family_list); | |
135 gtk_widget_show(gtk_widget_get_parent(sel->family_list)); | |
136 gtk_widget_show(gtk_widget_get_parent(gtk_widget_get_parent(sel->family_list))); | |
137 } | |
138 | |
139 static void | |
128 cancel_toolbar_font(GtkWidget *widget, GtkIMHtmlToolbar *toolbar) | 140 cancel_toolbar_font(GtkWidget *widget, GtkIMHtmlToolbar *toolbar) |
129 { | 141 { |
130 destroy_toolbar_font(widget, NULL, toolbar); | 142 destroy_toolbar_font(widget, NULL, toolbar); |
131 } | 143 } |
132 | 144 |
162 | 174 |
163 if (!toolbar->font_dialog) { | 175 if (!toolbar->font_dialog) { |
164 toolbar->font_dialog = gtk_font_selection_dialog_new(_("Select Font")); | 176 toolbar->font_dialog = gtk_font_selection_dialog_new(_("Select Font")); |
165 | 177 |
166 g_object_set_data(G_OBJECT(toolbar->font_dialog), "gaim_toolbar", toolbar); | 178 g_object_set_data(G_OBJECT(toolbar->font_dialog), "gaim_toolbar", toolbar); |
167 | 179 |
168 if(fontname) { | 180 if(fontname) { |
169 char fonttif[128]; | 181 char fonttif[128]; |
170 g_snprintf(fonttif, sizeof(fonttif), "%s 12", fontname); | 182 g_snprintf(fonttif, sizeof(fonttif), "%s 12", fontname); |
171 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog), | 183 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog), |
172 fonttif); | 184 fonttif); |
179 G_CALLBACK(destroy_toolbar_font), toolbar); | 191 G_CALLBACK(destroy_toolbar_font), toolbar); |
180 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog)->ok_button), "clicked", | 192 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog)->ok_button), "clicked", |
181 G_CALLBACK(apply_font), toolbar->font_dialog); | 193 G_CALLBACK(apply_font), toolbar->font_dialog); |
182 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog)->cancel_button), "clicked", | 194 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog)->cancel_button), "clicked", |
183 G_CALLBACK(cancel_toolbar_font), toolbar); | 195 G_CALLBACK(cancel_toolbar_font), toolbar); |
196 g_signal_connect_after(G_OBJECT(toolbar->font_dialog), "realize", | |
197 G_CALLBACK(realize_toolbar_font), toolbar); | |
184 | 198 |
185 gtk_window_present(GTK_WINDOW(toolbar->font_dialog)); | 199 gtk_window_present(GTK_WINDOW(toolbar->font_dialog)); |
186 } else { | 200 } else { |
187 cancel_toolbar_font(NULL, toolbar); | 201 cancel_toolbar_font(NULL, toolbar); |
188 } | 202 } |