comparison pidgin/gtkprefs.c @ 23487:09feece6ecd5

Fixed some small rendering errors in conversations and prefs
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Tue, 05 Aug 2008 18:51:24 +0000
parents 748308865dbf
children 2d419a0fc0e4
comparison
equal deleted inserted replaced
23486:3baef5c88959 23487:09feece6ecd5
55 55
56 #define PROXYHOST 0 56 #define PROXYHOST 0
57 #define PROXYPORT 1 57 #define PROXYPORT 1
58 #define PROXYUSER 2 58 #define PROXYUSER 2
59 #define PROXYPASS 3 59 #define PROXYPASS 3
60
61 #define PREFS_OPTIMAL_ICON_SIZE 32
60 62
61 static int sound_row_sel = 0; 63 static int sound_row_sel = 0;
62 static GtkWidget *prefsnotebook; 64 static GtkWidget *prefsnotebook;
63 65
64 static GtkWidget *sound_entry = NULL; 66 static GtkWidget *sound_entry = NULL;
597 static void 599 static void
598 prefs_themes_sort(PurpleTheme *theme) 600 prefs_themes_sort(PurpleTheme *theme)
599 { 601 {
600 GdkPixbuf *pixbuf = NULL; 602 GdkPixbuf *pixbuf = NULL;
601 GtkTreeIter iter; 603 GtkTreeIter iter;
602 gchar *image_full, *markup; 604 gchar *image_full = NULL, *markup;
603 const gchar *name, *author, *description; 605 const gchar *name, *author, *description;
604 606
605 if (PURPLE_IS_SOUND_THEME(theme)){ 607 if (PURPLE_IS_SOUND_THEME(theme)){
606 608
607 image_full = purple_theme_get_image_full(theme); 609 image_full = purple_theme_get_image_full(theme);
608 if (image_full != NULL){ 610 if (image_full != NULL){
609 pixbuf = gdk_pixbuf_new_from_file(image_full, NULL); 611 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
610 g_free(image_full); 612 g_free(image_full);
611 } else pixbuf = NULL; 613 } else pixbuf = NULL;
612 614
613 gtk_list_store_append (prefs_sound_themes, &iter); 615 gtk_list_store_append (prefs_sound_themes, &iter);
614 gtk_list_store_set (prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); 616 gtk_list_store_set (prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1);
618 620
619 } else if (PIDGIN_IS_BLIST_THEME(theme)){ 621 } else if (PIDGIN_IS_BLIST_THEME(theme)){
620 622
621 image_full = purple_theme_get_image_full(theme); 623 image_full = purple_theme_get_image_full(theme);
622 if (image_full != NULL){ 624 if (image_full != NULL){
623 pixbuf = gdk_pixbuf_new_from_file(image_full, NULL); 625 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
624 g_free(image_full); 626 g_free(image_full);
625 } else pixbuf = NULL; 627 } else pixbuf = NULL;
626 628
627 name = purple_theme_get_name(theme); 629 name = purple_theme_get_name(theme);
628 author = purple_theme_get_author(theme); 630 author = purple_theme_get_author(theme);
646 { 648 {
647 GdkPixbuf *pixbuf = NULL; 649 GdkPixbuf *pixbuf = NULL;
648 gchar *filename; 650 gchar *filename;
649 GtkTreeIter iter; 651 GtkTreeIter iter;
650 652
651 filename = g_build_filename(DATADIR, "icons", "hicolor", "16x16", "apps", "pidgin.png", NULL); 653 filename = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL);
652 pixbuf= gdk_pixbuf_new_from_file(filename, NULL); 654 pixbuf = gdk_pixbuf_new_from_file_at_scale(filename, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
653 g_free(filename); 655 g_free(filename);
654 656
655 /* sound themes */ 657 /* sound themes */
656 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); 658 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
657 659
1120 vbox = pidgin_make_frame(ret, _("Buddy List Theme")); 1122 vbox = pidgin_make_frame(ret, _("Buddy List Theme"));
1121 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL (prefs_blist_themes)); 1123 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL (prefs_blist_themes));
1122 gtk_box_pack_start(GTK_BOX (vbox), combo_box, TRUE, TRUE, 0); 1124 gtk_box_pack_start(GTK_BOX (vbox), combo_box, TRUE, TRUE, 0);
1123 1125
1124 cell_rend = gtk_cell_renderer_pixbuf_new(); 1126 cell_rend = gtk_cell_renderer_pixbuf_new();
1127 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE);
1125 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 1128 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
1126 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); 1129 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL);
1127 1130
1128 cell_rend = gtk_cell_renderer_text_new(); 1131 cell_rend = gtk_cell_renderer_text_new();
1129 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 1132 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
2153 /* SOUND THEMES */ 2156 /* SOUND THEMES */
2154 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL (prefs_sound_themes)); 2157 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL (prefs_sound_themes));
2155 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); 2158 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0);
2156 2159
2157 cell_rend = gtk_cell_renderer_pixbuf_new(); 2160 cell_rend = gtk_cell_renderer_pixbuf_new();
2161 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE);
2158 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 2162 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
2159 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); 2163 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL);
2160 2164
2161 cell_rend = gtk_cell_renderer_text_new(); 2165 cell_rend = gtk_cell_renderer_text_new();
2162 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); 2166 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);