[Bf-blender-cvs] [51be9ff] ui_layout_gridflow: Add gridflow layout RNA API
Bastien Montagne
noreply at git.blender.org
Sun Dec 4 12:45:55 CET 2016
Commit: 51be9ff07a298186b18cbd2ba896e4d161749e3d
Author: Bastien Montagne
Date: Fri Nov 25 16:59:38 2016 +0100
Branches: ui_layout_gridflow
https://developer.blender.org/rB51be9ff07a298186b18cbd2ba896e4d161749e3d
Add gridflow layout RNA API
===================================================================
M source/blender/editors/include/UI_interface.h
M source/blender/editors/interface/interface_layout.c
M source/blender/makesrna/intern/rna_ui_api.c
===================================================================
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 515ad49..a309c1e 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -893,8 +893,7 @@ float uiLayoutGetScaleY(uiLayout *layout);
uiLayout *uiLayoutRow(uiLayout *layout, int align);
uiLayout *uiLayoutColumn(uiLayout *layout, int align);
uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align);
-uiLayout *uiLayoutGridFlow(uiLayout *layout, const bool row_major, const int num_columns, const int align,
- const bool even_columns, const bool even_rows);
+uiLayout *uiLayoutGridFlow(uiLayout *layout, int row_major, int num_columns, int align, int even_columns, int even_rows);
uiLayout *uiLayoutBox(uiLayout *layout);
uiLayout *uiLayoutListBox(uiLayout *layout, struct uiList *ui_list, struct PointerRNA *ptr, struct PropertyRNA *prop,
struct PointerRNA *actptr, struct PropertyRNA *actprop);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index dfc03dc..a3e77bd 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -3041,9 +3041,7 @@ uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align)
return &flow->litem;
}
-uiLayout *uiLayoutGridFlow(
- uiLayout *layout, const bool row_major, const int num_columns, const int align,
- const bool even_columns, const bool even_rows)
+uiLayout *uiLayoutGridFlow(uiLayout *layout, int row_major, int num_columns, int align, int even_columns, int even_rows)
{
uiLayoutItemGridFlow *flow;
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 9d55115..d6c9bc4 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -454,6 +454,15 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_function_return(func, parm);
RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
+ func = RNA_def_function(srna, "grid_flow", "uiLayoutGridFlow");
+ RNA_def_boolean(func, "row_major", false, "", "Fill row by row, instead of column by column");
+ RNA_def_int(func, "num_columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
+ RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
+ RNA_def_boolean(func, "even_columns", false, "", "All columns will have the same width");
+ RNA_def_boolean(func, "even_rows", false, "", "All rows will have the same height");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ RNA_def_function_return(func, parm);
+
/* box layout */
func = RNA_def_function(srna, "box", "uiLayoutBox");
parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
More information about the Bf-blender-cvs
mailing list