if 'n' is pressed, zoom is set to 100% and resize window to image size

This commit is contained in:
Vincent Torri 2021-04-29 20:53:12 +02:00
parent 500fda396c
commit 7e63809e79
2 changed files with 14 additions and 0 deletions

View File

@ -65,6 +65,7 @@ Original size | Ctrl-0
Best fit | b
Zoom in | +
Zoom out | -
Resize window to real image size (implies zoom 100%) | n
Manage Settings | s
Show EXIF data | e
Copy file in clipboard | Ctrl-c

View File

@ -123,6 +123,19 @@ void entice_key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
entice->exif_shown = EINA_TRUE;
}
}
else if (!strcmp(ev->keyname, "n"))
{
int w;
int h;
entice_image_size_get(entice->image, &w, &h);
if ((w > 1) && (h > 1))
{
entice_image_zoom_set(entice->image, 100);
entice_image_update(entice->image);
evas_object_resize(win, w, h);
}
}
else if (!strcmp(ev->key, "Escape"))
{
fprintf(stderr, "Esc !!!!\n");