diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 25 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 7 |
3 files changed, 26 insertions, 13 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index df86ea3d5a9..2f056e4e0b4 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -78,10 +78,6 @@ /* button events */ enum { - B_REDR = 0, - B_FS_EXEC, - B_FS_CANCEL, - B_FS_PARENT, B_FS_DIRNAME, B_FS_FILENAME } eFile_ButEvents; @@ -90,9 +86,6 @@ enum { static void do_file_buttons(bContext *C, void *arg, int event) { switch(event) { - case B_FS_PARENT: - file_parent_exec(C, NULL); /* file_ops.c */ - break; case B_FS_FILENAME: file_filename_exec(C, NULL); break; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index f1d3702160f..85b3cee354b 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -121,7 +121,7 @@ static void clamp_to_filelist(int numfiles, int *first_file, int *last_file) } } -static FileSelect file_select(bContext* C, const rcti* rect, short selecting, short toggle_one) +static FileSelect file_select(bContext* C, const rcti* rect, short selecting, short toggle_one, short fill) { ARegion *ar= CTX_wm_region(C); SpaceFile *sfile= CTX_wm_space_file(C); @@ -141,6 +141,19 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh clamp_to_filelist(numfiles, &first_file, &last_file); + if (fill && (last_file >= 0) && (last_file < numfiles) ) { + int f= last_file; + while (f >= 0) { + struct direntry* file = filelist_file(sfile->files, f); + if (file->flags & ACTIVEFILE) + break; + f--; + } + if (f >= 0) { + first_file = f+1; + } + } + /* select all valid files between first and last indicated */ if ( (first_file >= 0) && (first_file < numfiles) && (last_file >= 0) && (last_file < numfiles) ) { for (act_file = first_file; act_file <= last_file; act_file++) { @@ -213,7 +226,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op) BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect); - if (FILE_SELECT_DIR == file_select(C, &rect, selecting, 0)) { + if (FILE_SELECT_DIR == file_select(C, &rect, selecting, 0, 0)) { WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } else { WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); @@ -245,6 +258,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) short val; rcti rect; int extend = RNA_boolean_get(op->ptr, "extend"); + int fill = RNA_boolean_get(op->ptr, "fill"); if(ar->regiontype != RGN_TYPE_WINDOW) return OPERATOR_CANCELLED; @@ -259,7 +273,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) /* single select, deselect all selected first */ if (!extend) file_deselect_all(sfile); - if (FILE_SELECT_DIR == file_select(C, &rect, 1, extend )) + if (FILE_SELECT_DIR == file_select(C, &rect, 1, extend, fill )) WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); else WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); @@ -283,6 +297,7 @@ void FILE_OT_select(wmOperatorType *ot) /* rna */ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection."); } static int file_select_all_exec(bContext *C, wmOperator *op) @@ -657,7 +672,9 @@ void FILE_OT_parent(struct wmOperatorType *ot) int file_refresh_exec(bContext *C, wmOperator *unused) { - file_change_dir(C, 1); + SpaceFile *sfile= CTX_wm_space_file(C); + + ED_fileselect_clear(C, sfile); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 6cef78d4bee..50aabf28ba6 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -374,9 +374,12 @@ void file_keymap(struct wmKeyConfig *keyconf) /* keys for main area */ keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0); - WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0); - kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); + kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "fill", 1); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", EVT_TWEAK_L, KM_ANY, 0, 0); |