From a112ea58acc740fcf452c95902cba445e55dcdd4 Mon Sep 17 00:00:00 2001 From: ema Date: Tue, 30 Sep 2025 22:30:30 +0800 Subject: [PATCH] Support VideoViewer error text wrapping --- .../QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs index a58b4de..7d0d660 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs @@ -204,8 +204,12 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan { ((MediaUriElement)sender).Dispatcher.BeginInvoke(new Action(() => { - _context.ViewerContent = - new Label { Content = e.Exception, VerticalAlignment = VerticalAlignment.Center }; + _context.ViewerContent = new TextBlock() + { + Text = e.Exception.ToString(), + TextWrapping = TextWrapping.Wrap, + VerticalAlignment = VerticalAlignment.Center, + }; _context.IsBusy = false; })); } @@ -215,7 +219,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan if (mediaElement == null) return; - mediaElement.MediaPosition = 0; + mediaElement.MediaPosition = 0L; if (ShouldLoop) { IsPlaying = true; @@ -233,7 +237,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan private void ShowViedoControlContainer(object sender, MouseEventArgs e) { var show = (Storyboard)videoControlContainer.FindResource("ShowControlStoryboard"); - if (videoControlContainer.Opacity == 0 || videoControlContainer.Opacity == 1) + if (videoControlContainer.Opacity == 0d || videoControlContainer.Opacity == 1d) show.Begin(); }