From 8dd941cac0bc7b230a986975f28b48c1235875c2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 15 Feb 2021 14:14:46 +0100 Subject: Tracking: Fix "Lock to Selection" option from header causing jump This change makes the behavior consistent between shortcut and option from space clip's header. The only caveat is that the "Lock to Selection" is removed from the Display popover. This is because it is rather hard to make operator to render same as regular checkbox. However, shouldn't be a problem because the setting in popover was redundant. Differential Revision: https://developer.blender.org/D10423 --- release/scripts/startup/bl_ui/space_clip.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 926be1ff820..ca7f9cdc100 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -113,7 +113,6 @@ class CLIP_PT_clip_display(Panel): row = layout.row() col = row.column() col.prop(sc.clip_user, "use_render_undistorted", text="Render Undistorted") - col.prop(sc, "lock_selection", text="Lock to Selection") col = row.column() col.prop(sc, "show_stable", text="Show Stable") col.prop(sc, "show_grid", text="Grid") @@ -190,7 +189,7 @@ class CLIP_HT_header(Header): row.prop(sc, "pivot_point", text="", icon_only=True) row = layout.row(align=True) icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED' - row.prop(sc, "lock_selection", icon=icon, text="") + row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection) row.popover(panel='CLIP_PT_display') elif sc.view == 'GRAPH': @@ -250,7 +249,7 @@ class CLIP_HT_header(Header): row.popover(panel='CLIP_PT_mask_display') row = layout.row(align=True) icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED' - row.prop(sc, "lock_selection", icon=icon, text="") + row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection) row.popover(panel='CLIP_PT_display') def draw(self, context): -- cgit v1.2.3