mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-25 03:44:50 +00:00
finish auto-hide
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
x:Name="imagePanel"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Rectangle>
|
||||
<Rectangle Visibility="{Binding BackgroundVisibility, ElementName=imagePanel}">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush x:Name="backgroundBrush" ImageSource="Resources/background.png" AlignmentY="Top" Viewport="0,0,32,32"
|
||||
ViewportUnits="Absolute" Stretch="UniformToFill" TileMode="Tile" />
|
||||
|
@@ -45,6 +45,7 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
private BitmapScalingMode _renderMode = BitmapScalingMode.HighQuality;
|
||||
private BitmapSource _source;
|
||||
private double _zoomFactor = 1d;
|
||||
private Visibility _backgroundVisibility = Visibility.Visible;
|
||||
|
||||
private bool _zoomToFit = true;
|
||||
|
||||
@@ -88,6 +89,16 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
}
|
||||
}
|
||||
|
||||
public Visibility BackgroundVisibility
|
||||
{
|
||||
get => _backgroundVisibility;
|
||||
set
|
||||
{
|
||||
_backgroundVisibility = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public double MinZoomFactor
|
||||
{
|
||||
get => _minZoomFactor;
|
||||
|
@@ -64,8 +64,7 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
context.PreferredSize = new Size(1024, 768);
|
||||
|
||||
Directory.SetCurrentDirectory(App.AppPath);
|
||||
|
||||
context.AutoHideTitlebar = true;
|
||||
|
||||
context.TitlebarOverlap = true;
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Grid Grid.Column="1" Background="#00EFEFEF">
|
||||
<imageViewer:ImagePanel x:Name="pagePanel" RenderMode="NearestNeighbor" />
|
||||
<imageViewer:ImagePanel x:Name="pagePanel" RenderMode="NearestNeighbor" BackgroundVisibility="Collapsed" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -64,7 +64,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
_tvp = new TextViewerPanel(path);
|
||||
_tvp = new TextViewerPanel(path, context);
|
||||
|
||||
context.ViewerContent = _tvp;
|
||||
context.Title = $"{Path.GetFileName(path)}";
|
||||
|
@@ -21,7 +21,6 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using ICSharpCode.AvalonEdit.Highlighting;
|
||||
using QuickLook.Helpers;
|
||||
using UtfUnknown;
|
||||
|
||||
namespace QuickLook.Plugin.TextViewer
|
||||
@@ -31,7 +30,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
/// </summary>
|
||||
public partial class TextViewerPanel : UserControl
|
||||
{
|
||||
public TextViewerPanel(string path)
|
||||
public TextViewerPanel(string path, ContextObject context)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -42,7 +41,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
viewer.PreviewMouseWheel += Viewer_MouseWheel;
|
||||
|
||||
viewer.FontFamily =
|
||||
new FontFamily(TranslationHelper.GetString("Editor_FontFamily"));
|
||||
new FontFamily(context.GetString("Editor_FontFamily"));
|
||||
|
||||
LoadFile(path);
|
||||
}
|
||||
|
@@ -266,7 +266,7 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
[DebuggerNonUserCode]
|
||||
private void ShowErrorNotification(object sender, EventArgs e)
|
||||
{
|
||||
TrayIconManager.GetInstance().ShowNotification("", "An error occurred while loading the video.");
|
||||
_context.ShowNotification("", "An error occurred while loading the video.");
|
||||
mediaElement?.Stop();
|
||||
|
||||
Dispose();
|
||||
|
Reference in New Issue
Block a user