in do_yesno(), make mouse clicks on the Yes/No/All shortcuts work properly when the MORE_SPACE flag is set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3075 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
d420b5a50c
commit
305c6459e9
|
@ -43,6 +43,9 @@ CVS code -
|
||||||
edit_add()
|
edit_add()
|
||||||
- Rename to edit_draw(), and rename parameter yval to line.
|
- Rename to edit_draw(), and rename parameter yval to line.
|
||||||
(DLR)
|
(DLR)
|
||||||
|
do_yesno()
|
||||||
|
- Make mouse clicks on the Yes/No/All shortcuts work properly
|
||||||
|
when the MORE_SPACE flag is set. (DLR)
|
||||||
- doc/nanorc.sample:
|
- doc/nanorc.sample:
|
||||||
- Tweak the "c-file" regex for characters to properly accept
|
- Tweak the "c-file" regex for characters to properly accept
|
||||||
'\"' and reject '"' and '''. (DLR)
|
'\"' and reject '"' and '''. (DLR)
|
||||||
|
|
21
src/winio.c
21
src/winio.c
|
@ -2933,17 +2933,24 @@ int do_yesno(bool all, const char *msg)
|
||||||
|
|
||||||
if (mouse_x != -1 && mouse_y != -1 && !ISSET(NO_HELP) &&
|
if (mouse_x != -1 && mouse_y != -1 && !ISSET(NO_HELP) &&
|
||||||
wenclose(bottomwin, mouse_y, mouse_x) &&
|
wenclose(bottomwin, mouse_y, mouse_x) &&
|
||||||
mouse_x < (width * 2) && mouse_y >= editwinrows + 3) {
|
mouse_x < (width * 2) && mouse_y - (2 -
|
||||||
|
no_more_space()) - editwinrows - 1 >= 0) {
|
||||||
int x = mouse_x / width;
|
int x = mouse_x / width;
|
||||||
/* Did we click in the first column of shortcuts, or
|
/* Calculate the x-coordinate relative to the
|
||||||
* the second? */
|
* two columns of the Yes/No/All shortcuts in
|
||||||
int y = mouse_y - editwinrows - 3;
|
* bottomwin. */
|
||||||
/* Did we click in the first row of shortcuts? */
|
int y = mouse_y - (2 - no_more_space()) -
|
||||||
|
editwinrows - 1;
|
||||||
|
/* Calculate the y-coordinate relative to the
|
||||||
|
* beginning of the Yes/No/All shortcuts in
|
||||||
|
* bottomwin, i.e, with the sizes of topwin,
|
||||||
|
* edit, and the first line of bottomwin
|
||||||
|
* subtracted out. */
|
||||||
|
|
||||||
assert(0 <= x && x <= 1 && 0 <= y && y <= 1);
|
assert(0 <= x && x <= 1 && 0 <= y && y <= 1);
|
||||||
|
|
||||||
/* x = 0 means they clicked Yes or No.
|
/* x == 0 means they clicked Yes or No. y == 0 means
|
||||||
* y = 0 means Yes or All. */
|
* Yes or All. */
|
||||||
ok = -2 * x * y + x - y + 1;
|
ok = -2 * x * y + x - y + 1;
|
||||||
|
|
||||||
if (ok == 2 && !all)
|
if (ok == 2 && !all)
|
||||||
|
|
Loading…
Reference in New Issue