diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 3e099b43a4b..20dccc208d4 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -549,8 +549,24 @@ void file_draw_list(const bContext *C, ARegion *ar) UI_ThemeColor4(TH_TEXT); if (file->selflag & EDITING_FILE) { - uiBut *but = uiDefBut(block, TEX, 1, "", sx, sy - layout->tile_h - 0.15f * UI_UNIT_X, - textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit), 0, 0, ""); + uiBut *but; + short width; + + if (params->display == FILE_SHORTDISPLAY) { + width = layout->tile_w - (ICON_DEFAULT_WIDTH_SCALE + 0.2f * UI_UNIT_X); + } + else if (params->display == FILE_LONGDISPLAY) { + width = layout->column_widths[COLUMN_NAME] + layout->column_widths[COLUMN_MODE1] + + layout->column_widths[COLUMN_MODE2] + layout->column_widths[COLUMN_MODE3] + + (column_space * 3.5f); + } + else { + BLI_assert(params->display == FILE_IMGDISPLAY); + width = textwidth; + } + + but = uiDefBut(block, TEX, 1, "", sx, sy - layout->tile_h - 0.15f * UI_UNIT_X, + width, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit), 0, 0, ""); uiButSetRenameFunc(but, renamebutton_cb, file); uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */ uiButClearFlag(but, UI_BUT_UNDO); |