Skip to content

Commit

Permalink
Use image_osd_toggle() in layout_menu_overlay_cb().
Browse files Browse the repository at this point in the history
Drop layout_image_overlay_update().
  • Loading branch information
Laurent Monin committed Apr 22, 2008
1 parent 996cf10 commit b38d66e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
6 changes: 6 additions & 0 deletions src/image-overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions src/layout_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/layout_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 1 addition & 18 deletions src/layout_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,38 +550,21 @@ 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)
{
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)
Expand Down

0 comments on commit b38d66e

Please sign in to comment.