fix(editor): the preview tools take the editor from their viewport, not by element name
The viewport presents its tools outside the view's logical tree, where the EditorRoot name may not resolve: the row then lost its data context, so the crop result toggle showed without a tooltip and Compare lost its state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
1 file changed
+6
-2
@@ -124,8 +124,12 @@
|
|||||||
CropMaskMode="{Binding CropMaskMode}" InfoText="{Binding InfoText}" ToolTip="{l:Loc Tooltips.Editor.Preview.View}"
|
CropMaskMode="{Binding CropMaskMode}" InfoText="{Binding InfoText}" ToolTip="{l:Loc Tooltips.Editor.Preview.View}"
|
||||||
AutomationProperties.Name="{l:Loc Editor.Preview}" SizeChanged="OnPreviewSizeChanged">
|
AutomationProperties.Name="{l:Loc Editor.Preview}" SizeChanged="OnPreviewSizeChanged">
|
||||||
<v:PreviewViewport.ToolsContent>
|
<v:PreviewViewport.ToolsContent>
|
||||||
<!-- Tools give the keyboard back to the preview after a click, so Space keeps playing (OnToolClicked). -->
|
<!--
|
||||||
<StackPanel Orientation="Horizontal" DataContext="{Binding DataContext, ElementName=EditorRoot}" ButtonBase.Click="OnToolClicked">
|
Tools give the keyboard back to the preview after a click, so Space keeps playing (OnToolClicked). The viewport
|
||||||
|
presents them outside the view's logical tree, so they take the editor from the viewport they sit in.
|
||||||
|
-->
|
||||||
|
<StackPanel Orientation="Horizontal" DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=v:PreviewViewport}}"
|
||||||
|
ButtonBase.Click="OnToolClicked">
|
||||||
<ToggleButton Style="{StaticResource ToggleButton.PreviewTool}" IsChecked="{Binding IsCompare}" ui:ButtonIcon.Glyph="{StaticResource Icon.Compare}"
|
<ToggleButton Style="{StaticResource ToggleButton.PreviewTool}" IsChecked="{Binding IsCompare}" ui:ButtonIcon.Glyph="{StaticResource Icon.Compare}"
|
||||||
Content="{l:Loc Editor.Preview.Compare}" ToolTip="{l:Loc Tooltips.Editor.Preview.Compare}" />
|
Content="{l:Loc Editor.Preview.Compare}" ToolTip="{l:Loc Tooltips.Editor.Preview.Compare}" />
|
||||||
<ToggleButton Visibility="{Binding IsExportTab, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" Style="{StaticResource ToggleButton.PreviewTool}"
|
<ToggleButton Visibility="{Binding IsExportTab, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" Style="{StaticResource ToggleButton.PreviewTool}"
|
||||||
|
|||||||
Reference in new issue
Block a user