Use app fallback logo

This commit is contained in:
ema
2025-06-01 13:32:33 +08:00
parent fdb602b9ed
commit 1a83848c2c
9 changed files with 38 additions and 16 deletions

View File

@@ -24,7 +24,10 @@
Margin="8"
VerticalAlignment="Top"
Opacity="0"
Stretch="Fill">
RenderOptions.BitmapScalingMode="HighQuality"
SnapsToDevicePixels="True"
Stretch="Fill"
UseLayoutRounding="True">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>

View File

@@ -19,6 +19,7 @@ using QuickLook.Common.ExtensionMethods;
using QuickLook.Common.Helpers;
using QuickLook.Common.Plugin;
using QuickLook.Plugin.AppViewer.ApkPackageParser;
using System;
using System.Globalization;
using System.IO;
using System.Reflection;
@@ -76,14 +77,21 @@ public partial class ApkInfoPanel : UserControl, IAppInfoPanel
modDate.Text = last.ToString(CultureInfo.CurrentCulture);
permissions.ItemsSource = apkInfo.Permissions;
using var stream = new MemoryStream(apkInfo.Logo);
var icon = new BitmapImage();
icon.BeginInit();
icon.CacheOption = BitmapCacheOption.OnLoad;
icon.StreamSource = stream;
icon.EndInit();
icon.Freeze();
image.Source = icon;
if (!apkInfo.HasIcon)
{
using var stream = new MemoryStream(apkInfo.Logo);
var icon = new BitmapImage();
icon.BeginInit();
icon.CacheOption = BitmapCacheOption.OnLoad;
icon.StreamSource = stream;
icon.EndInit();
icon.Freeze();
image.Source = icon;
}
else
{
image.Source = new BitmapImage(new Uri("pack://application:,,,/QuickLook.Plugin.AppViewer;component/Resources/android.png"));
}
_context.IsBusy = false;
});

View File

@@ -19,9 +19,6 @@ using System.Collections.Generic;
namespace QuickLook.Plugin.AppViewer.ApkPackageParser;
/// <summary>
/// https://github.com/hylander0/Iteedee.ApkReader
/// </summary>
public class ApkInfo
{
public string Label { get; set; }

View File

@@ -23,7 +23,10 @@
Height="128"
VerticalAlignment="Top"
Opacity="0"
Stretch="Fill">
RenderOptions.BitmapScalingMode="HighQuality"
SnapsToDevicePixels="True"
Stretch="Fill"
UseLayoutRounding="True">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>

View File

@@ -24,7 +24,10 @@
Margin="8"
VerticalAlignment="Top"
Opacity="0"
Stretch="Fill">
RenderOptions.BitmapScalingMode="HighQuality"
SnapsToDevicePixels="True"
Stretch="Fill"
UseLayoutRounding="True">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>

View File

@@ -20,6 +20,7 @@ using QuickLook.Common.Helpers;
using QuickLook.Common.Plugin;
using QuickLook.Plugin.AppViewer.ApkPackageParser;
using QuickLook.Plugin.AppViewer.IpaPackageParser;
using System;
using System.Globalization;
using System.IO;
using System.Reflection;
@@ -78,7 +79,7 @@ public partial class IpaInfoPanel : UserControl, IAppInfoPanel
modDate.Text = last.ToString(CultureInfo.CurrentCulture);
permissions.ItemsSource = ipaInfo.Permissions;
if (ipaInfo.Logo != null)
if (!ipaInfo.HasIcon)
{
using var stream = new MemoryStream(ipaInfo.Logo);
var icon = new BitmapImage();
@@ -89,6 +90,10 @@ public partial class IpaInfoPanel : UserControl, IAppInfoPanel
icon.Freeze();
image.Source = icon;
}
else
{
image.Source = new BitmapImage(new Uri("pack://application:,,,/QuickLook.Plugin.AppViewer;component/Resources/ios.png"));
}
_context.IsBusy = false;
});

View File

@@ -24,7 +24,10 @@
Height="128"
Margin="0,-20,0,0"
Opacity="0"
Stretch="Fill">
RenderOptions.BitmapScalingMode="HighQuality"
SnapsToDevicePixels="True"
Stretch="Fill"
UseLayoutRounding="True">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB