mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-28 01:00:17 +08:00
Support .rpm
This commit is contained in:
@@ -23,38 +23,42 @@
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="image"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="120"
|
||||
Height="120"
|
||||
Margin="8"
|
||||
VerticalAlignment="Top"
|
||||
Opacity="0"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
SnapsToDevicePixels="True"
|
||||
Stretch="Fill"
|
||||
UseLayoutRounding="True">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Source, ElementName=image}" Value="{x:Null}">
|
||||
<DataTrigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.05" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</DataTrigger.ExitActions>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
<Border x:Name="imageBk"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="124"
|
||||
Height="124"
|
||||
VerticalAlignment="Top"
|
||||
CornerRadius="8">
|
||||
<Image x:Name="image"
|
||||
Width="120"
|
||||
Height="120"
|
||||
Opacity="0"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
SnapsToDevicePixels="True"
|
||||
Stretch="Fill"
|
||||
UseLayoutRounding="True">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Source, ElementName=image}" Value="{x:Null}">
|
||||
<DataTrigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.05" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</DataTrigger.ExitActions>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</Border>
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5" />
|
||||
@@ -73,6 +77,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1"
|
||||
@@ -143,47 +148,67 @@
|
||||
Text="Searching..."
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="Wrap" />
|
||||
<!-- Vendor -->
|
||||
<TextBlock x:Name="vendorTitle"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Vendor" />
|
||||
<TextBlock x:Name="vendor"
|
||||
Grid.Row="6"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Searching..."
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="Wrap" />
|
||||
<!-- Type -->
|
||||
<TextBlock x:Name="typeTitle"
|
||||
Grid.Row="6"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Type" />
|
||||
Text="Type"
|
||||
Visibility="Collapsed" />
|
||||
<TextBlock x:Name="type"
|
||||
Grid.Row="6"
|
||||
Grid.Row="7"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Searching..."
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="Wrap" />
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed" />
|
||||
<!-- Terminal -->
|
||||
<TextBlock x:Name="terminalTitle"
|
||||
Grid.Row="7"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Terminal" />
|
||||
Text="Terminal"
|
||||
Visibility="Collapsed" />
|
||||
<TextBlock x:Name="terminal"
|
||||
Grid.Row="7"
|
||||
Grid.Row="8"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Searching..."
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="Wrap" />
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed" />
|
||||
<!-- Total Size -->
|
||||
<TextBlock x:Name="totalSizeTitle"
|
||||
Grid.Row="8"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Total Size" />
|
||||
<TextBlock x:Name="totalSize"
|
||||
Grid.Row="8"
|
||||
Grid.Row="9"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Padding="3"
|
||||
@@ -191,13 +216,13 @@
|
||||
Text="Calculating size..." />
|
||||
<!-- Last Modified -->
|
||||
<TextBlock x:Name="modDateTitle"
|
||||
Grid.Row="9"
|
||||
Grid.Row="10"
|
||||
Grid.Column="1"
|
||||
Padding="3"
|
||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||
Text="Last Modified" />
|
||||
<TextBlock x:Name="modDate"
|
||||
Grid.Row="9"
|
||||
Grid.Row="10"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Padding="3"
|
||||
@@ -206,7 +231,7 @@
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
<!-- Environment -->
|
||||
<GroupBox x:Name="environmentGroupBox"
|
||||
Grid.Row="10"
|
||||
Grid.Row="11"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="3,3,16,16"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
using QuickLook.Common.ExtensionMethods;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin;
|
||||
using QuickLook.Plugin.AppViewer.PackageParsers.AppImage;
|
||||
using QuickLook.Plugin.AppViewer.PackageParsers.Rpm;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
@@ -26,6 +25,7 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace QuickLook.Plugin.AppViewer.InfoPanels;
|
||||
@@ -45,6 +45,7 @@ public partial class RpmInfoPanel : UserControl, IAppInfoPanel
|
||||
applicationNameTitle.Text = TranslationHelper.Get("APP_NAME", translationFile);
|
||||
versionTitle.Text = TranslationHelper.Get("APP_VERSION", translationFile);
|
||||
architectureTitle.Text = TranslationHelper.Get("ARCHITECTURE", translationFile);
|
||||
vendorTitle.Text = TranslationHelper.Get("VENDOR", translationFile);
|
||||
typeTitle.Text = TranslationHelper.Get("TYPE", translationFile);
|
||||
terminalTitle.Text = TranslationHelper.Get("TERMINAL", translationFile);
|
||||
totalSizeTitle.Text = TranslationHelper.Get("TOTAL_SIZE", translationFile);
|
||||
@@ -69,19 +70,21 @@ public partial class RpmInfoPanel : UserControl, IAppInfoPanel
|
||||
{
|
||||
applicationName.Text = rpmInfo.Name;
|
||||
version.Text = rpmInfo.Version;
|
||||
architectureName.Text = rpmInfo.Arch;
|
||||
type.Text = rpmInfo.Type;
|
||||
terminal.Text = rpmInfo.Terminal;
|
||||
architectureName.Text = rpmInfo.Arch; // Not impl
|
||||
vendor.Text = rpmInfo.Vendor;
|
||||
type.Text = rpmInfo.Type; // Not impl
|
||||
terminal.Text = rpmInfo.Terminal; // Not impl
|
||||
totalSize.Text = size.ToPrettySize(2);
|
||||
modDate.Text = last.ToString(CultureInfo.CurrentCulture);
|
||||
permissions.ItemsSource = rpmInfo.Env;
|
||||
permissions.ItemsSource = rpmInfo.Env; // Not impl
|
||||
|
||||
if (rpmInfo.HasIcon)
|
||||
if (rpmInfo.HasIcon) // Not impl
|
||||
{
|
||||
image.Source = rpmInfo.Logo.ToBitmapSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
imageBk.Background = new SolidColorBrush(OSThemeHelper.AppsUseDarkTheme() ? Colors.LightGray : Colors.White);
|
||||
image.Source = new BitmapImage(new Uri("pack://application:,,,/QuickLook.Plugin.AppViewer;component/Resources/rpm.png"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user