Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/wm.py
| Show First 20 Lines • Show All 1,444 Lines • ▼ Show 20 Lines | def check(self, _context): | ||||
| return changed | return changed | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| from rna_prop_ui import ( | from rna_prop_ui import ( | ||||
| rna_idprop_value_item_type, | rna_idprop_value_item_type, | ||||
| ) | ) | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| layout.prop(self, "property") | layout.prop(self, "property") | ||||
| layout.prop(self, "value") | layout.prop(self, "value") | ||||
HooglyBoogly: We could omit "Property" from the name here, but since the width of the popup is fixed there is… | |||||
| value = self.get_value_eval() | value = self.get_value_eval() | ||||
| proptype, is_array = rna_idprop_value_item_type(value) | proptype, is_array = rna_idprop_value_item_type(value) | ||||
| row = layout.row() | row = layout.row() | ||||
| row.enabled = proptype in {int, float, str} | row.enabled = proptype in {int, float, str} | ||||
| row.prop(self, "default") | row.prop(self, "default") | ||||
| row = layout.row(align=True) | col = layout.column(align=True) | ||||
| row.prop(self, "min") | col.prop(self, "min") | ||||
| row.prop(self, "max") | col.prop(self, "max") | ||||
| row = layout.row() | col = layout.column() | ||||
| row.prop(self, "use_soft_limits") | col.prop(self, "is_overridable_library") | ||||
| row.prop(self, "is_overridable_library") | col.prop(self, "use_soft_limits") | ||||
| row = layout.row(align=True) | col = layout.column(align=True) | ||||
| row.enabled = self.use_soft_limits | col.enabled = self.use_soft_limits | ||||
| row.prop(self, "soft_min", text="Soft Min") | col.prop(self, "soft_min", text="Soft Min") | ||||
| row.prop(self, "soft_max", text="Soft Max") | col.prop(self, "soft_max", text="Max") | ||||
| layout.prop(self, "description") | layout.prop(self, "description") | ||||
| if is_array and proptype == float: | if is_array and proptype == float: | ||||
| layout.prop(self, "subtype") | layout.prop(self, "subtype") | ||||
| class WM_OT_properties_add(Operator): | class WM_OT_properties_add(Operator): | ||||
| """Add your own property to the data-block""" | """Add your own property to the data-block""" | ||||
| ▲ Show 20 Lines • Show All 1,182 Lines • Show Last 20 Lines | |||||
We could omit "Property" from the name here, but since the width of the popup is fixed there is way too much empty space without it which looks weird.