Skip to content

Commit

Permalink
Fix osd zoom level refreshing (it was broken since some times).
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Jan 17, 2010
1 parent 615b0fb commit 6088a5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
3 changes: 0 additions & 3 deletions src/image-overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v
else
{
data = g_strdup(g_hash_table_lookup(vars, name));
if (data && strcmp(name, "zoom") == 0) imd->overlay_show_zoom = TRUE;
if (!data)
data = metadata_read_string(imd->image_fd, name, METADATA_FORMATTED);
}
Expand Down Expand Up @@ -865,8 +864,6 @@ static gboolean image_osd_update_cb(gpointer data)
{
OverlayStateData *osd = data;

osd->imd->overlay_show_zoom = FALSE;

if (osd->show & OSD_SHOW_INFO)
{
/* redraw when the image was changed,
Expand Down
18 changes: 9 additions & 9 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ static void image_update_util(ImageWindow *imd)
if (imd->func_update) imd->func_update(imd, imd->data_update);
}

static void image_zoom_cb(PixbufRenderer *pr, gdouble zoom, gpointer data)
{
ImageWindow *imd = data;

if (imd->title_show_zoom) image_update_title(imd);
if (imd->overlay_show_zoom) image_osd_update(imd);

image_update_util(imd);
}

static void image_complete_util(ImageWindow *imd, gboolean preload)
{
Expand Down Expand Up @@ -140,6 +131,15 @@ static void image_state_unset(ImageWindow *imd, ImageState state)
if (imd->func_state) imd->func_state(imd, state, imd->data_state);
}

static void image_zoom_cb(PixbufRenderer *pr, gdouble zoom, gpointer data)
{
ImageWindow *imd = data;

if (imd->title_show_zoom) image_update_title(imd);
image_state_set(imd, IMAGE_STATE_IMAGE);
image_update_util(imd);
}

/*
*-------------------------------------------------------------------
* misc
Expand Down
2 changes: 0 additions & 2 deletions src/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,6 @@ struct _ImageWindow
gboolean delay_flip;
gint orientation;
gboolean desaturate;

gboolean overlay_show_zoom; /* set to true if overlay is showing zoom ratio */
};

#define FILEDATA_MARKS_SIZE 6
Expand Down

0 comments on commit 6088a5d

Please sign in to comment.