mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-24 20:22:11 +03:00
Ticket #3774: mcedit - fix mouse active area for maximize / close buttons
Signed-off-by: Yury V. Zaytsev <yury@shurup.com> Signed-off-by: Egmont Koblinger <egmont@gmail.com>
This commit is contained in:
parent
9ccd22310a
commit
fa951f8c5d
@ -889,7 +889,7 @@ edit_dialog_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
top = l;
|
||||
|
||||
/* Handle fullscreen/close buttons in the top line */
|
||||
x = w->cols - 5;
|
||||
x = w->cols - 6;
|
||||
|
||||
if (top != NULL && event->x >= x)
|
||||
{
|
||||
@ -1093,9 +1093,9 @@ edit_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
{
|
||||
if (event->y == 0)
|
||||
{
|
||||
if (event->x == close_x)
|
||||
if (event->x >= close_x - 1 && event->x <= close_x + 1)
|
||||
; /* do nothing (see MSG_MOUSE_CLICK) */
|
||||
else if (event->x == toggle_fullscreen_x)
|
||||
else if (event->x >= toggle_fullscreen_x - 1 && event->x <= toggle_fullscreen_x + 1)
|
||||
; /* do nothing (see MSG_MOUSE_CLICK) */
|
||||
else
|
||||
{
|
||||
@ -1125,9 +1125,9 @@ edit_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
case MSG_MOUSE_CLICK:
|
||||
if (event->y == 0)
|
||||
{
|
||||
if (event->x == close_x)
|
||||
if (event->x >= close_x - 1 && event->x <= close_x + 1)
|
||||
send_message (w->owner, NULL, MSG_ACTION, CK_Close, NULL);
|
||||
else if (event->x == toggle_fullscreen_x)
|
||||
else if (event->x >= toggle_fullscreen_x - 1 && event->x <= toggle_fullscreen_x + 1)
|
||||
edit_toggle_fullscreen (edit);
|
||||
else if (!edit->fullscreen && event->count == GPM_DOUBLE)
|
||||
/* double click on top line (toggle fullscreen) */
|
||||
|
Loading…
Reference in New Issue
Block a user