修改部分布局

This commit is contained in:
ww-rm
2025-10-02 11:01:38 +08:00
parent 7e99882fbf
commit 4c72608398
9 changed files with 12 additions and 11 deletions

View File

@@ -18,7 +18,7 @@ namespace SpineViewer.ViewModels.Exporters
{ {
public class FFmpegVideoExporterViewModel(MainWindowViewModel vmMain) : VideoExporterViewModel(vmMain) public class FFmpegVideoExporterViewModel(MainWindowViewModel vmMain) : VideoExporterViewModel(vmMain)
{ {
public ImmutableArray<FFmpegVideoExporter.VideoFormat> VideoFormatOptions { get; } = Enum.GetValues<FFmpegVideoExporter.VideoFormat>().ToImmutableArray(); public static ImmutableArray<FFmpegVideoExporter.VideoFormat> VideoFormatOptions { get; } = Enum.GetValues<FFmpegVideoExporter.VideoFormat>().ToImmutableArray();
public FFmpegVideoExporter.VideoFormat Format { get => _format; set => SetProperty(ref _format, value); } public FFmpegVideoExporter.VideoFormat Format { get => _format; set => SetProperty(ref _format, value); }
protected FFmpegVideoExporter.VideoFormat _format = FFmpegVideoExporter.VideoFormat.Mp4; protected FFmpegVideoExporter.VideoFormat _format = FFmpegVideoExporter.VideoFormat.Mp4;

View File

@@ -20,7 +20,7 @@ namespace SpineViewer.ViewModels.Exporters
{ {
public class FrameExporterViewModel(MainWindowViewModel vmMain) : BaseExporterViewModel(vmMain) public class FrameExporterViewModel(MainWindowViewModel vmMain) : BaseExporterViewModel(vmMain)
{ {
public ImmutableArray<SKEncodedImageFormat> FrameFormatOptions { get; } = Enum.GetValues<SKEncodedImageFormat>().ToImmutableArray(); public static ImmutableArray<SKEncodedImageFormat> FrameFormatOptions { get; } = Enum.GetValues<SKEncodedImageFormat>().ToImmutableArray();
public SKEncodedImageFormat Format { get => _format; set => SetProperty(ref _format, value); } public SKEncodedImageFormat Format { get => _format; set => SetProperty(ref _format, value); }
protected SKEncodedImageFormat _format = SKEncodedImageFormat.Png; protected SKEncodedImageFormat _format = SKEncodedImageFormat.Png;

View File

@@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;
using Microsoft.Win32; using Microsoft.Win32;
using NLog; using NLog;
using Spine.Implementations; using Spine.Implementations;
using Spine.Interfaces;
using SpineViewer.Models; using SpineViewer.Models;
using SpineViewer.Natives; using SpineViewer.Natives;
using SpineViewer.Services; using SpineViewer.Services;

View File

@@ -25,7 +25,7 @@ namespace SpineViewer.ViewModels.MainWindow
{ {
public class SFMLRendererViewModel : ObservableObject public class SFMLRendererViewModel : ObservableObject
{ {
public ImmutableArray<Stretch> StretchOptions { get; } = Enum.GetValues<Stretch>().ToImmutableArray(); public static ImmutableArray<Stretch> StretchOptions { get; } = Enum.GetValues<Stretch>().ToImmutableArray();
/// <summary> /// <summary>
/// 日志器 /// 日志器

View File

@@ -18,7 +18,7 @@ namespace SpineViewer.ViewModels.MainWindow
private readonly ObservableCollection<SlotViewModel> _slots = []; private readonly ObservableCollection<SlotViewModel> _slots = [];
private readonly ObservableCollection<AnimationTrackViewModel> _animationTracks = []; private readonly ObservableCollection<AnimationTrackViewModel> _animationTracks = [];
public ImmutableArray<ISkeleton.Physics> PhysicsOptions { get; } = Enum.GetValues<ISkeleton.Physics>().ToImmutableArray(); public static ImmutableArray<ISkeleton.Physics> PhysicsOptions { get; } = Enum.GetValues<ISkeleton.Physics>().ToImmutableArray();
public SpineObjectModel[] SelectedObjects public SpineObjectModel[] SelectedObjects
{ {

View File

@@ -5,8 +5,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:SpineViewer.Views.ExporterDialogs" xmlns:local="clr-namespace:SpineViewer.Views.ExporterDialogs"
xmlns:exporters="clr-namespace:SpineViewer.ViewModels.Exporters" xmlns:vmexp="clr-namespace:SpineViewer.ViewModels.Exporters"
d:DataContext="{d:DesignInstance Type=exporters:FFmpegVideoExporterViewModel}" d:DataContext="{d:DesignInstance Type=vmexp:FFmpegVideoExporterViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
Title="{DynamicResource Str_FFmpegVideoExporterTitle}" Title="{DynamicResource Str_FFmpegVideoExporterTitle}"
Width="450" Width="450"
@@ -161,7 +161,7 @@
<!-- 视频格式 --> <!-- 视频格式 -->
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_VideoFormat}"/> <Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_VideoFormat}"/>
<ComboBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding Format}" ItemsSource="{Binding VideoFormatOptions}"/> <ComboBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding Format}" ItemsSource="{x:Static vmexp:FFmpegVideoExporterViewModel.VideoFormatOptions}"/>
<!-- 动图是否循环 --> <!-- 动图是否循环 -->
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_LoopPlay}" ToolTip="{DynamicResource Str_LoopPlayTooltip}"/> <Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_LoopPlay}" ToolTip="{DynamicResource Str_LoopPlayTooltip}"/>

View File

@@ -126,7 +126,7 @@
<!-- 图像格式 --> <!-- 图像格式 -->
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_ImageFormat}"/> <Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_ImageFormat}"/>
<ComboBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding Format}" ItemsSource="{Binding FrameFormatOptions}"/> <ComboBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding Format}" ItemsSource="{x:Static vmexp:FrameExporterViewModel.FrameFormatOptions}"/>
<!-- 图像质量 --> <!-- 图像质量 -->
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_ImageQuality}" ToolTip="{DynamicResource Str_ImageQualityTooltip}"/> <Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_ImageQuality}" ToolTip="{DynamicResource Str_ImageQualityTooltip}"/>

View File

@@ -327,7 +327,7 @@
<!-- 物理 --> <!-- 物理 -->
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_Physics}"/> <Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_Physics}"/>
<ComboBox Grid.Row="2" Grid.Column="1" SelectedValue="{Binding Physics}" ItemsSource="{Binding PhysicsOptions}"/> <ComboBox Grid.Row="2" Grid.Column="1" SelectedValue="{Binding Physics}" ItemsSource="{x:Static vm:SpineObjectTabViewModel.PhysicsOptions}"/>
<!-- 时间因子 --> <!-- 时间因子 -->
<Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource Str_TimeScale}" ToolTip="{DynamicResource Str_TimeScaleTootltip}"/> <Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource Str_TimeScale}" ToolTip="{DynamicResource Str_TimeScaleTootltip}"/>
@@ -790,7 +790,7 @@
<!-- 背景图案模式 --> <!-- 背景图案模式 -->
<Label Grid.Row="14" Grid.Column="0" Content="{DynamicResource Str_BackgroundImageMode}"/> <Label Grid.Row="14" Grid.Column="0" Content="{DynamicResource Str_BackgroundImageMode}"/>
<ComboBox Grid.Row="14" Grid.Column="1" SelectedValue="{Binding BackgroundImageMode}" ItemsSource="{Binding StretchOptions}"/> <ComboBox Grid.Row="14" Grid.Column="1" SelectedValue="{Binding BackgroundImageMode}" ItemsSource="{x:Static vm:SFMLRendererViewModel.StretchOptions}"/>
</Grid> </Grid>
</TabItem> </TabItem>
</TabControl> </TabControl>

View File

@@ -51,7 +51,7 @@
</Style> </Style>
</Border.Resources> </Border.Resources>
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Grid.IsSharedSizeScope="True"> <StackPanel Grid.IsSharedSizeScope="True" Margin="0 0 0 50">
<GroupBox Header="{DynamicResource Str_TextureLoadPreference}"> <GroupBox Header="{DynamicResource Str_TextureLoadPreference}">
<StackPanel> <StackPanel>
<Grid> <Grid>