Ticket #64: boxsize.patch

File boxsize.patch, 1.8 KB (added by slavazanko, 15 years ago)

added by bilboq

  • ChangeLog

     
     12007-03-19  Martin Petricek  <tux@centrum.cz> 
     2 
     3        * src/boxes.c: Dialog for selecting listing mode is up to 15 
     4        characters wider if size of the screen allows it. 
     5 
  • src/boxes.c

     
    143143    const char *cancel_button = _("&Cancel"); 
    144144 
    145145    static int button_start = 30; 
     146    int extra_x = 0; 
    146147 
    147148    displays_status = _status; 
    148149 
     
    182183 
    183184        i18n_displays_flag = 1; 
    184185    } 
    185     dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors, 
     186 
     187    /* Widen the dialog by up to 15 characters if screen is large enough */ 
     188    if (COLS > DISPLAY_X) { 
     189        extra_x = COLS - DISPLAY_X; 
     190        if (extra_x > 15) extra_x = 15; 
     191    } 
     192     
     193    dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X + extra_x, dialog_colors, 
    186194                     display_callback, "[Listing Mode...]", display_title, 
    187195                     DLG_CENTER | DLG_REVERSE); 
    188196 
    189197    add_widget (dd, 
    190                 button_new (4, button_start, B_CANCEL, NORMAL_BUTTON, 
     198                button_new (4, button_start + extra_x, B_CANCEL, NORMAL_BUTTON, 
    191199                            cancel_button, 0)); 
    192200 
    193201    add_widget (dd, 
    194                 button_new (3, button_start, B_ENTER, DEFPUSH_BUTTON, 
     202                button_new (3, button_start + extra_x, B_ENTER, DEFPUSH_BUTTON, 
    195203                            ok_button, 0)); 
    196204 
    197205    status = 
    198         input_new (10, 9, INPUT_COLOR, DISPLAY_X - 14, _status[radio_sel], 
     206        input_new (10, 9, INPUT_COLOR, DISPLAY_X + extra_x - 14, _status[radio_sel], 
    199207                   "mini-input"); 
    200208    add_widget (dd, status); 
    201209    input_set_point (status, 0); 
     
    205213    add_widget (dd, check_status); 
    206214 
    207215    user = 
    208         input_new (7, 9, INPUT_COLOR, DISPLAY_X - 14, init_text, 
     216        input_new (7, 9, INPUT_COLOR, DISPLAY_X + extra_x - 14, init_text, 
    209217                   "user-fmt-input"); 
    210218    add_widget (dd, user); 
    211219    input_set_point (user, 0);