diff options
-rwxr-xr-x | fbgs | 1 | ||||
-rw-r--r-- | fbi.c | 10 | ||||
-rw-r--r-- | fbiconfig.c | 5 | ||||
-rw-r--r-- | fbiconfig.h | 2 |
4 files changed, 17 insertions, 1 deletions
@@ -86,6 +86,7 @@ while test "$opt" = "1"; do -a | --autozoom | \ --autoup | --noautoup | \ --autodown | --noautodown | \ + --autoonce | --noautoonce | \ --fitwidth | --nofitwidth | \ --readahead | --noreadahead | \ -v | --verbose | --noverbose | \ @@ -136,6 +136,7 @@ static float fbgamma = 1; /* Command line options. */ int autodown; int autoup; +int autoonce; int comments; int transparency = 40; int timeout; @@ -150,6 +151,9 @@ int perfmon = 0; static char *fontname = NULL; static FT_Face face; +/* scaling */ +static float globalscale = 0; + /* ---------------------------------------------------------------------- */ /* fwd declarations */ @@ -1343,6 +1347,7 @@ static void flist_img_scale(struct flist *f, float scale, int prefetch) } } f->scale = scale; + globalscale = scale; } static void flist_img_load(struct flist *f, int prefetch) @@ -1370,7 +1375,9 @@ static void flist_img_load(struct flist *f, int prefetch) if (!f->seen) { scale = 1; - if (autoup || autodown) { + if (autoonce && globalscale != 0) { + scale = globalscale; + } else if (autoup || autodown) { scale = auto_scale(f->fimg); if (scale < 1 && !autodown) scale = 1; @@ -1454,6 +1461,7 @@ main(int argc, char *argv[]) once = GET_ONCE(); autoup = GET_AUTO_UP(); autodown = GET_AUTO_DOWN(); + autoonce = GET_AUTO_ONCE(); fitwidth = GET_FIT_WIDTH(); statusline = GET_VERBOSE(); textreading = GET_TEXT_MODE(); diff --git a/fbiconfig.c b/fbiconfig.c index fb41f08..e8b62c4 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -65,6 +65,11 @@ struct cfg_cmdline fbi_cfg[] = { .option = { O_FIT_WIDTH }, .yesno = 1, .desc = " use width only for autoscaling", + },{ + .cmdline = "autoonce", + .option = { O_AUTO_ONCE }, + .yesno = 1, + .desc = " autoscale only once", },{ .letter = 'v', diff --git a/fbiconfig.h b/fbiconfig.h index 3abdb6d..bb9ffe3 100644 --- a/fbiconfig.h +++ b/fbiconfig.h @@ -12,6 +12,7 @@ #define O_AUTO_UP O_OPTIONS, "auto-up" #define O_AUTO_DOWN O_OPTIONS, "auto-down" +#define O_AUTO_ONCE O_OPTIONS, "auto-once" #define O_FIT_WIDTH O_OPTIONS, "fit-width" #define O_QUIET O_OPTIONS, "quiet" #define O_VERBOSE O_OPTIONS, "verbose" @@ -44,6 +45,7 @@ #define GET_AUTO_UP() cfg_get_bool(O_AUTO_UP, 0) #define GET_AUTO_DOWN() cfg_get_bool(O_AUTO_DOWN, 0) +#define GET_AUTO_ONCE() cfg_get_bool(O_AUTO_ONCE, 0) #define GET_FIT_WIDTH() cfg_get_bool(O_FIT_WIDTH, 0) #define GET_QUIET() cfg_get_bool(O_QUIET, 0) #define GET_VERBOSE() cfg_get_bool(O_VERBOSE, 1) |