Krolyxon
Commit 5c6947c

Branches

Refs →

nsxiv5c6947c

Make imgcursor a config variable.

Previously, the value of imgcursor was determined by where a pointer
binding was set to a ci_cursor_navigate. If it was then the pointer
would change to left/right arrows depending on the position relative to
the window. Now the user has full control of over it which also allows
them to preserve the behavior in case they wrap the function.
Author
Arthur Williams
Date
2021-10-03 13:38 -0700
Committer
N-R-K · 2021-10-13 06:05 +0600
Parent
cd710f5
Commit
5c6947c1c6df76ab8438ac27377559da79ab1eab

+5 −12

2 files changed

  1. M config.def.h +5 −0
  2. M main.c +0 −12
M config.def.h View
@@ -164,4 +164,9 @@ static const button_t buttons[] = {
164164 { 0, 5, g_zoom, -1 },
165165 };
166166
167+/* mouse cursor on left, middle and right part of the window */
168+static const cursor_t imgcursor[3] = {
169+ CURSOR_LEFT, CURSOR_ARROW, CURSOR_RIGHT
170+};
171+
167172 #endif
M main.c View
@@ -92,10 +92,6 @@ timeout_t timeouts[] = {
9292 { { 0, 0 }, false, clear_resize },
9393 };
9494
95−cursor_t imgcursor[3] = {
96− CURSOR_ARROW, CURSOR_ARROW, CURSOR_ARROW
97−};
98−
9995 /**************************
10096 function implementations
10197 **************************/
@@ -917,14 +913,6 @@ int main(int argc, char *argv[])
917913 filecnt = fileidx;
918914 fileidx = options->startnum < filecnt ? options->startnum : 0;
919915
920− for (i = 0; i < ARRLEN(buttons); i++) {
921− if (buttons[i].cmd == i_cursor_navigate) {
922− imgcursor[0] = CURSOR_LEFT;
923− imgcursor[2] = CURSOR_RIGHT;
924− break;
925− }
926− }
927−
928916 win_init(&win);
929917 img_init(&img, &win);
930918 arl_init(&arl);