Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 92329
Collapse All | Expand All

(-)src/folderview.c (-30 / +5 lines)
Lines 67-78 Link Here
67
typedef enum
67
typedef enum
68
{
68
{
69
	COL_FOLDER	= 0,
69
	COL_FOLDER	= 0,
70
	COL_NEW		= 1,
70
	COL_UNREAD	= 1,
71
	COL_UNREAD	= 2,
71
	COL_TOTAL	= 2
72
	COL_TOTAL	= 3
73
} FolderColumnPos;
72
} FolderColumnPos;
74
73
75
#define N_FOLDER_COLS		4
74
#define N_FOLDER_COLS		3
76
#define COL_FOLDER_WIDTH	150
75
#define COL_FOLDER_WIDTH	150
77
#define COL_NUM_WIDTH		32
76
#define COL_NUM_WIDTH		32
78
77
Lines 124-131 Link Here
124
static GdkBitmap *queueopenxpmmask;
123
static GdkBitmap *queueopenxpmmask;
125
static GdkPixmap *queueopenhrmxpm;
124
static GdkPixmap *queueopenhrmxpm;
126
static GdkBitmap *queueopenhrmxpmmask;
125
static GdkBitmap *queueopenhrmxpmmask;
127
static GdkPixmap *newxpm;
128
static GdkBitmap *newxpmmask;
129
static GdkPixmap *unreadxpm;
126
static GdkPixmap *unreadxpm;
130
static GdkBitmap *unreadxpmmask;
127
static GdkBitmap *unreadxpmmask;
131
static GdkPixmap *readxpm;
128
static GdkPixmap *readxpm;
Lines 324-330 Link Here
324
	folderview = g_new0(FolderView, 1);
321
	folderview = g_new0(FolderView, 1);
325
322
326
	titles[COL_FOLDER] = _("Folder");
323
	titles[COL_FOLDER] = _("Folder");
327
	titles[COL_NEW]    = _("New");
328
	titles[COL_UNREAD] = _("Unread");
324
	titles[COL_UNREAD] = _("Unread");
329
	titles[COL_TOTAL]  = _("#");
325
	titles[COL_TOTAL]  = _("#");
330
326
Lines 341-356 Link Here
341
	
337
	
342
	gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
338
	gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
343
	gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_BROWSE);
339
	gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_BROWSE);
344
	gtk_clist_set_column_justification(GTK_CLIST(ctree), COL_NEW,
345
					   GTK_JUSTIFY_RIGHT);
346
	gtk_clist_set_column_justification(GTK_CLIST(ctree), COL_UNREAD,
340
	gtk_clist_set_column_justification(GTK_CLIST(ctree), COL_UNREAD,
347
					   GTK_JUSTIFY_RIGHT);
341
					   GTK_JUSTIFY_RIGHT);
348
	gtk_clist_set_column_justification(GTK_CLIST(ctree), COL_TOTAL,
342
	gtk_clist_set_column_justification(GTK_CLIST(ctree), COL_TOTAL,
349
					   GTK_JUSTIFY_RIGHT);
343
					   GTK_JUSTIFY_RIGHT);
350
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_FOLDER,
344
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_FOLDER,
351
				   prefs_common.folder_col_folder);
345
				   prefs_common.folder_col_folder);
352
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_NEW,
353
				   prefs_common.folder_col_new);
354
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_UNREAD,	
346
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_UNREAD,	
355
				   prefs_common.folder_col_unread);
347
				   prefs_common.folder_col_unread);
356
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_TOTAL,
348
	gtk_clist_set_column_width(GTK_CLIST(ctree), COL_TOTAL,
Lines 435-444 Link Here
435
void folderview_init(FolderView *folderview)
427
void folderview_init(FolderView *folderview)
436
{
428
{
437
	GtkWidget *ctree = folderview->ctree;
429
	GtkWidget *ctree = folderview->ctree;
438
	GtkWidget *label_new;
439
	GtkWidget *label_unread;
430
	GtkWidget *label_unread;
440
	GtkWidget *label_total;
431
	GtkWidget *label_total;
441
	GtkWidget *hbox_new;
442
	GtkWidget *hbox_unread;
432
	GtkWidget *hbox_unread;
443
	GtkWidget *hbox_total;
433
	GtkWidget *hbox_total;
444
		
434
		
Lines 468-501 Link Here
468
458
469
	/* CLAWS: titles for "New" and "Unread" show new & unread pixmaps
459
	/* CLAWS: titles for "New" and "Unread" show new & unread pixmaps
470
	 * instead text (text overflows making them unreadable and ugly) */
460
	 * instead text (text overflows making them unreadable and ugly) */
471
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_NEW,
472
			 &newxpm, &newxpmmask);
473
	stock_pixmap_gdk(ctree, STOCK_PIXMAP_UNREAD,
461
	stock_pixmap_gdk(ctree, STOCK_PIXMAP_UNREAD,
474
			 &unreadxpm, &unreadxpmmask);
462
			 &unreadxpm, &unreadxpmmask);
475
	stock_pixmap_gdk(ctree, STOCK_PIXMAP_READ,
463
	stock_pixmap_gdk(ctree, STOCK_PIXMAP_READ,
476
			 &readxpm, &readxpmmask);
464
			 &readxpm, &readxpmmask);
477
		
465
		
478
	label_new = gtk_pixmap_new(newxpm, newxpmmask);
479
	label_unread = gtk_pixmap_new(unreadxpm, unreadxpmmask);
466
	label_unread = gtk_pixmap_new(unreadxpm, unreadxpmmask);
480
	label_total = gtk_pixmap_new(readxpm, readxpmmask);
467
	label_total = gtk_pixmap_new(readxpm, readxpmmask);
481
468
482
	hbox_new = gtk_hbox_new(FALSE, 4);
483
	hbox_unread = gtk_hbox_new(FALSE, 4);
469
	hbox_unread = gtk_hbox_new(FALSE, 4);
484
	hbox_total = gtk_hbox_new(FALSE, 4);
470
	hbox_total = gtk_hbox_new(FALSE, 4);
485
471
486
	/* left justified */
472
	/* left justified */
487
	gtk_box_pack_start(GTK_BOX(hbox_new), label_new, TRUE, TRUE, 0);
488
	gtk_misc_set_alignment (GTK_MISC (label_new), 1, 0.5);
489
	gtk_box_pack_start(GTK_BOX(hbox_unread), label_unread, TRUE, TRUE, 0);
473
	gtk_box_pack_start(GTK_BOX(hbox_unread), label_unread, TRUE, TRUE, 0);
490
	gtk_misc_set_alignment (GTK_MISC (label_unread), 1, 0.5);
474
	gtk_misc_set_alignment (GTK_MISC (label_unread), 1, 0.5);
491
	gtk_box_pack_start(GTK_BOX(hbox_total), label_total, TRUE, TRUE, 0);
475
	gtk_box_pack_start(GTK_BOX(hbox_total), label_total, TRUE, TRUE, 0);
492
	gtk_misc_set_alignment (GTK_MISC (label_total), 1, 0.5);
476
	gtk_misc_set_alignment (GTK_MISC (label_total), 1, 0.5);
493
477
494
	gtk_widget_show_all(hbox_new);
495
	gtk_widget_show_all(hbox_unread);
478
	gtk_widget_show_all(hbox_unread);
496
	gtk_widget_show_all(hbox_total);
479
	gtk_widget_show_all(hbox_total);
497
480
498
	gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_NEW,hbox_new);
499
	gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_UNREAD,hbox_unread);
481
	gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_UNREAD,hbox_unread);
500
	gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_TOTAL,hbox_total);
482
	gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_TOTAL,hbox_total);
501
			
483
			
Lines 673-690 Link Here
673
	GtkCTree *ctree = GTK_CTREE(folderview->ctree);
655
	GtkCTree *ctree = GTK_CTREE(folderview->ctree);
674
	static GtkCTreeNode *prev_row = NULL;
656
	static GtkCTreeNode *prev_row = NULL;
675
	FolderItem *item;
657
	FolderItem *item;
676
	gint new, unread, total;
658
	gint unread, total;
677
	gchar *new_str, *unread_str, *total_str;
659
	gchar *unread_str, *total_str;
678
660
679
	if (!row) return;
661
	if (!row) return;
680
662
681
	item = gtk_ctree_node_get_row_data(ctree, row);
663
	item = gtk_ctree_node_get_row_data(ctree, row);
682
	if (!item) return;
664
	if (!item) return;
683
665
684
	gtk_ctree_node_get_text(ctree, row, COL_NEW, &new_str);
685
	gtk_ctree_node_get_text(ctree, row, COL_UNREAD, &unread_str);
666
	gtk_ctree_node_get_text(ctree, row, COL_UNREAD, &unread_str);
686
	gtk_ctree_node_get_text(ctree, row, COL_TOTAL, &total_str);
667
	gtk_ctree_node_get_text(ctree, row, COL_TOTAL, &total_str);
687
	new = atoi(new_str);
688
	unread = atoi(unread_str);
668
	unread = atoi(unread_str);
689
	total = atoi(total_str);
669
	total = atoi(total_str);
690
670
Lines 1150-1160 Link Here
1150
	g_free(name);
1130
	g_free(name);
1151
1131
1152
	if (!folder_item_parent(item)) {
1132
	if (!folder_item_parent(item)) {
1153
		gtk_ctree_node_set_text(ctree, node, COL_NEW,    "-");
1154
		gtk_ctree_node_set_text(ctree, node, COL_UNREAD, "-");
1133
		gtk_ctree_node_set_text(ctree, node, COL_UNREAD, "-");
1155
		gtk_ctree_node_set_text(ctree, node, COL_TOTAL,  "-");
1134
		gtk_ctree_node_set_text(ctree, node, COL_TOTAL,  "-");
1156
	} else {
1135
	} else {
1157
		gtk_ctree_node_set_text(ctree, node, COL_NEW,    itos(item->new_msgs));
1158
		gtk_ctree_node_set_text(ctree, node, COL_UNREAD, itos(item->unread_msgs));
1136
		gtk_ctree_node_set_text(ctree, node, COL_UNREAD, itos(item->unread_msgs));
1159
		gtk_ctree_node_set_text(ctree, node, COL_TOTAL,  itos(item->total_msgs));
1137
		gtk_ctree_node_set_text(ctree, node, COL_TOTAL,  itos(item->total_msgs));
1160
	}
1138
	}
Lines 1690-1698 Link Here
1690
	case COL_FOLDER:
1668
	case COL_FOLDER:
1691
		prefs_common.folder_col_folder = width;
1669
		prefs_common.folder_col_folder = width;
1692
		break;
1670
		break;
1693
	case COL_NEW:
1694
		prefs_common.folder_col_new = width;
1695
		break;
1696
	case COL_UNREAD:
1671
	case COL_UNREAD:
1697
		prefs_common.folder_col_unread = width;
1672
		prefs_common.folder_col_unread = width;
1698
		break;
1673
		break;

Return to bug 92329