diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-26 18:44:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-26 19:24:09 +0300 |
commit | cbe82f81e1e02c201235d030b3e59025747bf9c4 (patch) | |
tree | 3a5fa59f1ccfd59dc6b10063dc6a9ed9209db8e2 /source/blender/makesrna/intern/rna_ui.c | |
parent | b2a569dd68357e535c79c8a4a74947773f21023f (diff) |
UI: allow fractical unit size for layouts.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index eccf0e73d8e..7d9f547ea0d 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -947,22 +947,22 @@ static void rna_UILayout_scale_y_set(PointerRNA *ptr, float value) uiLayoutSetScaleY(ptr->data, value); } -static int rna_UILayout_units_x_get(PointerRNA *ptr) +static float rna_UILayout_units_x_get(PointerRNA *ptr) { return uiLayoutGetUnitsX(ptr->data); } -static void rna_UILayout_units_x_set(PointerRNA *ptr, int value) +static void rna_UILayout_units_x_set(PointerRNA *ptr, float value) { uiLayoutSetUnitsX(ptr->data, value); } -static int rna_UILayout_units_y_get(PointerRNA *ptr) +static float rna_UILayout_units_y_get(PointerRNA *ptr) { return uiLayoutGetUnitsY(ptr->data); } -static void rna_UILayout_units_y_set(PointerRNA *ptr, int value) +static void rna_UILayout_units_y_set(PointerRNA *ptr, float value) { uiLayoutSetUnitsY(ptr->data, value); } @@ -1057,12 +1057,12 @@ static void rna_def_ui_layout(BlenderRNA *brna) RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout"); - prop = RNA_def_property(srna, "ui_units_x", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_UILayout_units_x_get", "rna_UILayout_units_x_set", NULL); + prop = RNA_def_property(srna, "ui_units_x", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_funcs(prop, "rna_UILayout_units_x_get", "rna_UILayout_units_x_set", NULL); RNA_def_property_ui_text(prop, "Units X", "Fixed Size along the X for items in this (sub)layout"); - prop = RNA_def_property(srna, "ui_units_y", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_UILayout_units_y_get", "rna_UILayout_units_y_set", NULL); + prop = RNA_def_property(srna, "ui_units_y", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_funcs(prop, "rna_UILayout_units_y_get", "rna_UILayout_units_y_set", NULL); RNA_def_property_ui_text(prop, "Units Y", "Fixed Size along the Y for items in this (sub)layout"); RNA_api_ui_layout(srna); |