works on pixmap theming (most of this code is from Paul)
authorCarsten Schurig <Carsten.Schurig@web.de>
Tue, 12 Feb 2002 21:57:15 +0000 (21:57 +0000)
committerCarsten Schurig <Carsten.Schurig@web.de>
Tue, 12 Feb 2002 21:57:15 +0000 (21:57 +0000)
ChangeLog.claws
configure.in
src/folderview.c
src/mainwindow.c
src/mainwindow.h
src/prefs_common.c
src/stock_pixmap.c
src/summaryview.c

index c0e9a4f212d1fc9acd6a58ebef1ebf816d40fe9c..20a7008991925c4144a7e43fd61c3295dc2505e1 100644 (file)
@@ -3,6 +3,7 @@
          src/mainwindow.[ch]
          src/stock_pixmap.c
          src/summaryview.c
+         src/prefs_common.c
                - refreshing after changing pixmap theme better
                  now (thanks Paul)
                - wanted to remove some mem leaks, but alfons was
index 0d4296a848c764ac6bc270b946392d84f0f5e083..bb4966f30c050226f94a429ab389e07b72c4a50d 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws68
+EXTRA_VERSION=claws69
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index a95f1fd0ea5bb4c392a15dbbcb1d59ee545942c0..6a447ef8086d1d001af5c23d98b6080fac4e72d7 100644 (file)
@@ -2502,8 +2502,4 @@ void folderview_reflect_prefs_pixmap_theme(FolderView *folderview)
 {
        folderview_init(folderview);
        folderview_set_all();
-       
-       summary_write_cache(folderview->summaryview);
-
-       folderview_select(folderview, folderview->summaryview->folder_item);
 }
index ef41ed81e95e38c2e5baf488b8be9a9830dd5264..12191d54109f111c9f0af04c0527fd24bb6ca134 100644 (file)
@@ -1082,35 +1082,27 @@ void main_window_reflect_prefs_all(void)
                main_window_set_menu_sensitive(mainwin);
                main_window_set_toolbar_sensitive(mainwin);
 
+               /* pixmap themes */
+               gtk_container_remove(GTK_CONTAINER(mainwin->handlebox), GTK_WIDGET(mainwin->toolbar));
+               mainwin->toolbar = NULL;
+               main_window_toolbar_create(mainwin, mainwin->handlebox);
+               set_toolbar_style(mainwin);
+               folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
+               summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
+
                if (prefs_common.immediate_exec)
                        gtk_widget_hide(mainwin->exec_btn);
                else
                        gtk_widget_show(mainwin->exec_btn);
 
+               activate_compose_button(mainwin, prefs_common.toolbar_style, mainwin->compose_btn_type);
+
                summary_redisplay_msg(mainwin->summaryview);
                headerview_set_visibility(mainwin->messageview->headerview,
                                          prefs_common.display_header_pane);
        }
 }
 
-void main_window_reflect_prefs_pixmap_theme(void)
-{
-       GList *cur;
-       MainWindow *mainwin;
-
-       for (cur = mainwin_list; cur != NULL; cur = cur->next) {
-               mainwin = (MainWindow *)cur->data;
-               gtk_container_remove(GTK_CONTAINER(mainwin->handlebox), GTK_WIDGET(mainwin->toolbar));
-               mainwin->toolbar = NULL;
-               main_window_toolbar_create(mainwin, mainwin->handlebox);
-               set_toolbar_style(mainwin);
-               main_window_set_toolbar_sensitive(mainwin);
-               folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
-               summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
-       }
-}
-
-
 void main_window_set_summary_column(void)
 {
        GList *cur;
@@ -3026,4 +3018,5 @@ static void set_toolbar_style(MainWindow *mainwin)
                gtk_widget_show(mainwin->handlebox);
                gtk_widget_queue_resize(mainwin->handlebox);
        }
-}
\ No newline at end of file
+}
+
index 2ebbe0b4d46b19494471d3e9ffd157371da1cd81..94ade66615cd8fd2052b709299a4fc50e00fa2de 100644 (file)
@@ -149,7 +149,6 @@ void main_window_lock                       (MainWindow     *mainwin);
 void main_window_unlock                        (MainWindow     *mainwin);
 
 void main_window_reflect_prefs_all                     (void);
-void main_window_reflect_prefs_pixmap_theme    (void);
 void main_window_set_summary_column    (void);
 void main_window_set_account_menu      (GList          *account_list);
 void main_window_separation_change     (MainWindow     *mainwin,
index 1f41d898219be746f63222b5ccc3cc2d41080d67..017f47f51050666db06e89bdb84d4bd04e43004e 100644 (file)
@@ -3995,7 +3995,6 @@ static void prefs_common_apply(void)
 {
        prefs_set_data_from_dialog(param);
        main_window_reflect_prefs_all();
-       main_window_reflect_prefs_pixmap_theme();
        compose_reflect_prefs_pixmap_theme();
        prefs_common_save_config();
 
index 3931a8da51cd96331e715952c51555aa9eea87b2..126fbac448d397a66d258bc0dbbab56915eae9ca 100644 (file)
@@ -179,8 +179,10 @@ GtkWidget *stock_pixmap_widget(GtkWidget *window, StockPixmap icon)
        g_return_val_if_fail(window != NULL, NULL);
        g_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, NULL);
 
-       stock_pixmap_gdk(window, icon, &pixmap, &mask);
-       return gtk_pixmap_new(pixmap, mask);
+       if (stock_pixmap_gdk(window, icon, &pixmap, &mask) != -1)
+               return gtk_pixmap_new(pixmap, mask);
+       
+       return NULL;
 }
 
 /* create GdkPixmap if it has not created yet */
@@ -209,7 +211,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
                                                             pix_d->file,
                                                             ".xpm",
                                                             NULL);
-                               if (file_exist(icon_file_name, FALSE))
+                               if (is_file_exist(icon_file_name))
                                        PIXMAP_CREATE_FROM_FILE(window, pix, pix_d->mask, icon_file_name);
                                if (pix) 
                                        pix_d->icon_path = prefs_common.pixmap_theme_path;
@@ -260,7 +262,7 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
                        
                        for (i = 0; i < N_STOCK_PIXMAPS; i++) {
                                filetoexist = g_strconcat(fullentry, G_DIR_SEPARATOR_S, pixmaps[i].file, ".xpm", NULL);
-                               if (file_exist(filetoexist, FALSE)) {
+                               if (is_file_exist(filetoexist)) {
                                        *list = g_list_append(*list, fullentry);
                                        break;
                                }
@@ -292,7 +294,7 @@ GList *stock_pixmap_themes_list_new(void)
        
        stock_pixmap_find_themes_in_dir(&list, userthemes);
        stock_pixmap_find_themes_in_dir(&list, systemthemes);
-       
+
        g_free(userthemes);
        g_free(systemthemes);
        return list;
index e04663cc8f67780b26f7fb4e79bda1b3a5db4ec5..9221c0698df19831df4c0667d13d53b36fa3062e 100644 (file)
@@ -5044,9 +5044,7 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCTreeNode *node;
-       GtkWidget *pixmap;
-
-       summary_write_cache(summaryview);
+       GtkWidget *pixmap; 
 
        gtk_widget_destroy(summaryview->folder_pixmap);
 
@@ -5066,9 +5064,10 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
        gtk_box_pack_start(GTK_BOX(summaryview->hbox), pixmap, FALSE, FALSE, 4);
        gtk_box_reorder_child(GTK_BOX(summaryview->hbox), pixmap, 0);
        gtk_widget_show(pixmap);
-       summaryview->folder_pixmap = pixmap;
-       
-       summary_show(summaryview, summaryview->folder_item, FALSE);
+       summaryview->folder_pixmap = pixmap; 
+
+       folderview_unselect(summaryview->folderview);
+       folderview_select(summaryview->folderview, summaryview->folder_item);
 }