summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-10-17 21:06:17 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-10-17 21:06:17 +0200
commit421139a86bd82b5656e025512bdf2914509fa8ca (patch)
tree7d749b7cde15f6696ec138be4464a98c81d50a51
parent215732ab1a17e871945c015e039d6bdf41d33995 (diff)
parent4b2cd1835a18dc0445c5ab4c14f80d1b664e626d (diff)
Merge branch 'ErnieE5-master'
-rw-r--r--Makefile4
-rw-r--r--man/feh.pre5
-rw-r--r--src/keyevents.c17
-rw-r--r--src/options.h1
4 files changed, 22 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 258461e..7fd5c67 100644
--- a/Makefile
+++ b/Makefile
@@ -51,8 +51,8 @@ install-man:
install-doc:
@echo installing docs to ${doc_dir}
@mkdir -p ${doc_dir}
- @cp AUTHORS ChangeLog README TODO ${doc_dir}
- @chmod 644 ${doc_dir}/AUTHORS ${doc_dir}/ChangeLog ${doc_dir}/README \
+ @cp AUTHORS ChangeLog README.md TODO ${doc_dir}
+ @chmod 644 ${doc_dir}/AUTHORS ${doc_dir}/ChangeLog ${doc_dir}/README.md \
${doc_dir}/TODO
install-bin:
diff --git a/man/feh.pre b/man/feh.pre
index eff1241..407d96f 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -1414,6 +1414,11 @@ Zoom to 100%
.
Zoom to fit the window size
.
+.It ! Bq zoom_fill
+.
+Zoom to fill the window size like
+.Cm --bg-fill
+.
.El
.
.Ss MENU KEYS
diff --git a/src/keyevents.c b/src/keyevents.c
index e691eaa..7bfacc8 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -134,13 +134,14 @@ void init_keyevents(void) {
feh_set_kb(&keys.zoom_out , 0, XK_Down , 0, XK_KP_Subtract,0, 0);
feh_set_kb(&keys.zoom_default, 0, XK_KP_Multiply, 0, XK_asterisk,0, 0);
feh_set_kb(&keys.zoom_fit , 0, XK_KP_Divide , 0, XK_slash , 0, 0);
+ feh_set_kb(&keys.zoom_fill , 0, XK_exclam , 0, 0 , 0, 0);
feh_set_kb(&keys.size_to_image, 0, XK_w , 0, 0 , 0, 0);
feh_set_kb(&keys.render , 0, XK_KP_Begin , 0, XK_R , 0, 0);
feh_set_kb(&keys.toggle_actions, 0, XK_a, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_aliasing, 0, XK_A, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_filenames, 0, XK_d, 0, 0, 0, 0);
#ifdef HAVE_LIBEXIF
- feh_set_kb(&keys.toggle_exif, 0, XK_e, 0, 0, 0, 0);
+ feh_set_kb(&keys.toggle_exif, 0, XK_e, 0, 0, 0, 0);
#endif
feh_set_kb(&keys.toggle_info, 0, XK_i, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_pointer, 0, XK_o, 0, 0, 0, 0);
@@ -439,6 +440,8 @@ fehkey *feh_str_to_kb(char *action)
return &keys.zoom_default;
else if (!strcmp(action, "zoom_fit"))
return &keys.zoom_fit;
+ else if (!strcmp(action, "zoom_fill"))
+ return &keys.zoom_fill;
else if (!strcmp(action, "size_to_image"))
return &keys.size_to_image;
else if (!strcmp(action, "render"))
@@ -653,6 +656,14 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
winwidget_center_image(winwid);
winwidget_render_image(winwid, 0, 0);
}
+ else if (feh_is_kp(&keys.zoom_fill, state, keysym, button)) {
+ int save_zoom = opt.zoom_mode;
+ opt.zoom_mode = ZOOM_MODE_FILL;
+ feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h);
+ winwidget_center_image(winwid);
+ winwidget_render_image(winwid, 0, 0);
+ opt.zoom_mode = save_zoom;
+ }
else if (feh_is_kp(&keys.render, state, keysym, button)) {
if (winwid->type == WIN_TYPE_THUMBNAIL)
feh_thumbnail_show_selected();
@@ -677,7 +688,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
opt.draw_exif = !opt.draw_exif;
winwidget_rerender_all(0);
}
-#endif
+#endif
else if (feh_is_kp(&keys.toggle_info, state, keysym, button)) {
opt.draw_info = !opt.draw_info;
winwidget_rerender_all(0);
@@ -777,7 +788,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
}
#endif /* HAVE_LIBXINERAMA */
}
- else if (feh_is_kp(&keys.reload_plus, state, keysym, button)){
+ else if (feh_is_kp(&keys.reload_plus, state, keysym, button)){
if (opt.reload < SLIDESHOW_RELOAD_MAX)
opt.reload++;
else if (opt.verbose)
diff --git a/src/options.h b/src/options.h
index 0dee617..c7ce689 100644
--- a/src/options.h
+++ b/src/options.h
@@ -175,6 +175,7 @@ struct __fehkb {
struct __fehkey zoom_out;
struct __fehkey zoom_default;
struct __fehkey zoom_fit;
+ struct __fehkey zoom_fill;
struct __fehkey render;
struct __fehkey toggle_actions;
struct __fehkey toggle_filenames;