diff --git a/lib/widget/wtools.c b/lib/widget/wtools.c index 7e9d575490..7038df9fd3 100644 --- a/lib/widget/wtools.c +++ b/lib/widget/wtools.c @@ -278,6 +278,9 @@ query_dialog (const char *header, const char *text, int flags, int count, ...) int i; int result = -1; int cols, lines; + int lxx = 0; + int lyy = 0; + const int *query_colors = (flags & D_ERROR) != 0 ? alarm_colors : dialog_colors; dlg_flags_t dlg_flags = (flags & D_CENTER) != 0 ? (DLG_CENTER | DLG_TRYUP) : DLG_NONE; @@ -302,9 +305,16 @@ query_dialog (const char *header, const char *text, int flags, int count, ...) cols = 6 + max (win_len, max (str_term_width1 (header), cols)); lines += 4 + (count > 0 ? 2 : 0); + if (flags & D_LOWER) + { + lxx = (COLS - cols) / 2; + lyy = (LINES - lines + 8) / 2; + dlg_flags = DLG_NONE; + } + /* prepare dialog */ query_dlg = - dlg_create (TRUE, 0, 0, lines, cols, query_colors, query_default_callback, NULL, + dlg_create (TRUE, lyy, lxx, lines, cols, query_colors, query_default_callback, NULL, "[QueryBox]", header, dlg_flags); if (count > 0) @@ -336,7 +346,8 @@ query_dialog (const char *header, const char *text, int flags, int count, ...) va_end (ap); /* do resize before running and selecting any widget */ - send_message (query_dlg, NULL, MSG_RESIZE, 0, NULL); + if ((flags & D_LOWER) == 0) + send_message (query_dlg, NULL, MSG_RESIZE, 0, NULL); if (defbutton != NULL) dlg_select_widget (defbutton); diff --git a/lib/widget/wtools.h b/lib/widget/wtools.h index 8585eb828c..5f821c5283 100644 --- a/lib/widget/wtools.h +++ b/lib/widget/wtools.h @@ -31,7 +31,8 @@ enum { D_NORMAL = 0, D_ERROR = (1 << 0), - D_CENTER = (1 << 1) + D_CENTER = (1 << 1), + D_LOWER = (1 << 2) } /* dialog options */ ; /*** structures declarations (and typedefs of structures)*****************************************/ diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 0bacc54732..16c7479a61 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -714,8 +714,8 @@ real_query_recursive (file_op_context_t * ctx, enum OperationMode mode, const ch query_set_sel (1); ctx->recursive_result = - query_dialog (op_names[OP_DELETE], text, D_ERROR, 5, _("&Yes"), _("&No"), _("A&ll"), - _("Non&e"), _("&Abort")); + query_dialog (op_names[OP_DELETE], text, D_ERROR | D_LOWER, 5, _("&Yes"), _("&No"), + _("A&ll"), _("Non&e"), _("&Abort")); g_free (text); if (ctx->recursive_result != RECURSIVE_ABORT)