diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-12 18:05:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-12 18:08:26 +0300 |
commit | 0996ee3bb81bd3b9e68b34f75590699a6908d7a0 (patch) | |
tree | 51de7ba39b7b913c5395de98a4dbe3bd803c8599 /source/blender/editors | |
parent | c6d28a94bee211c1d1ce41f364f5c026c4d759f0 (diff) |
Fix: Don't show filesel buttons when no operators running
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 5d0734db18b..3f3c14d3a7d 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -111,6 +111,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) SpaceFile *sfile = CTX_wm_space_file(C); FileSelectParams *params = ED_fileselect_get_params(sfile); ARegion *artmp; + const bool is_browse_only = (sfile->op == NULL); /* Initialize UI block. */ BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar); @@ -124,15 +125,22 @@ void file_draw_buttons(const bContext *C, ARegion *ar) available_w -= chan_offs; } } - + /* Is there enough space for the execute / cancel buttons? */ - loadbutton = UI_fontstyle_string_width(params->title) + btn_margin; - CLAMP_MIN(loadbutton, btn_minw); - if (available_w <= loadbutton + separator + input_minw || params->title[0] == 0) { + + if (is_browse_only) { loadbutton = 0; } else { + loadbutton = UI_fontstyle_string_width(params->title) + btn_margin; + CLAMP_MIN(loadbutton, btn_minw); + if (available_w <= loadbutton + separator + input_minw) { + loadbutton = 0; + } + } + + if (loadbutton) { line1_w -= (loadbutton + separator); line2_w = line1_w; } @@ -145,7 +153,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) else { line2_w -= (fnumbuttons + separator); } - + /* Text input fields for directory and file. */ if (available_w > 0) { int overwrite_alert = file_draw_check_exists(sfile); |