changeset 482:75b7154e6435

Use image_osd_toggle() in layout_menu_overlay_cb(). Drop layout_image_overlay_update().
author zas_
date Tue, 22 Apr 2008 09:01:29 +0000
parents 67a612985686
children c9e3baeda1b1
files src/image-overlay.c src/layout.c src/layout_image.c src/layout_image.h src/layout_util.c
diffstat 5 files changed, 9 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-overlay.c	Tue Apr 22 08:53:07 2008 +0000
+++ b/src/image-overlay.c	Tue Apr 22 09:01:29 2008 +0000
@@ -108,13 +108,19 @@
 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)
--- a/src/layout.c	Tue Apr 22 08:53:07 2008 +0000
+++ b/src/layout.c	Tue Apr 22 09:01:29 2008 +0000
@@ -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 @@
 
 		text = buf;
 
-		layout_image_overlay_update(lw);
+		image_osd_update(lw->image);
 		}
 
 	gtk_label_set_text(GTK_LABEL(lw->info_status), text);
--- a/src/layout_image.c	Tue Apr 22 08:53:07 2008 +0000
+++ b/src/layout_image.c	Tue Apr 22 09:01:29 2008 +0000
@@ -50,13 +50,6 @@
 	image_osd_toggle(lw->image);
 }
 
-void layout_image_overlay_update(LayoutWindow *lw)
-{
-	if (!lw) return;
-
-	image_osd_update(lw->image);
-}
-
 /*
  *----------------------------------------------------------------------------
  * full screen
--- a/src/layout_image.h	Tue Apr 22 08:53:07 2008 +0000
+++ b/src/layout_image.h	Tue Apr 22 09:01:29 2008 +0000
@@ -76,8 +76,6 @@
 
 
 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);
--- a/src/layout_util.c	Tue Apr 22 08:53:07 2008 +0000
+++ b/src/layout_util.c	Tue Apr 22 09:01:29 2008 +0000
@@ -550,22 +550,7 @@
 {
 	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 @@
 	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 @@
 	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)