UI: Matt, check space_outliner.c diff to see how to get python
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 28 May 2009 23:58:18 +0000 (23:58 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 28 May 2009 23:58:18 +0000 (23:58 +0000)
layouts in a header.

release/ui/space_outliner.py
source/blender/editors/interface/interface_layout.c
source/blender/editors/space_outliner/space_outliner.c

index a87b1e21a0f6245324b5ec66ac48ceea8b4b36ff..d73ea38cf044834a9da6ff64f2b1a9e4afaee4a9 100644 (file)
@@ -16,7 +16,7 @@ class OUTLINER_HT_header(bpy.types.Header):
                        row.itemM(context, "OUTLINER_MT_view")
                        
                row = layout.row(align=True)
-               row.itemR(so, "display_mode")
+               row.itemR(so, "display_mode", text="")
 
 class OUTLINER_MT_view(bpy.types.Menu):
        __space_type__ = "OUTLINER"
index c43b2588fa4c288cb23f6f9f5ada46ee225b641b..2e123c2833943b7e980aee2113af95c06c12a966 100644 (file)
@@ -655,7 +655,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
        subtype= RNA_property_subtype(prop);
        len= RNA_property_array_length(prop);
 
-       if(type == PROP_STRING)
+       if(ELEM(type, PROP_STRING, PROP_ENUM))
                w += 10*UI_UNIT_X;
 
        /* increase height for arrays */
index 8e30db584afe34eef9d5dac2c89b9b91d371138e..4ddb586beb4f5ffd259d73adb5d6c98f32a9a81b 100644 (file)
@@ -143,14 +143,23 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
 
 /* ************************ header outliner area region *********************** */
 
+//#define PY_HEADER
+
 /* add handlers, stuff you only do once or on area/region changes */
 static void outliner_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
+#ifdef PY_HEADER
+       ED_region_header_init(ar);
+#else
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+#endif
 }
 
 static void outliner_header_area_draw(const bContext *C, ARegion *ar)
 {
+#ifdef PY_HEADER
+       ED_region_header(C, ar);
+#else
        float col[3];
        
        if(ED_screen_area_active(C))
@@ -165,6 +174,7 @@ static void outliner_header_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_ortho(C, &ar->v2d);
 
        outliner_header_buttons(C, ar);
+#endif
 }
 
 static void outliner_header_area_free(ARegion *ar)