Use image_osd_toggle() in layout_menu_overlay_cb().
authorLaurent Monin <geeqie@norz.org>
Tue, 22 Apr 2008 09:01:29 +0000 (09:01 +0000)
committerLaurent Monin <geeqie@norz.org>
Tue, 22 Apr 2008 09:01:29 +0000 (09:01 +0000)
Drop layout_image_overlay_update().

src/image-overlay.c
src/layout.c
src/layout_image.c
src/layout_image.h
src/layout_util.c

index 662cd16..f2b9eb3 100644 (file)
@@ -108,13 +108,19 @@ gint image_osd_histogram_onoff_status(ImageWindow *imd)
 void image_osd_histogram_chan_toggle(ImageWindow *imd)
 {
        if (imd->histogram)
+               {
                histogram_set_channel(imd->histogram, (histogram_get_channel(imd->histogram) +1)%HCHAN_COUNT);
+               image_osd_update(imd);
+               }
 }
 
 void image_osd_histogram_log_toggle(ImageWindow *imd)
 {
        if (imd->histogram)
+               {
                histogram_set_mode(imd->histogram, !histogram_get_mode(imd->histogram));
+               image_osd_update(imd);
+               }
 }
 
 void image_osd_toggle(ImageWindow *imd)
index 3d1b0d3..a924f0d 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "image.h"
 #include "color-man.h"
+#include "image-overlay.h"
 #include "layout_config.h"
 #include "layout_image.h"
 #include "layout_util.h"
@@ -559,7 +560,7 @@ void layout_status_update_info(LayoutWindow *lw, const gchar *text)
 
                text = buf;
 
-               layout_image_overlay_update(lw);
+               image_osd_update(lw->image);
                }
 
        gtk_label_set_text(GTK_LABEL(lw->info_status), text);
index ed90b10..87bc8ee 100644 (file)
@@ -50,13 +50,6 @@ void layout_image_overlay_toggle(LayoutWindow *lw)
        image_osd_toggle(lw->image);
 }
 
-void layout_image_overlay_update(LayoutWindow *lw)
-{
-       if (!lw) return;
-
-       image_osd_update(lw->image);
-}
-
 /*
  *----------------------------------------------------------------------------
  * full screen
index a0ef3a0..acb6818 100644 (file)
@@ -76,8 +76,6 @@ gint layout_image_slideshow_paused(LayoutWindow *lw);
 
 
 void layout_image_overlay_toggle(LayoutWindow *lw);
-void layout_image_overlay_update(LayoutWindow *lw);
-
 
 void layout_image_maint_renamed(LayoutWindow *lw, FileData *fd);
 void layout_image_maint_removed(LayoutWindow *lw, FileData *fd);
index a563682..cf5e014 100644 (file)
@@ -550,22 +550,7 @@ static void layout_menu_overlay_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
 
-       if (image_osd_get(lw->image, NULL, NULL))
-               {
-               if (image_osd_histogram_onoff_status(lw->image))
-                       {
-                       image_osd_histogram_onoff_toggle(lw->image, 0);
-                       layout_image_overlay_update(lw);
-                       }
-               else
-                       layout_image_overlay_toggle(lw);
-               }
-       else
-               {
-               layout_image_overlay_toggle(lw);
-               image_osd_histogram_onoff_toggle(lw->image, 1);
-               layout_image_overlay_update(lw);
-               }
+       image_osd_toggle(lw->image);
 }
 
 static void layout_menu_histogram_chan_cb(GtkAction *action, gpointer data)
@@ -573,7 +558,6 @@ static void layout_menu_histogram_chan_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        image_osd_histogram_chan_toggle(lw->image);
-       layout_image_overlay_update(lw);
 }
 
 static void layout_menu_histogram_log_cb(GtkAction *action, gpointer data)
@@ -581,7 +565,6 @@ static void layout_menu_histogram_log_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        image_osd_histogram_log_toggle(lw->image);
-       layout_image_overlay_update(lw);
 }
 
 static void layout_menu_refresh_cb(GtkAction *action, gpointer data)