Fix [#22056] Minor UI problem in File Browser
authorMatt Ebb <matt@mke3.net>
Mon, 19 Apr 2010 04:39:01 +0000 (04:39 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 19 Apr 2010 04:39:01 +0000 (04:39 +0000)
source/blender/editors/space_file/file_draw.c

index bfc17261fa60c4274fb5c17cd12cb908718d8d82..df86ea3d5a92537cc23305ea0a131d3a35cc156f 100644 (file)
@@ -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);