diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs index d69931c..f461e6e 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs @@ -1,4 +1,4 @@ -// Copyright © 2018 Paddy Xu +// Copyright © 2018 Paddy Xu // // This file is part of QuickLook program. // @@ -79,6 +79,7 @@ namespace QuickLook.Plugin.ImageViewer viewPanel.PreviewMouseWheel += ViewPanel_PreviewMouseWheel; viewPanel.MouseLeftButtonDown += ViewPanel_MouseLeftButtonDown; viewPanel.MouseMove += ViewPanel_MouseMove; + viewPanel.MouseDoubleClick += ViewPanel_MouseDoubleClick; viewPanel.ManipulationInertiaStarting += ViewPanel_ManipulationInertiaStarting; viewPanel.ManipulationStarting += ViewPanel_ManipulationStarting; @@ -341,6 +342,11 @@ namespace QuickLook.Plugin.ImageViewer _dragInitPos = temp; } + private void ViewPanel_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + DoZoomToFit(); + } + private void ViewPanel_MouseMove(object sender, MouseEventArgs e) { if (!_dragInitPos.HasValue)