UI:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 20 May 2009 17:18:48 +0000 (17:18 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 20 May 2009 17:18:48 +0000 (17:18 +0000)
* Hide enable button in horizontal collapsed panels.
* Fix enable button not being in correct position when zooming.
* Fix n-key panels layout being messed up.

source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/screen/area.c

index c1877ac8861d99868e6f582d011e095ab6f24aba..56183bfb314c84cf0e796c8e7963ddfc878cf731 100644 (file)
@@ -1346,7 +1346,7 @@ static void ui_litem_layout_free(uiLayout *litem)
                scaley= (float)litem->h/(float)toth;
        
        x= litem->x;
-       y= litem->y - scalex*toth;
+       y= litem->y - scaley*toth;
 
        for(item=litem->items.first; item; item=item->next) {
                ui_item_offset(item, &itemx, &itemy);
index 5cb06845bdf4a570398048f4f2bf9ddec49f6ac3..539f18c2cd81693821e53478d10fcb158d3a2762 100644 (file)
@@ -451,10 +451,8 @@ static void ui_draw_aligned_panel_header(ARegion *ar, uiStyle *style, uiBlock *b
                                nr++;
        
        /* + 0.001f to avoid flirting with float inaccuracy */
-       if(panel->control & UI_PNL_CLOSE) pnl_icons=(2*PNL_ICON+5)/block->aspect + 0.001f;
-       else pnl_icons= (PNL_ICON+5)/block->aspect + 0.001f;
-
-       pnl_icons += panel->labelofs;
+       if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f;
+       else pnl_icons= (panel->labelofs+PNL_ICON+5)/block->aspect + 0.001f;
        
        if(nr==1) {
                
index 2e551a26b73816a58834b0aac0fa7075048611d7..cf72eaf2cddc69b9f581d8bbae4d035c77eead7a 100644 (file)
@@ -1004,7 +1004,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex
                        if(vertical)
                                y -= header;
 
-                       if(pt->draw_header) {
+                       if(pt->draw_header && (open || vertical)) {
                                /* for enabled buttons */
                                panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
                                        triangle, header+style->panelspace, header, 1, style);