diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-18 06:36:19 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-18 06:36:19 +0300 |
commit | 009ed7dc269e97653fd1db3f36fdd79fc7565cda (patch) | |
tree | b8866257fb044ff59a699fe8006ac9bdf4c50188 /source | |
parent | ffd035db62ba34135911ba267442345bba6e95cf (diff) |
Fix [#20703] Minor UI bug in file browser
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 93bedd0b866..6a3cc040c97 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -133,7 +133,6 @@ static void do_file_buttons(bContext *C, void *arg, int event) void file_draw_buttons(const bContext *C, ARegion *ar) { /* Button layout. */ - const int min_x = 10; const int max_x = ar->winx - 10; const int line1_y = IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN*2; const int line2_y = IMASEL_BUTTONS_MARGIN; @@ -148,6 +147,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) char name[20]; int loadbutton; int fnumbuttons; + int min_x = 10; int available_w = max_x - min_x; int line1_w = available_w; int line2_w = available_w; @@ -156,11 +156,20 @@ void file_draw_buttons(const bContext *C, ARegion *ar) uiBlock* block; SpaceFile* sfile = CTX_wm_space_file(C); FileSelectParams* params = ED_fileselect_get_params(sfile); + ARegion* artmp; /* Initialize UI block. */ sprintf(name, "win %p", ar); block = uiBeginBlock(C, ar, name, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); + + /* exception to make space for collapsed region icon */ + for (artmp=CTX_wm_area(C)->regionbase.first; artmp; artmp=artmp->next) { + if (artmp->regiontype == RGN_TYPE_CHANNELS && artmp->flag & RGN_FLAG_HIDDEN) { + min_x += 16; + available_w -= 16; + } + } /* Is there enough space for the execute / cancel buttons? */ loadbutton = UI_GetStringWidth(sfile->params->title) + btn_margin; |