Don't use UI stuff in folder.h
authorDarko Koruga <darko@users.sourceforge.net>
Tue, 20 Aug 2002 06:33:22 +0000 (06:33 +0000)
committerDarko Koruga <darko@users.sourceforge.net>
Tue, 20 Aug 2002 06:33:22 +0000 (06:33 +0000)
ChangeLog.claws
configure.in
src/folder.h
src/folderview.c
src/prefs_folder_item.c
src/prefs_folder_item.h

index 9de62ff..6836956 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-20 [darko]     0.8.1claws82
+
+       * src/folder.h
+       * src/folderview.c
+       * src/prefs_folder_item.[hc]
+               don't use UI stuff in folder.h
+
 2002-08-20 [darko]     0.8.1claws81
 
        * src/folder.h
index 6bacd52..67cbdb1 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws81
+EXTRA_VERSION=claws82
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 53caa1a..9decece 100644 (file)
@@ -240,8 +240,6 @@ struct _FolderItem
        gint op_count;
        guint opened    : 1; /* opened by summary view */
 
-       GtkStyle *color_style; /* used for folder color */
-
        FolderSortKey sort_key;
        FolderSortType sort_type;
 
index 574b55b..83363b2 100644 (file)
@@ -1013,6 +1013,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
 {
        GtkCTree *ctree = GTK_CTREE(folderview->ctree);
        GtkStyle *style = NULL;
+       GtkStyle *color_style = NULL;
        FolderItem *item;
        GdkPixmap *xpm, *openxpm;
        GdkBitmap *mask, *openmask;
@@ -1214,7 +1215,12 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
        } else if (item->op_count > 0) {
                style = bold_tgtfold_style;
        } else if (item->prefs->color > 0) {
-               style = item->color_style;
+               GdkColor gdk_color;
+
+               gtkut_convert_int_to_gdk_color(item->prefs->color, &gdk_color);
+               color_style = gtk_style_copy(gtk_widget_get_default_style());
+               color_style->fg[GTK_STATE_NORMAL] = gdk_color;
+               style = color_style;
        } else {
                style = normal_style;
        }
index 3fdcab1..bd9a9fc 100644 (file)
@@ -161,15 +161,6 @@ void prefs_folder_item_read_config(FolderItem * item)
                                                                 SORT_BY_NONE);
                item->sort_type = tmp_prefs.sort_descending ? SORT_DESCENDING : SORT_ASCENDING;
        }                                                               
-
-       /* create style for folder color */
-       if (tmp_prefs.color > 0) {
-               GdkColor gdk_color;
-
-               gtkut_convert_int_to_gdk_color(tmp_prefs.color, &gdk_color);
-               item->color_style = gtk_style_copy(gtk_widget_get_default_style());
-               item->color_style->fg[GTK_STATE_NORMAL] = gdk_color;
-       }
 }
 
 void prefs_folder_item_save_config(FolderItem * item)
@@ -581,15 +572,9 @@ void prefs_folder_item_ok_cb(GtkWidget *widget,
        prefs->default_account = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(menuitem)));
 
        prefs->color = dialog->item->prefs->color;
-       if (prefs->color > 0) {
-               GdkColor gdk_color;
-
-               dialog->item->color_style = gtk_style_copy(gtk_widget_get_default_style());
-               dialog->item->color_style->fg[GTK_STATE_NORMAL] = gdk_color;
-
-               /* update folder view */
+       /* update folder view */
+       if (prefs->color > 0)
                folderview_update_item(dialog->item, FALSE);
-       }
 
        prefs_folder_item_save_config(dialog->item);
        prefs_folder_item_destroy(dialog);
index 27347a9..e6d8101 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "folder.h"
 #include <glib.h>
-#include <gtk/gtk.h>
 #include <sys/types.h>
 
 struct _PrefsFolderItem {