Skip to content

Commit

Permalink
feat: show meta info
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Dec 28, 2024
1 parent 768dc13 commit 61e1751
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
8 changes: 2 additions & 6 deletions QuickLook.Plugin.LottieFilesViewer/LottieFilesPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,8 @@
Background="{DynamicResource CaptionBackground}"
FontSize="11"
Foreground="{DynamicResource WindowTextForeground}"
IsHitTestVisible="False">
<TextBlock.Inlines>
<Run FontWeight="SemiBold">Version</Run>
<Run>:&#160;</Run>
<Run>x.x.x</Run>
</TextBlock.Inlines>
IsHitTestVisible="False"
Text="{Binding Meta}">
<TextBlock.Style>
<Style>
<Style.Setters>
Expand Down
33 changes: 32 additions & 1 deletion QuickLook.Plugin.LottieFilesViewer/LottieFilesPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Threading;
Expand Down Expand Up @@ -70,6 +69,15 @@ public string FileName
if (value == _fileName) return;
_fileName = value;
OnPropertyChanged();

Meta =
$"""
Version: {lottieView.Info.Version}
Duration: {lottieView.Info.Duration}
Fps: {lottieView.Info.Fps}
InPoint: {lottieView.Info.InPoint}
OutPoint: {lottieView.Info.OutPoint}
""";
}
}

Expand All @@ -83,6 +91,28 @@ public string JsonContent
if (value == _jsonContent) return;
_jsonContent = value;
OnPropertyChanged();

Meta =
$"""
Version: {lottieView.Info.Version}
Duration: {lottieView.Info.Duration}
Fps: {lottieView.Info.Fps}
InPoint: {lottieView.Info.InPoint}
OutPoint: {lottieView.Info.OutPoint}
""";
}
}

private string _meta = string.Empty;

public string Meta
{
get => _meta;
set
{
if (value == _meta) return;
_meta = value;
OnPropertyChanged();
}
}

Expand Down Expand Up @@ -250,6 +280,7 @@ private void Timer_Tick(object sender, EventArgs e)

_timer.Stop();

// TODO: lottieView.AnimationScale?
// Apply zoom
ViewerWidth = ScaleX * OriginalWidth;
ViewerHeight = ScaleY * OriginalHeight;
Expand Down

0 comments on commit 61e1751

Please sign in to comment.