diff options
author | Ton Roosendaal <ton@blender.org> | 2009-08-16 17:01:40 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-08-16 17:01:40 +0400 |
commit | d823172d6d7121ceac9fd34d7f4a974675253706 (patch) | |
tree | 71c33f5fe1ab1d42def3eae0fc61a2710794a09c /source/blender/editors/screen/area.c | |
parent | e3b2cdc8eab9f6077c2b32b5798a1c6810f8a030 (diff) |
2.5
Flaw in python UI for headers: code missing to correctly set the total
width of header, plus obsolete call in view3d header template to set width.
Now MMB scroll of view3d header works again.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 79ba11a5c55..96ad9039dc1 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1309,7 +1309,7 @@ void ED_region_header(const bContext *C, ARegion *ar) HeaderType *ht; Header header = {0}; float col[3]; - int xco, yco; + int maxco, xco, yco; /* clear */ if(ED_screen_area_active(C)) @@ -1323,7 +1323,7 @@ void ED_region_header(const bContext *C, ARegion *ar) /* set view2d view matrix for scrolling (without scrollers) */ UI_view2d_view_ortho(C, &ar->v2d); - xco= 8; + xco= maxco= 8; yco= HEADERY-3; /* draw all headers types */ @@ -1335,15 +1335,25 @@ void ED_region_header(const bContext *C, ARegion *ar) header.type= ht; header.layout= layout; ht->draw(C, &header); + + /* for view2d */ + xco= uiLayoutGetWidth(layout); + if(xco > maxco) + maxco= xco; } uiBlockLayoutResolve(C, block, &xco, &yco); + + /* for view2d */ + if(xco > maxco) + maxco= xco; + uiEndBlock(C, block); uiDrawBlock(C, block); } /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); + UI_view2d_totRect_set(&ar->v2d, maxco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); /* restore view matrix? */ UI_view2d_view_restore(C); |