pidgin/plugins/themeedit.c

changeset 33683
bf243e3394a7
parent 33284
e3155594ea98
child 34706
02cb08146888
equal deleted inserted replaced
33682:cb3c2ebadbf1 33683:bf243e3394a7
65 if (response == GTK_RESPONSE_OK) { 65 if (response == GTK_RESPONSE_OK) {
66 GtkWidget *colorsel; 66 GtkWidget *colorsel;
67 GdkColor color; 67 GdkColor color;
68 PidginBlistTheme *theme; 68 PidginBlistTheme *theme;
69 69
70 #if GTK_CHECK_VERSION(2,14,0)
71 colorsel = 70 colorsel =
72 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog)); 71 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog));
73 #else
74 colorsel = GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel;
75 #endif
76 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); 72 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
77 73
78 theme = pidgin_blist_get_theme(); 74 theme = pidgin_blist_get_theme();
79 75
80 if (prop_type_is_color(theme, prop)) { 76 if (prop_type_is_color(theme, prop)) {
153 if (pair) 149 if (pair)
154 color = pidgin_theme_font_get_color(pair); 150 color = pidgin_theme_font_get_color(pair);
155 } 151 }
156 152
157 dialog = gtk_color_selection_dialog_new(_("Select Color")); 153 dialog = gtk_color_selection_dialog_new(_("Select Color"));
158 #if GTK_CHECK_VERSION(2,14,0)
159 if (color) 154 if (color)
160 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( 155 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
161 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog))), 156 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog))),
162 color); 157 color);
163 #else
164 if (color)
165 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel),
166 color);
167 #endif
168 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected), 158 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected),
169 prop); 159 prop);
170 160
171 gtk_widget_show_all(dialog); 161 gtk_widget_show_all(dialog);
172 } 162 }
182 172
183 label = gtk_label_new(_(text)); 173 label = gtk_label_new(_(text));
184 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 174 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
185 gtk_size_group_add_widget(sizegroup, label); 175 gtk_size_group_add_widget(sizegroup, label);
186 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 176 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
187 #if GTK_CHECK_VERSION(2, 12, 0)
188 gtk_widget_set_tooltip_text(label, blurb); 177 gtk_widget_set_tooltip_text(label, blurb);
189 #endif
190 178
191 color = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_COLOR, 179 color = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_COLOR,
192 PIDGIN_BUTTON_HORIZONTAL); 180 PIDGIN_BUTTON_HORIZONTAL);
193 g_signal_connect(G_OBJECT(color), "clicked", G_CALLBACK(theme_color_select), 181 g_signal_connect(G_OBJECT(color), "clicked", G_CALLBACK(theme_color_select),
194 (gpointer)prop); 182 (gpointer)prop);
208 196
209 label = gtk_label_new(_(text)); 197 label = gtk_label_new(_(text));
210 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 198 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
211 gtk_size_group_add_widget(sizegroup, label); 199 gtk_size_group_add_widget(sizegroup, label);
212 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 200 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
213 #if GTK_CHECK_VERSION(2, 12, 0)
214 gtk_widget_set_tooltip_text(label, blurb); 201 gtk_widget_set_tooltip_text(label, blurb);
215 #endif
216 202
217 font = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT, 203 font = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT,
218 PIDGIN_BUTTON_HORIZONTAL); 204 PIDGIN_BUTTON_HORIZONTAL);
219 g_signal_connect(G_OBJECT(font), "clicked", G_CALLBACK(theme_font_select_face), 205 g_signal_connect(G_OBJECT(font), "clicked", G_CALLBACK(theme_font_select_face),
220 (gpointer)prop); 206 (gpointer)prop);

mercurial