From 2ff393bb981078bcdcffafd15719e8817051cf05 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 19 May 2019 14:51:21 +0200 Subject: UI: use single column layout for image settings panels --- .../scripts/startup/bl_ui/properties_data_empty.py | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'release/scripts/startup/bl_ui/properties_data_empty.py') diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py index 8302bc7cd13..ca1ebb0e03f 100644 --- a/release/scripts/startup/bl_ui/properties_data_empty.py +++ b/release/scripts/startup/bl_ui/properties_data_empty.py @@ -27,7 +27,8 @@ class DataButtonsPanel: @classmethod def poll(cls, context): - return (context.object and context.object.type == 'EMPTY') + ob = context.object + return (ob and ob.type == 'EMPTY') class DATA_PT_empty(DataButtonsPanel, Panel): @@ -36,6 +37,7 @@ class DATA_PT_empty(DataButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = True + layout.use_property_decorate = False ob = context.object @@ -43,11 +45,6 @@ class DATA_PT_empty(DataButtonsPanel, Panel): layout.prop(ob, "empty_display_size", text="Size") if ob.empty_display_type == 'IMAGE': - layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data") - layout.template_image(ob, "data", ob.image_user, compact=True) - - layout.row(align=True).row(align=True) - layout.prop(ob, "use_empty_image_alpha") col = layout.column() @@ -65,8 +62,25 @@ class DATA_PT_empty(DataButtonsPanel, Panel): col.prop(ob, "show_empty_image_perspective", text="Display Perspective") +class DATA_PT_empty_image(DataButtonsPanel, Panel): + bl_label = "Image" + + @classmethod + def poll(cls, context): + ob = context.object + return (ob and ob.type == 'EMPTY' and ob.empty_display_type == 'IMAGE') + + def draw(self, context): + layout = self.layout + ob = context.object + layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data") + layout.separator(); + layout.template_image(ob, "data", ob.image_user, compact=True) + + classes = ( DATA_PT_empty, + DATA_PT_empty_image, ) if __name__ == "__main__": # only for live edit. -- cgit v1.2.3