mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(query_default_callback): clarify widget position.
If dialog should be placed too high (in the upper half of the screen closer to the screen top), show it centered. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
4008d3b96c
commit
101714e39b
@ -99,6 +99,10 @@ query_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
|||||||
else
|
else
|
||||||
ypos = WIDGET (prev_dlg)->rect.y + 2;
|
ypos = WIDGET (prev_dlg)->rect.y + 2;
|
||||||
|
|
||||||
|
/* if dialog is too high, place it centered */
|
||||||
|
if (ypos + w->rect.lines < LINES / 2 )
|
||||||
|
w->pos_flags |= WPOS_CENTER;
|
||||||
|
|
||||||
xpos = COLS / 2 - w->rect.cols / 2;
|
xpos = COLS / 2 - w->rect.cols / 2;
|
||||||
|
|
||||||
/* set position */
|
/* set position */
|
||||||
|
Loading…
Reference in New Issue
Block a user