From 2f56d8d2e7557e30f2431d418bd4bee4155aee3e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 19 Apr 2010 04:39:01 +0000 Subject: Fix [#22056] Minor UI problem in File Browser --- source/blender/editors/space_file/file_draw.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index bfc17261fa6..df86ea3d5a9 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -133,6 +133,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) int loadbutton; int fnumbuttons; int min_x = 10; + int chan_offs = 0; int available_w = max_x - min_x; int line1_w = available_w; int line2_w = available_w; @@ -151,8 +152,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* 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; + chan_offs = 16; + min_x += chan_offs; + available_w -= chan_offs; } } @@ -182,12 +184,12 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Text input fields for directory and file. */ if (available_w > 0) { but = uiDefBut(block, TEX, B_FS_DIRNAME, "", - min_x, line1_y, line1_w, btn_h, + min_x, line1_y, line1_w-chan_offs, btn_h, params->dir, 0.0, (float)FILE_MAX-1, 0, 0, "File path."); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiDefBut(block, TEX, B_FS_FILENAME, "", - min_x, line2_y, line2_w, btn_h, + min_x, line2_y, line2_w-chan_offs, btn_h, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "File name."); } @@ -196,13 +198,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if (fnumbuttons) { uiBlockBeginAlign(block); but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT, - min_x + line2_w + separator, line2_y, + min_x + line2_w + separator - chan_offs, line2_y, btn_fn_w, btn_h, "Decrement the filename number"); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, - min_x + line2_w + separator + btn_fn_w, line2_y, + min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, btn_fn_w, btn_h, "Increment the filename number"); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); -- cgit v1.2.3