align option for split
This commit is contained in:
@@ -276,7 +276,7 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
|
|||||||
/* split into 2 columns
|
/* split into 2 columns
|
||||||
* NOTE: the mode comboboxes shouldn't get labels, otherwise there isn't enough room
|
* 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 */
|
/* before range */
|
||||||
col= uiLayoutColumn(split, 1);
|
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);
|
uiItemR(layout, NULL, 0, &ptr, "modification", 0);
|
||||||
|
|
||||||
/* split into 2 columns */
|
/* split into 2 columns */
|
||||||
split= uiLayoutSplit(layout, 0.5f);
|
split= uiLayoutSplit(layout, 0.5f, 0);
|
||||||
|
|
||||||
/* col 1 */
|
/* col 1 */
|
||||||
col= uiLayoutColumn(split, 0);
|
col= uiLayoutColumn(split, 0);
|
||||||
@@ -588,7 +588,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
|
|||||||
row= uiLayoutRow(layout, 0);
|
row= uiLayoutRow(layout, 0);
|
||||||
|
|
||||||
/* split into 2 columns */
|
/* split into 2 columns */
|
||||||
split= uiLayoutSplit(layout, 0.5f);
|
split= uiLayoutSplit(layout, 0.5f, 0);
|
||||||
|
|
||||||
/* x-minimum */
|
/* x-minimum */
|
||||||
col= uiLayoutColumn(split, 1);
|
col= uiLayoutColumn(split, 1);
|
||||||
@@ -606,7 +606,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
|
|||||||
row= uiLayoutRow(layout, 0);
|
row= uiLayoutRow(layout, 0);
|
||||||
|
|
||||||
/* split into 2 columns */
|
/* split into 2 columns */
|
||||||
split= uiLayoutSplit(layout, 0.5f);
|
split= uiLayoutSplit(layout, 0.5f, 0);
|
||||||
|
|
||||||
/* x-minimum */
|
/* x-minimum */
|
||||||
col= uiLayoutColumn(split, 1);
|
col= uiLayoutColumn(split, 1);
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
|
|||||||
|
|
||||||
/* new backdrop ----------------------------------- */
|
/* new backdrop ----------------------------------- */
|
||||||
box= uiLayoutBox(layout);
|
box= uiLayoutBox(layout);
|
||||||
split= uiLayoutSplit(box, 0.5f);
|
split= uiLayoutSplit(box, 0.5f, 0);
|
||||||
|
|
||||||
|
|
||||||
/* draw settings ---------------------------------- */
|
/* draw settings ---------------------------------- */
|
||||||
|
|||||||
@@ -629,7 +629,7 @@ uiLayout *uiLayoutBox(uiLayout *layout);
|
|||||||
uiLayout *uiLayoutListBox(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop,
|
uiLayout *uiLayoutListBox(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop,
|
||||||
struct PointerRNA *actptr, struct PropertyRNA *actprop);
|
struct PointerRNA *actptr, struct PropertyRNA *actprop);
|
||||||
uiLayout *uiLayoutAbsolute(uiLayout *layout, int align);
|
uiLayout *uiLayoutAbsolute(uiLayout *layout, int align);
|
||||||
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage);
|
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align);
|
||||||
uiLayout *uiLayoutOverlap(uiLayout *layout);
|
uiLayout *uiLayoutOverlap(uiLayout *layout);
|
||||||
|
|
||||||
uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
|
uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
|
|||||||
if(prop && RNA_property_type(prop) == PROP_ENUM) {
|
if(prop && RNA_property_type(prop) == PROP_ENUM) {
|
||||||
EnumPropertyItem *item;
|
EnumPropertyItem *item;
|
||||||
int totitem, i, free;
|
int totitem, i, free;
|
||||||
uiLayout *split= uiLayoutSplit(layout, 0);
|
uiLayout *split= uiLayoutSplit(layout, 0, 0);
|
||||||
uiLayout *column= uiLayoutColumn(split, 0);
|
uiLayout *column= uiLayoutColumn(split, 0);
|
||||||
|
|
||||||
RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free);
|
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) {
|
if(RNA_property_type(prop) == PROP_ENUM) {
|
||||||
EnumPropertyItem *item;
|
EnumPropertyItem *item;
|
||||||
int totitem, i, free;
|
int totitem, i, free;
|
||||||
uiLayout *split= uiLayoutSplit(layout, 0);
|
uiLayout *split= uiLayoutSplit(layout, 0, 0);
|
||||||
uiLayout *column= uiLayoutColumn(split, 0);
|
uiLayout *column= uiLayoutColumn(split, 0);
|
||||||
|
|
||||||
RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
|
RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
|
||||||
@@ -2088,13 +2088,14 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
|
|||||||
return litem;
|
return litem;
|
||||||
}
|
}
|
||||||
|
|
||||||
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage)
|
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
|
||||||
{
|
{
|
||||||
uiLayoutItemSplt *split;
|
uiLayoutItemSplt *split;
|
||||||
|
|
||||||
split= MEM_callocN(sizeof(uiLayoutItemSplt), "uiLayoutItemSplt");
|
split= MEM_callocN(sizeof(uiLayoutItemSplt), "uiLayoutItemSplt");
|
||||||
split->litem.item.type= ITEM_LAYOUT_SPLIT;
|
split->litem.item.type= ITEM_LAYOUT_SPLIT;
|
||||||
split->litem.root= layout->root;
|
split->litem.root= layout->root;
|
||||||
|
split->litem.align= align;
|
||||||
split->litem.active= 1;
|
split->litem.active= 1;
|
||||||
split->litem.enabled= 1;
|
split->litem.enabled= 1;
|
||||||
split->litem.context= layout->context;
|
split->litem.context= layout->context;
|
||||||
|
|||||||
@@ -1377,7 +1377,7 @@ static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create items */
|
/* create items */
|
||||||
split= uiLayoutSplit(layout, 0);
|
split= uiLayoutSplit(layout, 0, 0);
|
||||||
|
|
||||||
for(a=0, b=0; a<md->nitems; a++, b++) {
|
for(a=0, b=0; a<md->nitems; a++, b++) {
|
||||||
if(block->flag & UI_BLOCK_NO_FLIP)
|
if(block->flag & UI_BLOCK_NO_FLIP)
|
||||||
|
|||||||
@@ -1864,7 +1864,7 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
|
|||||||
|
|
||||||
/* black/white levels */
|
/* black/white levels */
|
||||||
if(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, "black_level", UI_ITEM_R_EXPAND);
|
||||||
uiItemR(uiLayoutColumn(split, 0), NULL, 0, ptr, "white_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) {
|
else if(itemptr->type == &RNA_ShapeKey) {
|
||||||
ob= (Object*)activeptr->data;
|
ob= (Object*)activeptr->data;
|
||||||
|
|
||||||
split= uiLayoutSplit(sub, 0.75f);
|
split= uiLayoutSplit(sub, 0.75f, 0);
|
||||||
|
|
||||||
uiItemL(split, name, icon);
|
uiItemL(split, name, icon);
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
|
|||||||
uiItemL(col, name, 0);
|
uiItemL(col, name, 0);
|
||||||
}
|
}
|
||||||
else if(columns == 2) {
|
else if(columns == 2) {
|
||||||
split = uiLayoutSplit(layout, 0.5f);
|
split = uiLayoutSplit(layout, 0.5f, 0);
|
||||||
|
|
||||||
uiItemL(uiLayoutColumn(split, 0), name, 0);
|
uiItemL(uiLayoutColumn(split, 0), name, 0);
|
||||||
col= uiLayoutColumn(split, 0);
|
col= uiLayoutColumn(split, 0);
|
||||||
|
|||||||
@@ -1024,7 +1024,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
|
|||||||
if(ima->source != IMA_SRC_GENERATED) {
|
if(ima->source != IMA_SRC_GENERATED) {
|
||||||
uiItemS(layout);
|
uiItemS(layout);
|
||||||
|
|
||||||
split= uiLayoutSplit(layout, 0);
|
split= uiLayoutSplit(layout, 0, 0);
|
||||||
|
|
||||||
col= uiLayoutColumn(split, 0);
|
col= uiLayoutColumn(split, 0);
|
||||||
uiItemR(col, NULL, 0, &imaptr, "fields", 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)) {
|
if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
|
||||||
uiItemS(layout);
|
uiItemS(layout);
|
||||||
|
|
||||||
split= uiLayoutSplit(layout, 0);
|
split= uiLayoutSplit(layout, 0, 0);
|
||||||
|
|
||||||
col= uiLayoutColumn(split, 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);
|
uiItemR(col, NULL, 0, userptr, "cyclic", 0);
|
||||||
}
|
}
|
||||||
else if(ima->source==IMA_SRC_GENERATED) {
|
else if(ima->source==IMA_SRC_GENERATED) {
|
||||||
split= uiLayoutSplit(layout, 0);
|
split= uiLayoutSplit(layout, 0, 0);
|
||||||
|
|
||||||
col= uiLayoutColumn(split, 1);
|
col= uiLayoutColumn(split, 1);
|
||||||
uiItemR(col, "X", 0, &imaptr, "generated_width", 0);
|
uiItemR(col, "X", 0, &imaptr, "generated_width", 0);
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
|
|||||||
{
|
{
|
||||||
uiLayout *split, *colsub;
|
uiLayout *split, *colsub;
|
||||||
|
|
||||||
split = uiLayoutSplit(layout, 0.8);
|
split = uiLayoutSplit(layout, 0.8, 0);
|
||||||
|
|
||||||
if (ptr->type == &RNA_PoseBone) {
|
if (ptr->type == &RNA_PoseBone) {
|
||||||
PointerRNA boneptr;
|
PointerRNA boneptr;
|
||||||
@@ -518,7 +518,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
|
|||||||
uiItemL(colsub, "", 0);
|
uiItemL(colsub, "", 0);
|
||||||
uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
|
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")) {
|
switch(RNA_enum_get(ptr, "rotation_mode")) {
|
||||||
case ROT_MODE_QUAT: /* quaternion */
|
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);
|
uiItemR(layout, "", 0, ptr, "rotation_mode", 0);
|
||||||
|
|
||||||
split = uiLayoutSplit(layout, 0.8);
|
split = uiLayoutSplit(layout, 0.8, 0);
|
||||||
colsub = uiLayoutColumn(split, 1);
|
colsub = uiLayoutColumn(split, 1);
|
||||||
uiItemR(colsub, "Scale", 0, ptr, "scale", 0);
|
uiItemR(colsub, "Scale", 0, ptr, "scale", 0);
|
||||||
colsub = uiLayoutColumn(split, 1);
|
colsub = uiLayoutColumn(split, 1);
|
||||||
|
|||||||
@@ -908,7 +908,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe
|
|||||||
/* UI */
|
/* UI */
|
||||||
uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", 0);
|
uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", 0);
|
||||||
uiLayout *layout= uiPupMenuLayout(pup);
|
uiLayout *layout= uiPupMenuLayout(pup);
|
||||||
uiLayout *split= uiLayoutSplit(layout, 0);
|
uiLayout *split= uiLayoutSplit(layout, 0, 0);
|
||||||
uiLayout *column= uiLayoutColumn(split, 0);
|
uiLayout *column= uiLayoutColumn(split, 0);
|
||||||
LinkNode *node;
|
LinkNode *node;
|
||||||
|
|
||||||
|
|||||||
@@ -1155,7 +1155,7 @@ static void rna_def_solid_color(BlenderRNA *brna)
|
|||||||
{
|
{
|
||||||
StructRNA *srna;
|
StructRNA *srna;
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
|
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_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
|
||||||
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
|
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ void RNA_api_ui_layout(StructRNA *srna)
|
|||||||
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
|
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
|
||||||
RNA_def_function_return(func, parm);
|
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_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 */
|
/* items */
|
||||||
func= RNA_def_function(srna, "prop", "rna_uiItemR");
|
func= RNA_def_function(srna, "prop", "rna_uiItemR");
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
|
|||||||
|
|
||||||
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
|
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
|
||||||
|
|
||||||
split = uiLayoutSplit(layout, 0);
|
split = uiLayoutSplit(layout, 0, 0);
|
||||||
col = uiLayoutColumn(split, 0);
|
col = uiLayoutColumn(split, 0);
|
||||||
uiItemL(col, "Links", 0);
|
uiItemL(col, "Links", 0);
|
||||||
uiItemO(col, NULL, ICON_URL, "HELP_OT_release_logs");
|
uiItemO(col, NULL, ICON_URL, "HELP_OT_release_logs");
|
||||||
|
|||||||
@@ -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 *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 *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;}
|
||||||
struct uiLayout *uiLayoutBox(struct uiLayout *layout){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 uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
|
||||||
void uiItemMenuEnumR(struct uiLayout *layout, char *name, int icon, 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){}
|
void uiItemEnumR_string(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value){}
|
||||||
|
|||||||
Reference in New Issue
Block a user