diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-28 05:38:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-28 05:50:11 +0300 |
commit | d3a72033f6804f2803502c133c40d5aa3891b4f9 (patch) | |
tree | 9157921d74c4f0e441b8280fbc473d5277d6a195 /release/scripts/modules | |
parent | e9fb2feb2eaef92384b4bf7064fe2c61b1d3dad9 (diff) |
RNA: UILayout.split(..) 'percentage' to 'factor'
Misleading name since it's between 0..1.
Use as a keyword argument to prepare for keyword only args.
Also document that leaving unset has special behavior.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpyml.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rna_keymap_ui.py | 10 | ||||
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/release/scripts/modules/bpyml.py b/release/scripts/modules/bpyml.py index 3cdbf848a24..d7f03a3f0c1 100644 --- a/release/scripts/modules/bpyml.py +++ b/release/scripts/modules/bpyml.py @@ -182,7 +182,7 @@ if __name__ == "__main__": prop(data='context.scene.render', property='stamp_font_size', text='Font Size') ] ], - split(percentage=0.2)[ + split(factor=0.2)[ prop(data='context.scene.render', property='use_stamp_note', text='Note'), row()[ active(expr='context.scene.render.use_stamp_note'), diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py index e151a81913b..776d2d81d98 100644 --- a/release/scripts/modules/rna_keymap_ui.py +++ b/release/scripts/modules/rna_keymap_ui.py @@ -39,7 +39,7 @@ def _indented_layout(layout, level): level = 0.0001 # Tweak so that a percentage of 0 won't split by half indent = level * indentpx / bpy.context.region.width - split = layout.split(percentage=indent) + split = layout.split(factor=indent) col = split.column() col = split.column() return col @@ -103,7 +103,7 @@ def draw_km(display_keymaps, kc, km, children, layout, level): # "Add New" at end of keymap item list subcol = _indented_layout(col, kmi_level) - subcol = subcol.split(percentage=0.2).column() + subcol = subcol.split(factor=0.2).column() subcol.operator("wm.keyitem_add", text="Add New", text_ctxt=i18n_contexts.id_windowmanager, icon='ZOOMIN') @@ -167,7 +167,7 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level): if kmi.show_expanded: box = col.box() - split = box.split(percentage=0.4) + split = box.split(factor=0.4) sub = split.row() if km.is_modal: @@ -349,7 +349,7 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout): # "Add New" at end of keymap item list col = _indented_layout(layout, 1) - subcol = col.split(percentage=0.2).column() + subcol = col.split(factor=0.2).column() subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN') return True @@ -386,7 +386,7 @@ def draw_keymaps(context, layout): # layout.context_pointer_set("keyconfig", wm.keyconfigs.active) # row.operator("wm.keyconfig_remove", text="", icon='X') row.separator() - rowsub = row.split(align=True, percentage=0.33) + rowsub = row.split(factor=0.33, align=True) # postpone drawing into rowsub, so we can set alert! col.separator() diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index a0c73a23454..c987609bafa 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -165,7 +165,7 @@ def draw(layout, context, context_member, property_type, use_edit=True): box = row.box() if use_edit: - split = box.split(percentage=0.75) + split = box.split(factor=0.75) row = split.row(align=True) else: row = box.row(align=True) |