X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbclistbox.C;h=ef29b0b6eac0dc8848673528f1333ec4d590a1fc;hp=2dd4283c990fc325d4caf6edc68068c882a4b035;hb=15b020d5c21b2cc5545227f7c092f06086666b4a;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index 2dd4283c..ef29b0b6 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -1223,7 +1223,7 @@ int BC_ListBox::get_text_mask(BC_ListBoxItem *item, h = get_text_h(item) + ICON_MARGIN * 2; break; } case LISTBOX_ICON_LIST: { - w = get_text_width(MEDIUMFONT, item->text) + LISTBOX_MARGIN * 2; + w = column_width ? column_width[0] : default_column_width[0]; h = row_height; break; } default: @@ -1643,6 +1643,7 @@ int BC_ListBox::center_selection(int selection, yposition = item->text_y - top_item->text_y - view_h / 2; } } + if( yposition < 0 ) yposition = 0; return 1; } @@ -2614,7 +2615,7 @@ int BC_ListBox::button_press_event() // Multiple item selection is possible if( selection_mode == LISTBOX_MULTIPLE && - (ctrl_down() || shift_down()) ) { + (ctrl_down() || shift_down() || current_item->selected) ) { // Expand text selection. // Fill items between selected region and current item. if( shift_down() && @@ -2638,18 +2639,16 @@ int BC_ListBox::button_press_event() new_value = 1; } // Toggle a single item on or off - else { + else if( ctrl_down() ) { toggle_item_selection(data, selection_number); new_value = current_item->selected; } } // Select single item else { - if( !current_item->selected ) { + if( !current_item->selected || (get_buttonpress() == 1 && !new_value) ) { set_all_selected(data, 0); - set_selected(data, - selection_number, - 1); + set_selected(data, selection_number, 1); } new_value = 1; } @@ -3033,9 +3032,6 @@ int BC_ListBox::cursor_motion_event() if( (display_format == LISTBOX_TEXT || display_format == LISTBOX_ICON_LIST) && shift_down() ) { -// Deselect everything. - set_all_selected(data, 0); - // Select just the items redraw = expand_selection(0, selection_number); }