summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-01-22 20:08:10 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-01-22 20:08:10 +0100
commitda92889e88a89e48cbcce134b6afa7c504e7569e (patch)
tree9a3592740656f0491742e9b296f8cb539bf3ad8c /src
parent92123b141236c680e00c3460b93de46edacfda0a (diff)
Add --zoom fill as equivalent to --auto-zoom
Diffstat (limited to 'src')
-rw-r--r--src/menu.c7
-rw-r--r--src/options.c9
-rw-r--r--src/options.h5
-rw-r--r--src/winwidget.c2
4 files changed, 17 insertions, 6 deletions
diff --git a/src/menu.c b/src/menu.c
index 2ef2dc7..1e81cd6 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1436,7 +1436,10 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, void *data)
break;
case CB_OPT_AUTO_ZOOM:
MENU_ITEM_TOGGLE(i);
- opt.auto_zoom = MENU_ITEM_IS_ON(i) ? 1 : 0;
+ if (MENU_ITEM_IS_ON(i))
+ opt.zoom_mode = ZOOM_MODE_FILL;
+ else
+ opt.zoom_mode = 0;
winwidget_rerender_all(1, 1);
break;
}
@@ -1488,7 +1491,7 @@ static feh_menu *feh_menu_func_gen_options(feh_menu * m)
mm = feh_menu_new();
mm->name = estrdup("OPTIONS");
mm->fehwin = m->fehwin;
- feh_menu_add_toggle_entry(mm, "Auto-Zoom", NULL, NULL, CB_OPT_AUTO_ZOOM, NULL, NULL, opt.auto_zoom);
+ feh_menu_add_toggle_entry(mm, "Auto-Zoom", NULL, NULL, CB_OPT_AUTO_ZOOM, NULL, NULL, (opt.zoom_mode == ZOOM_MODE_FILL));
feh_menu_add_toggle_entry(mm, "Freeze Window Size", NULL, NULL,
CB_OPT_FREEZE_WINDOW, NULL, NULL, opt.geom_flags);
feh_menu_add_toggle_entry(mm, "Fullscreen", NULL, NULL,
diff --git a/src/options.c b/src/options.c
index bf2f6c0..2ca04b5 100644
--- a/src/options.c
+++ b/src/options.c
@@ -523,7 +523,7 @@ static void feh_parse_option_array(int argc, char **argv)
opt.full_screen = 1;
break;
case 'Z':
- opt.auto_zoom = 1;
+ opt.zoom_mode = ZOOM_MODE_FILL;
break;
case 'U':
opt.loadables = 1;
@@ -693,7 +693,12 @@ static void feh_parse_option_array(int argc, char **argv)
opt.menu_style = estrdup(optarg);
break;
case 205:
- opt.default_zoom = atoi(optarg);
+ if (!strcmp("fill", optarg))
+ opt.zoom_mode = ZOOM_MODE_FILL;
+ else if (!strcmp("max", optarg))
+ opt.zoom_mode = ZOOM_MODE_MAX;
+ else
+ opt.default_zoom = atoi(optarg);
break;
case 206:
opt.screen_clip = 0;
diff --git a/src/options.h b/src/options.h
index 966169a..283cf10 100644
--- a/src/options.h
+++ b/src/options.h
@@ -27,6 +27,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef OPTIONS_H
#define OPTIONS_H
+#define ZOOM_MODE_FILL 1
+#define ZOOM_MODE_MAX 2
+
struct __fehoptions {
unsigned char multiwindow;
unsigned char montage;
@@ -51,7 +54,6 @@ struct __fehoptions {
unsigned char randomize;
unsigned char jump_on_resort;
unsigned char full_screen;
- unsigned char auto_zoom;
unsigned char draw_filename;
unsigned char list;
unsigned char quiet;
@@ -120,6 +122,7 @@ struct __fehoptions {
unsigned int geom_w;
unsigned int geom_h;
int default_zoom;
+ int zoom_mode;
unsigned char adjust_reload;
unsigned char mode;
diff --git a/src/winwidget.c b/src/winwidget.c
index 81f9ab6..8192700 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -426,7 +426,7 @@ void winwidget_render_image(winwidget winwid, int resize, int alias)
smaller = ((winwid->im_w < max_w)
&& (winwid->im_h < max_h));
- if (!smaller || opt.auto_zoom) {
+ if (!smaller || (opt.zoom_mode == ZOOM_MODE_FILL)) {
double ratio = 0.0;
/* Image is larger than the screen (so wants shrinking), or it's