Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-07-12 13:03:09 +0400
committerAndrea Weikert <elubie@gmx.net>2009-07-12 13:03:09 +0400
commit184dca5396ee0de4535523c66d19f896cfb7a939 (patch)
tree235b9a7c0e1d30dd2b61b73b49ac049e88362ffc /source
parent2940384d9a8e3601e2ceefbf0487ce781a3b10f7 (diff)
2.5 file browser
* tweak for autocomplete, only update live if live_update and TAB key is hit. (Brecht, please check if it's ok, otherwise will revert and we'll find another way) * adding slash at the end of directory to allow for faster autocomplete * bugfix: directory name buton had wrong length
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c5
-rw-r--r--source/blender/editors/space_file/file_draw.c2
-rw-r--r--source/blender/editors/space_file/filesel.c3
3 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 0693a771ffa..0fbfeffba0d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1438,7 +1438,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my, changed= 0, inbox=0, retval= WM_UI_HANDLER_CONTINUE;
+ int mx, my, changed= 0, inbox=0, update= 0, retval= WM_UI_HANDLER_CONTINUE;
switch(event->type) {
case WHEELUPMOUSE:
@@ -1553,6 +1553,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
/* there is a key conflict here, we can't tab with autocomplete */
if(but->autocomplete_func || data->searchbox) {
changed= ui_textedit_autocomplete(C, but, data);
+ update= 1; /* do live update for tab key */
retval= WM_UI_HANDLER_BREAK;
}
/* the hotkey here is not well defined, was G.qual so we check all */
@@ -1576,7 +1577,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
if(changed) {
/* never update while typing for now */
- if(0/*data->interactive*/) ui_apply_button(C, block, but, data, 1);
+ if(update && data->interactive) ui_apply_button(C, block, but, data, 1);
else ui_check_but(but);
if(data->searchbox)
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index e107bcecb3b..339ebe27fcd 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -188,7 +188,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
if (available_w > 0) {
but = uiDefBut(block, TEX, B_FS_DIRNAME, "",
min_x, line1_y, line1_w, btn_h,
- params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0,
+ params->dir, 0.0, (float)FILE_MAXDIR-1, 0, 0,
"File path.");
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiDefBut(block, TEX, B_FS_FILENAME, "",
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index d34eb29a78d..c81dab454f8 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -354,5 +354,8 @@ void autocomplete_directory(struct bContext *C, char *str, void *arg_v)
}
}
autocomplete_end(autocpl, str);
+ if (BLI_exists(str)) {
+ BLI_add_slash(str);
+ }
}
} \ No newline at end of file