diff options
author | Andrea Weikert <elubie@gmx.net> | 2010-02-09 01:44:55 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2010-02-09 01:44:55 +0300 |
commit | f8455a8d405baa45e1b15f50b6bdf4759a83c46e (patch) | |
tree | 10ebb491319fdaed35f47afa14ca2fff892b036c /source/blender/editors | |
parent | 09715e7ccec188daf34fee5a352794f9ecfd64d6 (diff) |
filebrowser
* after renaming, the file name and highlight are drawn immediately.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index ad3ec1a3d69..fdf34a423ed 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -528,6 +528,22 @@ void file_draw_list(const bContext *C, ARegion *ar) file = filelist_file(files, i); + UI_ThemeColor4(TH_TEXT); + + spos = ( FILE_IMGDISPLAY == params->display ) ? sx : sx + ICON_DEFAULT_WIDTH + 4; + + sw = file_string_width(file->relname); + if (file->flags & EDITING) { + int but_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME]; + + uiBut *but = uiDefBut(block, TEX, 1, "", spos, sy-layout->tile_h-3, + but_width, layout->textheight*2, file->relname, 1.0f, (float)FILE_MAX,0,0,""); + uiButSetRenameFunc(but, renamebutton_cb, file); + if ( 0 == uiButActiveOnly(C, block, but)) { + file->flags &= ~EDITING; + } + } + if (!(file->flags & EDITING)) { if (params->active_file == i) { if (file->flags & ACTIVE) colorid= TH_HILITE; @@ -538,8 +554,7 @@ void file_draw_list(const bContext *C, ARegion *ar) draw_tile(sx, sy-3, layout->tile_w+4, sfile->layout->tile_h+layout->tile_border_y, colorid,0); } } - - spos = sx; + uiSetRoundBox(0); if ( FILE_IMGDISPLAY == params->display ) { if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */) { @@ -555,29 +570,15 @@ void file_draw_list(const bContext *C, ARegion *ar) file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE)); } else { - file_draw_icon(block, file->path, spos, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); - spos += ICON_DEFAULT_WIDTH + 4; + file_draw_icon(block, file->path, sx, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); } UI_ThemeColor4(TH_TEXT); - - sw = file_string_width(file->relname); - if (file->flags & EDITING) { - int but_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME]; - - uiBut *but = uiDefBut(block, TEX, 1, "", spos, sy-layout->tile_h-3, - but_width, layout->textheight*2, file->relname, 1.0f, (float)FILE_MAX,0,0,""); - uiButSetRenameFunc(but, renamebutton_cb, file); - if ( 0 == uiButActiveOnly(C, block, but)) { - file->flags &= ~EDITING; - } - } else { + if (!(file->flags & EDITING)) { float name_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : sw; file_draw_string(spos, sy, file->relname, name_width, layout->tile_h, FILE_SHORTEN_END); } - uiSetRoundBox(0); - if (params->display == FILE_SHORTDISPLAY) { spos += layout->column_widths[COLUMN_NAME] + 12; if (!(file->type & S_IFDIR)) { |