Mercurial > geeqie
diff src/layout_util.c @ 273:e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
separate files
author | nadvornik |
---|---|
date | Tue, 08 Apr 2008 20:56:50 +0000 |
parents | c1d7b6d5f228 |
children | 04abf5b160eb |
line wrap: on
line diff
--- a/src/layout_util.c Tue Apr 08 17:26:13 2008 +0000 +++ b/src/layout_util.c Tue Apr 08 20:56:50 2008 +0000 @@ -593,7 +593,38 @@ { LayoutWindow *lw = data; - layout_image_overlay_toggle(lw); + 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); + } +} + +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) +{ + 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) @@ -1086,6 +1117,8 @@ { "FullScreen", NULL, N_("F_ull screen"), "F", NULL, CB(layout_menu_fullscreen_cb) }, { "ImageOverlay", NULL, N_("_Image Overlay"), "I", NULL, CB(layout_menu_overlay_cb) }, + { "HistogramChan", NULL, N_("Histogram _channels"), "K", NULL, CB(layout_menu_histogram_chan_cb) }, + { "HistogramLog", NULL, N_("Histogram _log mode"), "J", NULL, CB(layout_menu_histogram_log_cb) }, { "HideTools", NULL, N_("_Hide file list"), "<control>H", NULL, CB(layout_menu_hide_cb) }, { "SlideShow", NULL, N_("Toggle _slideshow"),"S", NULL, CB(layout_menu_slideshow_cb) }, { "Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "R", NULL, CB(layout_menu_refresh_cb) }, @@ -1220,6 +1253,8 @@ " <separator/>" " <menuitem action='FolderTree'/>" " <menuitem action='ImageOverlay'/>" +" <menuitem action='HistogramChan'/>" +" <menuitem action='HistogramLog'/>" " <menuitem action='FullScreen'/>" " <separator/>" " <menuitem action='FloatTools'/>"