merge: sequence editor with Export tab (preview through the render pipeline, section tabs, autosave with undo/redo)
Keeps the sync captures and sample server next to the editor's sample sunset; the editor's capture runs last since it leaves an analysis running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
53 files changed
+8622
-18
No files matched your search
@@ -159,8 +159,8 @@
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{StaticResource Radius.Card}">
|
||||
<Grid>
|
||||
<v:PreviewSurface x:Name="PART_Surface" CornerRadius="8" />
|
||||
<ContentPresenter Content="{TemplateBinding ToolsContent}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="12" />
|
||||
<Grid x:Name="Info" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="12" IsHitTestVisible="False">
|
||||
<ContentPresenter x:Name="PART_Tools" Content="{TemplateBinding ToolsContent}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="12" />
|
||||
<Grid x:Name="PART_Info" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="12" IsHitTestVisible="False">
|
||||
<Border Background="{DynamicResource Brush.Chrome}" Opacity="0.85" CornerRadius="{StaticResource Radius.Control}" />
|
||||
<TextBlock Text="{TemplateBinding InfoText}" Margin="10,6" Typography.NumeralAlignment="Tabular" TextTrimming="CharacterEllipsis" />
|
||||
</Grid>
|
||||
@@ -168,10 +168,10 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="InfoText" Value="{x:Null}">
|
||||
<Setter TargetName="Info" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="PART_Info" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="InfoText" Value="">
|
||||
<Setter TargetName="Info" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="PART_Info" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -42,9 +42,13 @@ public readonly record struct MotionVector(float X, float Y, float Dx, float Dy)
|
||||
/// Fit and 1:1; Ctrl+0 fits, Ctrl+1 shows 1:1.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PartSurface, Type = typeof(FrameworkElement))]
|
||||
[TemplatePart(Name = PartTools, Type = typeof(FrameworkElement))]
|
||||
[TemplatePart(Name = PartInfo, Type = typeof(FrameworkElement))]
|
||||
public class PreviewViewport : Control
|
||||
{
|
||||
public const string PartSurface = "PART_Surface";
|
||||
public const string PartTools = "PART_Tools";
|
||||
public const string PartInfo = "PART_Info";
|
||||
|
||||
public static readonly RoutedCommand FitCommand = new(nameof(FitCommand), typeof(PreviewViewport), [new KeyGesture(Key.D0, ModifierKeys.Control)]);
|
||||
public static readonly RoutedCommand ActualSizeCommand = new(nameof(ActualSizeCommand), typeof(PreviewViewport), [new KeyGesture(Key.D1, ModifierKeys.Control)]);
|
||||
@@ -106,6 +110,9 @@ public class PreviewViewport : Control
|
||||
private const double DividerGrip = 6;
|
||||
|
||||
private PreviewSurface? _surface;
|
||||
private FrameworkElement? _tools;
|
||||
private FrameworkElement? _info;
|
||||
private Thickness _infoMargin;
|
||||
private ViewTransform _view = new(1, 0, 0);
|
||||
private Size _imageSize = Size.Empty;
|
||||
private bool _syncingZoom;
|
||||
@@ -192,6 +199,9 @@ public class PreviewViewport : Control
|
||||
{
|
||||
if (_surface is not null) _surface.SizeChanged -= OnSurfaceSizeChanged;
|
||||
base.OnApplyTemplate();
|
||||
_tools = GetTemplateChild(PartTools) as FrameworkElement;
|
||||
_info = GetTemplateChild(PartInfo) as FrameworkElement;
|
||||
if (_info is not null) _infoMargin = _info.Margin;
|
||||
_surface = GetTemplateChild(PartSurface) as PreviewSurface;
|
||||
if (_surface is null) return;
|
||||
_surface.Owner = this;
|
||||
@@ -200,6 +210,19 @@ public class PreviewViewport : Control
|
||||
ApplyZoomMode();
|
||||
}
|
||||
|
||||
/// <summary>The shot data pill sits beside the tools at the bottom, and just above them when both do not fit in one row.</summary>
|
||||
protected override Size ArrangeOverride(Size arrangeBounds)
|
||||
{
|
||||
var size = base.ArrangeOverride(arrangeBounds);
|
||||
if (_tools is not null && _info is not null)
|
||||
{
|
||||
var lifted = _tools.DesiredSize.Width + _info.DesiredSize.Width > arrangeBounds.Width;
|
||||
var margin = lifted ? _infoMargin with { Bottom = _tools.DesiredSize.Height - _tools.Margin.Top + 6 } : _infoMargin;
|
||||
if (_info.Margin != margin) _info.Margin = margin;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
@@ -285,6 +308,9 @@ public class PreviewViewport : Control
|
||||
var viewport = (PreviewViewport)d;
|
||||
var size = PixelSize(viewport.Source);
|
||||
var resized = size != viewport._imageSize;
|
||||
// The same picture at another resolution (a 1:1 render replacing the fitted one) keeps what is on screen.
|
||||
if (resized && !size.IsEmpty && !viewport._imageSize.IsEmpty && viewport._view.Scale > 0)
|
||||
viewport._view = viewport._view with { Scale = viewport._view.Scale * viewport._imageSize.Width / size.Width };
|
||||
viewport._imageSize = size;
|
||||
viewport._surface?.SetImages(viewport.Source, viewport.OriginalSource, size);
|
||||
// Same-size frames (scrubbing) keep zoom and pan; a new size refits or re-clamps.
|
||||
|
||||
Reference in new issue
Block a user