[Bf-blender-cvs] [555c1d6] master: Fix T43114: File Browser - don't highlight '..' while using border select
julianeisel
noreply at git.blender.org
Sun Jan 4 02:37:41 CET 2015
Commit: 555c1d6a635ae2b907a7e6331827d19dd425d879
Author: julianeisel
Date: Sun Jan 4 02:36:42 2015 +0100
Branches: master
https://developer.blender.org/rB555c1d6a635ae2b907a7e6331827d19dd425d879
Fix T43114: File Browser - don't highlight '..' while using border select
===================================================================
M source/blender/editors/space_file/file_ops.c
===================================================================
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 5798529..780ff51 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -259,9 +259,25 @@ static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *
sel = file_selection_get(C, &rect, 0);
if ( (sel.first != params->sel_first) || (sel.last != params->sel_last) ) {
+ int idx;
+
file_deselect_all(sfile, HILITED_FILE);
filelist_select(sfile->files, &sel, FILE_SEL_ADD, HILITED_FILE, CHECK_ALL);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
+
+ /* dont highlight readonly file (".." or ".") on border select */
+ for (idx = sel.last; idx >= 0; idx--) {
+ struct direntry *file = filelist_file(sfile->files, idx);
+
+ if (STREQ(file->relname, "..") || STREQ(file->relname, ".")) {
+ file->selflag &= ~HILITED_FILE;
+ }
+
+ /* active_file gets highlighted as well - make sure it is no readonly file */
+ if (sel.last == idx) {
+ params->active_file = idx;
+ }
+ }
}
params->sel_first = sel.first; params->sel_last = sel.last;
More information about the Bf-blender-cvs
mailing list