[giv] Fixed bug in autocontrast when contrast window is not initially shown.



commit 31b803c684e1444f00307bff2512e994cf247e37
Author: Dov Grobgeld <dov grobgeld gmail com>
Date:   Tue Sep 13 21:39:08 2011 +0300

    Fixed bug in autocontrast when contrast window is not initially shown.

 ChangeLog       |    4 ++++
 src/giv-win.gob |    8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index aec7284..eea73ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-13  Dov Grobgeld  <dov grobgeld gmail com>
+
+        * Added option to turn off autocontrast on image load.
+
 2011-09-06  Dov Grobgeld  <dov grobgeld gmail com>
 
         * plugins/fits.c : Fixed bug in the reading of multi slice fits files.
diff --git a/src/giv-win.gob b/src/giv-win.gob
index ce11047..8b54754 100644
--- a/src/giv-win.gob
+++ b/src/giv-win.gob
@@ -2007,8 +2007,9 @@ static void cb_view_auto_contrast (GtkAction *action, gpointer data)
     GivWin *self = GIV_WIN(data);
 
     selfp->do_auto_contrast = !selfp->do_auto_contrast;
-    giv_contrast_set_do_auto_contrast(GIV_CONTRAST(selfp->w_contrast_view),
-                                      selfp->do_auto_contrast);
+    if (selfp->w_contrast_view)
+        giv_contrast_set_do_auto_contrast(GIV_CONTRAST(selfp->w_contrast_view),
+                                          selfp->do_auto_contrast);
     gtk_check_menu_item_set_active(
         GTK_CHECK_MENU_ITEM(
             gtk_ui_manager_get_widget(selfp->menu_manager,
@@ -2111,7 +2112,8 @@ cb_menu_contrast_view (GtkAction *action, gpointer data)
                      G_CALLBACK(cb_contrast_changed), self);
     g_signal_connect(selfp->w_contrast_view, "destroy",
                      G_CALLBACK(cb_contrast_view_destroy), self);
-
+    giv_contrast_set_do_auto_contrast(GIV_CONTRAST(selfp->w_contrast_view),
+                                      selfp->do_auto_contrast);
     gtk_widget_show_all(selfp->w_contrast_view);
 
     return;



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