pidgin/gtkutils.c

changeset 29898
c883238ac60f
parent 29896
fd9614c33141
child 29927
80855a5471ed
equal deleted inserted replaced
29897:5f4ff4e10c72 29898:c883238ac60f
154 154
155 GtkWidget * 155 GtkWidget *
156 pidgin_create_small_button(GtkWidget *image) 156 pidgin_create_small_button(GtkWidget *image)
157 { 157 {
158 GtkWidget *button; 158 GtkWidget *button;
159 GtkRcStyle *rcstyle;
160 159
161 button = gtk_button_new(); 160 button = gtk_button_new();
162 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); 161 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
163 162
164 /* don't allow focus on the close button */ 163 /* don't allow focus on the close button */
165 gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE); 164 gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
166 165
167 /* make it as small as possible */ 166 /* set style to make it as small as possible */
168 rcstyle = gtk_rc_style_new(); 167 gtk_widget_set_name(button, "pidgin-small-close-button");
169 rcstyle->xthickness = rcstyle->ythickness = 0;
170 gtk_widget_modify_style(button, rcstyle);
171 gtk_rc_style_unref(rcstyle);
172 168
173 gtk_widget_show(image); 169 gtk_widget_show(image);
174 170
175 gtk_container_add(GTK_CONTAINER(button), image); 171 gtk_container_add(GTK_CONTAINER(button), image);
176 172
3471 3467
3472 /* If we're under GNOME, try registering the system URL handlers. */ 3468 /* If we're under GNOME, try registering the system URL handlers. */
3473 if (purple_running_gnome()) 3469 if (purple_running_gnome())
3474 register_gnome_url_handlers(); 3470 register_gnome_url_handlers();
3475 3471
3472 /* Used to make small buttons */
3473 gtk_rc_parse_string("style \"pidgin-small-close-button\"\n"
3474 "{\n"
3475 "GtkWidget::focus-padding = 0\n"
3476 "GtkWidget::focus-line-width = 0\n"
3477 "xthickness = 0\n"
3478 "ythickness = 0\n"
3479 "}\n"
3480 "widget \"*.pidgin-small-close-button\" style \"pidgin-small-close-button\"");
3481
3476 #ifdef _WIN32 3482 #ifdef _WIN32
3477 winpidgin_register_win32_url_handlers(); 3483 winpidgin_register_win32_url_handlers();
3478 #endif 3484 #endif
3479 3485
3480 } 3486 }

mercurial