[pan2] fix group colors for good



commit 485c98f9fd6466e1f7e730407d0fd09a993d9852
Author: Heinrich MÃller <henmull src gnome org>
Date:   Wed Jun 13 19:07:28 2012 +0200

    fix group colors for good

 pan/gui/group-pane.cc         |    1 +
 pan/gui/group-prefs-dialog.cc |   21 +++++++++++++--------
 pan/gui/group-prefs-dialog.h  |    1 +
 3 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index 6f9f0f5..39ec3ff 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -1019,5 +1019,6 @@ void
 GroupPane :: on_prefs_color_changed (const StringView& key, const GdkColor&)
 {
   if (key == "group-color")
+    refresh_font ();
     refresh_dirty_groups ();
 }
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index 2c9fa85..41fdc98 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -131,13 +131,6 @@ GroupPrefsDialog :: save_from_gui ()
   }
 #endif
 
-  GdkColor col;
-  gtk_color_button_get_color (GTK_COLOR_BUTTON(_group_color), &col);
-  foreach_const (quarks_v, _groups, it)
-  {
-    _group_prefs.set_group_color(*it, col);
-  }
-
   _group_prefs.save () ;
 
 }
@@ -238,6 +231,18 @@ namespace
 //	  dialog->_color = col;
 //  }
 
+  void color_set_cb (GtkColorButton* b, gpointer p)
+  {
+    GroupPrefsDialog* dialog = static_cast<GroupPrefsDialog*>(p);
+    GdkColor val;
+    gtk_color_button_get_color (b, &val);
+    {
+      foreach_const (quarks_v, dialog->get_groups(), it)
+        dialog->get_prefs().set_group_color(*it, val);
+    }
+  }
+
+
   GtkWidget* new_color_button (const Quark& group, GroupPrefs& prefs, GroupPrefsDialog* dialog, GtkWidget* w)
   {
     GdkColor color;
@@ -247,7 +252,7 @@ namespace
 
     const GdkColor& val (prefs.get_group_color (group, GroupPrefs::color_to_string(color)));
     GtkWidget * b = gtk_color_button_new_with_color (&val);
-//    g_signal_connect (b, "color-set", G_CALLBACK(color_set_cb), dialog);
+    g_signal_connect (b, "color-set", G_CALLBACK(color_set_cb), dialog);
     return b;
   }
 
diff --git a/pan/gui/group-prefs-dialog.h b/pan/gui/group-prefs-dialog.h
index 86e06ac..fa70802 100644
--- a/pan/gui/group-prefs-dialog.h
+++ b/pan/gui/group-prefs-dialog.h
@@ -50,6 +50,7 @@ namespace pan
       GtkWidget    * _spellchecker_language;
       GtkWidget    * _group_color;
       GtkWidget    * _save_path;
+      GdkColor _color;
 
     private:
       static void response_cb (GtkDialog*, int, gpointer);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]