diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 14:36:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 14:45:36 +0300 |
commit | 2af0ec9457b2997e1e903f284dd48bae6534682b (patch) | |
tree | 863b1befb6caecc590187ed8ed855e895ae819a4 /release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | |
parent | 25fcb44d2db2837b611aefb43207fc011b68a34a (diff) |
UI: move gizmo orientation settings into popover
Instead of link toggle with enum, use a single popover that contains
both settings. The code for this isn't nice - needing 3x panels for now.
See D4075
Diffstat (limited to 'release/scripts/startup/bl_ui/space_toolsystem_toolbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 590d4299968..6a2de414ae7 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -67,13 +67,25 @@ class _template_widget: class TRANSFORM_GGT_gizmo: @staticmethod def draw_settings_with_index(context, layout, index): - row = layout.row(align=True) scene = context.scene - orientation_slot = scene.transform_orientation_slots[index] - value = orientation_slot.use - row.prop(orientation_slot, "use", text="", icon='LINKED' if value else 'UNLINKED') - if not value: - row.prop(orientation_slot, "type", text="") + orient_slot = scene.transform_orientation_slots[index] + use_global = orient_slot.use_global + row = layout.row(align=True) + + row.label(text="Orientation:") + + popover_kw = { + "panel": "VIEW3D_PT_transform_orientations_gizmo_" f"{index}", + } + + if use_global: + popover_kw["text"], popover_kw["icon"] = "Scene", 'OBJECT_ORIGIN' + else: + popover_kw["text"], popover_kw["icon_value"] = orient_slot.ui_info() + + sub = layout.row() + sub.ui_units_x = 4 + sub.popover(**popover_kw) class _defs_view3d_generic: |