Ticket #3173: mc-3173-popup-location.patch

File mc-3173-popup-location.patch, 1.5 KB (added by egmont, 11 years ago)
  • lib/widget/dialog.c

    diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c
    index 424e4c9..30cad1e 100644
    a b dlg_set_position (WDialog * h, int y1, int x1, int y2, int x2) 
    700700} 
    701701 
    702702/* --------------------------------------------------------------------------------------------- */ 
    703 /** this function sets only size, leaving positioning to automatic methods */ 
     703/** sets dialog size and position */ 
    704704 
    705705void 
    706706dlg_set_size (WDialog * h, int lines, int cols) 
    dlg_set_size (WDialog * h, int lines, int cols) 
    714714        x = (COLS - cols) / 2; 
    715715    } 
    716716 
    717     if ((h->flags & DLG_TRYUP) && (y > 3)) 
    718         y -= 2; 
     717    if (h->flags & DLG_TRYUP) 
     718    { 
     719        if (y > 3) 
     720            y -= 2; 
     721        else if (y == 3) 
     722            y = 2; 
     723    } 
    719724 
    720725    dlg_set_position (h, y, x, y + lines, x + cols); 
    721726} 
  • lib/widget/listbox-window.c

    diff --git a/lib/widget/listbox-window.c b/lib/widget/listbox-window.c
    index 94bb57c..1651cc7 100644
    a b create_listbox_window_centered (int center_y, int center_x, int lines, int cols, 
    106106 
    107107    listbox->dlg = 
    108108        dlg_create (TRUE, ypos, xpos, lines + space, cols + space, 
    109                     listbox_colors, NULL, NULL, help, title, DLG_TRYUP); 
     109                    listbox_colors, NULL, NULL, help, title, DLG_CENTER | DLG_TRYUP); 
    110110 
    111111    listbox->list = listbox_new (2, 2, lines, cols, FALSE, NULL); 
    112112    add_widget (listbox->dlg, listbox->list);