align option for split
authorCampbell Barton <ideasman42@gmail.com>
Thu, 10 Dec 2009 14:47:07 +0000 (14:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 10 Dec 2009 14:47:07 +0000 (14:47 +0000)
14 files changed:
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesrna/intern/rna_sequence.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 17d8f0a847b364e6efd858150b07b09a6dedcd48..ebddcd45a8b036f97b901718dda71c7e3a800a5d 100644 (file)
@@ -276,7 +276,7 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
        /* split into 2 columns 
         * NOTE: the mode comboboxes shouldn't get labels, otherwise there isn't enough room
         */
-       split= uiLayoutSplit(layout, 0.5f);
+       split= uiLayoutSplit(layout, 0.5f, 0);
        
        /* before range */
        col= uiLayoutColumn(split, 1);
@@ -306,7 +306,7 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short
        uiItemR(layout, NULL, 0, &ptr, "modification", 0);
        
        /* split into 2 columns */
-       split= uiLayoutSplit(layout, 0.5f);
+       split= uiLayoutSplit(layout, 0.5f, 0);
        
        /* col 1 */
        col= uiLayoutColumn(split, 0);
@@ -588,7 +588,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
                row= uiLayoutRow(layout, 0);
                
                /* split into 2 columns */
-               split= uiLayoutSplit(layout, 0.5f);
+               split= uiLayoutSplit(layout, 0.5f, 0);
                
                /* x-minimum */
                col= uiLayoutColumn(split, 1);
@@ -606,7 +606,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
                row= uiLayoutRow(layout, 0);
                
                /* split into 2 columns */
-               split= uiLayoutSplit(layout, 0.5f);
+               split= uiLayoutSplit(layout, 0.5f, 0);
                
                /* x-minimum */
                col= uiLayoutColumn(split, 1);
index 4da5ec02ddc48f6c22aa811ab78ba58e567b053c..5deffbabb778e6e1340e32245761252f1288896e 100644 (file)
@@ -187,7 +187,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
                
                /* new backdrop ----------------------------------- */
                box= uiLayoutBox(layout);
-               split= uiLayoutSplit(box, 0.5f);
+               split= uiLayoutSplit(box, 0.5f, 0);
                
                
                /* draw settings ---------------------------------- */
index aed1e5d5f0d3e8892e00e05bab5bc3a49f0f459c..5febaa3e5a1ac3dad6ab656cb524a9e7b82822e2 100644 (file)
@@ -629,7 +629,7 @@ uiLayout *uiLayoutBox(uiLayout *layout);
 uiLayout *uiLayoutListBox(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop,
        struct PointerRNA *actptr, struct PropertyRNA *actprop);
 uiLayout *uiLayoutAbsolute(uiLayout *layout, int align);
-uiLayout *uiLayoutSplit(uiLayout *layout, float percentage);
+uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align);
 uiLayout *uiLayoutOverlap(uiLayout *layout);
 
 uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
index 168b1532db8a13702c533ece8b6b766bf9c272a8..bfb5ab11263628ed9a86df47788ba6169f7fe65f 100644 (file)
@@ -714,7 +714,7 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
        if(prop && RNA_property_type(prop) == PROP_ENUM) {
                EnumPropertyItem *item;
                int totitem, i, free;
-               uiLayout *split= uiLayoutSplit(layout, 0);
+               uiLayout *split= uiLayoutSplit(layout, 0, 0);
                uiLayout *column= uiLayoutColumn(split, 0);
 
                RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free);
@@ -1024,7 +1024,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname)
        if(RNA_property_type(prop) == PROP_ENUM) {
                EnumPropertyItem *item;
                int totitem, i, free;
-               uiLayout *split= uiLayoutSplit(layout, 0);
+               uiLayout *split= uiLayoutSplit(layout, 0, 0);
                uiLayout *column= uiLayoutColumn(split, 0);
 
                RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
@@ -2088,13 +2088,14 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
        return litem;
 }
 
-uiLayout *uiLayoutSplit(uiLayout *layout, float percentage)
+uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
 {
        uiLayoutItemSplt *split;
 
        split= MEM_callocN(sizeof(uiLayoutItemSplt), "uiLayoutItemSplt");
        split->litem.item.type= ITEM_LAYOUT_SPLIT;
        split->litem.root= layout->root;
+       split->litem.align= align;
        split->litem.active= 1;
        split->litem.enabled= 1;
        split->litem.context= layout->context;
index 55b908a44ce1526a2a26f1e4ea237942dae47965..f01ae9905869a8d8c60a564492455befab37e1e4 100644 (file)
@@ -1377,7 +1377,7 @@ static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str)
        }
 
        /* create items */
-       split= uiLayoutSplit(layout, 0);
+       split= uiLayoutSplit(layout, 0, 0);
 
        for(a=0, b=0; a<md->nitems; a++, b++) {
                if(block->flag & UI_BLOCK_NO_FLIP)
index f59e10ede7512170436b129a9995970436e99f13..0c5f03f0d0ff3465190613a724e56c1b2e041d37 100644 (file)
@@ -1864,7 +1864,7 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
 
        /* black/white levels */
        if(levels) {
-               split= uiLayoutSplit(layout, 0);
+               split= uiLayoutSplit(layout, 0, 0);
                uiItemR(uiLayoutColumn(split, 0), NULL, 0, ptr, "black_level", UI_ITEM_R_EXPAND);
                uiItemR(uiLayoutColumn(split, 0), NULL, 0, ptr, "white_level", UI_ITEM_R_EXPAND);
 
@@ -2098,7 +2098,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
        else if(itemptr->type == &RNA_ShapeKey) {
                ob= (Object*)activeptr->data;
 
-               split= uiLayoutSplit(sub, 0.75f);
+               split= uiLayoutSplit(sub, 0.75f, 0);
 
                uiItemL(split, name, icon);
 
index 7aaa6cbb42b23062ee8a15ef9839ddfc9d474bd0..a8cd0e017ed6b591ab989d11a9a23baa7f1bdc8f 100644 (file)
@@ -151,7 +151,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
                        uiItemL(col, name, 0);
                }
                else if(columns == 2) {
-                       split = uiLayoutSplit(layout, 0.5f);
+                       split = uiLayoutSplit(layout, 0.5f, 0);
 
                        uiItemL(uiLayoutColumn(split, 0), name, 0);
                        col= uiLayoutColumn(split, 0);
index a184ea2b2c493f18e4006d8a7fba7c05e183463a..bb989b35cd5304cc3d3bcff8bb499072bec3d93b 100644 (file)
@@ -1024,7 +1024,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
                        if(ima->source != IMA_SRC_GENERATED) {
                                uiItemS(layout);
 
-                               split= uiLayoutSplit(layout, 0);
+                               split= uiLayoutSplit(layout, 0, 0);
 
                                col= uiLayoutColumn(split, 0);
                                uiItemR(col, NULL, 0, &imaptr, "fields", 0);
@@ -1040,7 +1040,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
                        if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                                uiItemS(layout);
                                
-                               split= uiLayoutSplit(layout, 0);
+                               split= uiLayoutSplit(layout, 0, 0);
 
                                col= uiLayoutColumn(split, 0);
                                 
@@ -1062,7 +1062,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
                                uiItemR(col, NULL, 0, userptr, "cyclic", 0);
                        }
                        else if(ima->source==IMA_SRC_GENERATED) {
-                               split= uiLayoutSplit(layout, 0);
+                               split= uiLayoutSplit(layout, 0, 0);
 
                                col= uiLayoutColumn(split, 1);
                                uiItemR(col, "X", 0, &imaptr, "generated_width", 0);
index a988ceb50e729e74b0a945b1f3c9e4c3e69ee6a3..a21b8442c852a2ef244ac59efb8fbd1bb7c26fe2 100644 (file)
@@ -502,7 +502,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
 {
        uiLayout *split, *colsub;
        
-       split = uiLayoutSplit(layout, 0.8);
+       split = uiLayoutSplit(layout, 0.8, 0);
        
        if (ptr->type == &RNA_PoseBone) {
                PointerRNA boneptr;
@@ -518,7 +518,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
        uiItemL(colsub, "", 0);
        uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
        
-       split = uiLayoutSplit(layout, 0.8);
+       split = uiLayoutSplit(layout, 0.8, 0);
        
        switch(RNA_enum_get(ptr, "rotation_mode")) {
                case ROT_MODE_QUAT: /* quaternion */
@@ -553,7 +553,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
        }
        uiItemR(layout, "", 0, ptr, "rotation_mode", 0);
        
-       split = uiLayoutSplit(layout, 0.8);
+       split = uiLayoutSplit(layout, 0.8, 0);
        colsub = uiLayoutColumn(split, 1);
        uiItemR(colsub, "Scale", 0, ptr, "scale", 0);
        colsub = uiLayoutColumn(split, 1);
index 54038853775d50ecad018970bbef3f526be7cac6..e7ebcbdb849d0c1dbcebd6f70020d4746730b321 100644 (file)
@@ -908,7 +908,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe
                /* UI */
                uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", 0);
                uiLayout *layout= uiPupMenuLayout(pup);
-               uiLayout *split= uiLayoutSplit(layout, 0);
+               uiLayout *split= uiLayoutSplit(layout, 0, 0);
                uiLayout *column= uiLayoutColumn(split, 0);
                LinkNode *node;
 
index 136dfe0b9b759e73a6052a72c02d98a088709162..52ce9bd721dfe8460db86438ea1b770d8f341e4b 100644 (file)
@@ -1155,7 +1155,7 @@ static void rna_def_solid_color(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
-       
+
        srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
        RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
        RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
index 5880e1d7ae62bdb45291f433ec07f517d89bae96..0955ec1c581800cd7db920b19f57d9f02e430103 100644 (file)
@@ -145,6 +145,7 @@ void RNA_api_ui_layout(StructRNA *srna)
        parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
        RNA_def_function_return(func, parm);
        RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f);
+       RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
 
        /* items */
        func= RNA_def_function(srna, "prop", "rna_uiItemR");
index 8c819c1e3a01e927087521701c63d8b32331e8ed..818dcd98afde3c684004373ca31647e01931944c 100644 (file)
@@ -922,7 +922,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
 
        uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
        
-       split = uiLayoutSplit(layout, 0);
+       split = uiLayoutSplit(layout, 0, 0);
        col = uiLayoutColumn(split, 0);
        uiItemL(col, "Links", 0);
        uiItemO(col, NULL, ICON_URL, "HELP_OT_release_logs");
index 9abd518ff6e96b2dcb1408d58f1f69fb35a7c903..ede1b865970220840f2109d26214f877bcfcff73 100644 (file)
@@ -167,7 +167,7 @@ struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align){return (struct
 struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;}
 struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;}
 struct uiLayout *uiLayoutBox(struct uiLayout *layout){return (struct uiLayout *) NULL;}
-struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage){return (struct uiLayout *) NULL;}
+struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage, int align){return (struct uiLayout *) NULL;}
 void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
 void uiItemMenuEnumR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname){}
 void uiItemEnumR_string(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value){}