aboutsummaryrefslogtreecommitdiff
path: root/commands.c
Commit message (Collapse)AuthorAgeFilesLines
* Add default key-binding for DRAG_RELATIVE (#117)LuXu2021-10-271-1/+1
| | | | | | | | Ctrl-Button1 now has a relative drag using the XC_fleur cursor. XC_fleur is normally the cursor for "size all" action, which has 4 arrows pointing to 4 directions. Co-authored-by: NRK <nrk@disroot.org>
* Add ability to bind arbitrary functions.Arthur Williams2021-10-131-12/+0
| | | | | | | | | | | | | | | | | | | | | | | Before all the predated commands where kept in an array and their indexes were used in bindings. This meant that users couldn't add their own functions from the config file. Now key/mouse bindings have been changed to to store the function ptr (wrapped in a cmd_t struct to also store the mode) directly instead. General cleanup done in this commit: Defined `MODE_ALL` instead of using magic number. For example, suppose one had bindings like: { 0, XK_q, g_quit, None }, { ShitMask, XK_q, {quit_err}, None } { ControlMask, XK_q, {quit_err, .mode=MODE_IMAGE}, None } The existing binding `q` has been left unchanged and is defined the same way. However, the new hypothetical binding `Shift-q` can be used to call the custom function quit_err in any mode (default). `Ctrl-q` on the other hand will be called only on image mode. Closes #50
* code-style: fix consistency issues all over the codebase (#94)Berke Kocaoğlu2021-10-111-5/+3
| | | | | | | | | | | | | | | * remove duplicate comment * remove empty tabs and blank lines * move macros and globals ontop * comment to seprate function implementation * fix alignment * switch to *argv[] similar to other suckless code * kill all empty last lines * append comment to endif * reuse existing ARRLEN macro * comment fall through * use while (true) everywhere Co-authored-by: NRK <nrk@disroot.org>
* add statusbar message upon key-hander activation (#98)N-R-K2021-10-071-1/+2
| | | | | | | | | Currently when running the key-handler the statusbar shows a "Running key-handler..." message, but there's no indication of the prefix key being pressed. There's a slight functional benefit of this patch in the sense that users can visually tell if the key-handler is listening on input or if the key-handler has been aborted or not.
* Use zoom steps instead of hard-coding levels (#92)Lu Xu2021-09-251-6/+2
| | | | | Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
* add -0 for outputting null-terminated list (#68)N-R-K2021-09-201-1/+1
| | | | | | | | | | | | * add -0 for outputting null-terminated list this doesn't add much, if any, additional complexity to the codebase and can be quite handy for scripting purposes. Closes: https://github.com/nsxiv/nsxiv/issues/67 * Fix typo Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
* Rename, Update Docs and Prepare for Release (#9)Berke Kocaoğlu2021-09-161-5/+5
| | | | | | | Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com> Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Arthur Williams <taaparthur@gmail.com> Co-authored-by: eylles <ed.ylles1997@gmail.com>
* Simplify cg_mark_range furtherBert Münnich2018-06-101-5/+3
|
* Set global markidx whenever a single img is (un)markedBert Münnich2018-06-091-4/+3
| | | | This also sets *markidx* when using the right mouse button in thumbnail mode.
* (Un)mark single image through generic functionBert Münnich2018-06-091-14/+6
|
* Simplify cg_mark_rangeBert Münnich2018-06-091-22/+11
|
* Rename variable toggledidx to markidxBert Münnich2018-06-091-6/+6
|
* Remove unnecessary special cases in cg_mark_rangeBert Münnich2018-06-091-5/+0
|
* Add mark range functionDaniel Lublin2018-06-091-0/+35
| | | | | Sets the marked state of all images ranging from the latest marked/unmarked image to the current image, to the state of that latest toggled image.
* Close image-info explicitlyBert Münnich2018-02-181-1/+4
|
* Use argument to select between two drag methodsphi2018-01-221-6/+15
|
* One header file for type definitions and function declarationsBert Münnich2017-10-161-9/+4
|
* Improve mouse supportBert Münnich2017-10-061-0/+6
| | | | | | | | | | | | None of the mouse mappings uses a keyboard modifier, making it possible to access the most basic features by only using the mouse. Next/previous image with left button depending on cursor position, middle button for dragging, right button for switching to thumnail mode and wheel for zooming. Users can keep the old behaviour by simply not adapting the changes to the buttons array in config.def.h to their config.h file.
* Simplify cursor reset in image modeBert Münnich2017-10-051-1/+1
| | | | | No need to give cursor name. reset_cursor() is now the only place to decide what cursor to fall back to.
* Own win method for mouse cursor locationBert Münnich2017-10-051-6/+4
|
* Mouse drag translates pointer position to image areaBert Münnich2017-10-041-54/+23
| | | | This makes mouse panning more direct and faster.
* Merge djhejna/floatdelayBert Münnich2016-12-011-2/+2
|
* Make navigate_frame command respect a count prefixBert Münnich2015-12-261-0/+2
|
* Revised error handlingBert Münnich2015-10-281-2/+0
| | | | | | | - Functions warn() and die() replaced by GNU-like error(3) function - Register cleanup() with atexit(3) - Functions called by cleanup() are marked with CLEANUP and are not allowed to call exit(3)
* Removed feature test macro definitions from source filesBert Münnich2015-10-281-3/+2
|
* Simplified command argumentsBert Münnich2015-01-111-54/+35
|
* Apply gamma value on thumbnails too; fixes issue #193Bert Münnich2015-01-051-5/+11
|
* Cache out of view thumbnails in the backgroundBert Münnich2015-01-041-1/+1
|
* Use bit-field for boolean flags in fileinfo structBert Münnich2015-01-041-8/+8
|
* Removed obsolete ss_delays array, fixes issue #191Bert Münnich2014-12-221-4/+0
|
* Unified file count variable for image & thumbnail modeBert Münnich2014-09-301-14/+9
|
* Added thumbnail zooming...Bert Münnich2014-09-281-12/+14
| | | | | | - Key mappings +/- are now general commands - Use JPG as thumbnail cache file format instead of PNG - Fixes issue #161
* Revised thumbnail loading...Bert Münnich2014-09-261-1/+2
| | | | | | | - Only load the thumbnails that are currently visible in the window - Unload thumbnails that are leaving the visible area - Much less memory needed, but scrolling is now slower - This also unintentionally fixes issue #86
* Simplified img_frame_animateBert Münnich2014-09-011-1/+1
|
* Fixed segfault in ci_toggle_animation, fixes issue #173Bert Münnich2014-09-011-7/+8
|
* Added command to remove all image marks, bound to Ctrl-m; fixes issue #163Bert Münnich2014-08-171-0/+12
|
* Fixed wrong thumbnail-to-file mappings caused by file deletionsBert Münnich2014-08-161-3/+3
|
* Pass marked files to external key handler in thumbnail mode; fixes issue #135Bert Münnich2014-08-161-1/+1
|
* Count number of marked filesBert Münnich2014-08-161-3/+7
|
* Unified file index variable for image & thumbnail modeBert Münnich2014-08-161-28/+18
|
* Revised handling of GIF animationsBert Münnich2014-07-251-4/+8
| | | | | | - New option `-a`: Play animations at startup - Ctrl-Space toggles animation for all GIF files - Infinite loop for all animations
* Revised command structure and key and mouse button mappingsBert Münnich2014-07-231-177/+139
|
* Use a checkerboard background for alpha layer; fixes issue #138Bert Münnich2014-04-061-9/+8
|
* Removed fit-win-to-img commandBert Münnich2014-02-041-20/+0
|
* Preserve panning when switching images; fixes issue #131Bert Münnich2014-02-041-6/+4
|
* Merged pull request #129Bert Münnich2014-01-311-0/+7
|
* Fixed handling of overloaded key mappingsBert Münnich2014-01-081-77/+77
| | | | | Issue described here: https://bbs.archlinux.org/viewtopic.php?pid=1117294#p1117294
* Slideshow mode is back, in a simplified versionBert Münnich2014-01-041-4/+28
|
* Moved external shell commands into exec/key-handler scriptBert Münnich2014-01-021-66/+0
| | | | | Gets called on all unset key mappings. Arguments are: key combo and current file. Thanks to Francesco Orsenigo (xarvh) for the idea.
* Merge remote-tracking branch 'baskerville/reverse-marks'Bert Münnich2013-11-141-0/+11
|\