diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-09 17:50:05 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-09 17:54:26 +0300 |
commit | ec8a20fec0d103a799b9d9c86b0b55fba3b02b84 (patch) | |
tree | aa2e726ef01f1a87037920ac3333741482a45d59 /source/blender/makesrna/intern/rna_ui_api.c | |
parent | 5159ce640f787db0c93c56f046dc8290eb4fb67c (diff) |
Add new GridFlow layout.
This mimics the 'spreadsheet' behavior. Columns and/or rows can have
equal sizes, or adapt to their content - but always in a grid way (i.e.
all items in a same column will always have same available width, and
all items in a same row will always have same available height).
Also, you can fill (order) the grid in a row- or column-major way.
Not used anywhere for now.
Differential: https://developer.blender.org/D2395
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 3a7a2edd660..ab4bdc8164b 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -518,6 +518,19 @@ 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, INT_MIN, INT_MAX, "", + "Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are " + "automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. " + "columns for row major layout, and 2, 4, 6 etc. rows for column major layout)", + INT_MIN, INT_MAX); + 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"); + RNA_def_boolean(func, "align", false, "", "Align buttons to each other"); + 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"); |