New built-in plugin PEViewer

This commit is contained in:
ema
2024-12-15 10:05:35 +08:00
parent 883657f6d5
commit dc67ab0065
25 changed files with 2457 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace QuickLook.Plugin.PEViewer;
public class FluentBorder : Decorator
{
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(FluentBorder), new FrameworkPropertyMetadata(new CornerRadius()));
public CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}
public static readonly DependencyProperty BackgroundProperty =
DependencyProperty.Register("Background", typeof(Brush), typeof(FluentBorder), new FrameworkPropertyMetadata(Brushes.Transparent));
public Brush Background
{
get => (Brush)GetValue(BackgroundProperty);
set => SetValue(BackgroundProperty, value);
}
protected override void OnRender(DrawingContext drawingContext)
{
if (Child != null)
{
Rect rect = new(new Point(0, 0), RenderSize);
drawingContext.DrawRoundedRectangle(Background, new Pen(Brushes.Transparent, 1), rect, CornerRadius.TopLeft, CornerRadius.TopRight);
}
}
}