mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-11 01:03:32 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7146a2a220 | ||
|
|
491f55b6a8 | ||
|
|
d25b7b32de | ||
|
|
a887ca3014 | ||
|
|
5d3fd85238 |
@@ -1,3 +1,12 @@
|
||||
## 4.2.2
|
||||
|
||||
- Fix version display issue [#1776](https://github.com/QL-Win/QuickLook/issues/1776)
|
||||
|
||||
## 4.2.1
|
||||
|
||||
- Fix theme error in MediaInfoViewer plugin [#1775](https://github.com/QL-Win/QuickLook/issues/1775)
|
||||
- Fix theme error in any theme-changable plugin [#1507](https://github.com/QL-Win/QuickLook/issues/1507)
|
||||
|
||||
## 4.2.0
|
||||
|
||||
- Add built-in MediaInfoViewer plugin and support it in more menu
|
||||
|
||||
@@ -186,24 +186,13 @@ public class SvgImagePanel : WebpagePanel, IWebImagePanel
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
|
||||
public static class MimeTypes
|
||||
public new static class MimeTypes
|
||||
{
|
||||
public const string Html = "text/html";
|
||||
public const string JavaScript = "application/javascript";
|
||||
public const string Json = "application/json";
|
||||
public const string Css = "text/css";
|
||||
public const string Binary = "application/octet-stream";
|
||||
public static string GetContentTypeHeader(string extension = null)
|
||||
=> $"Content-Type: {WebpagePanel.MimeTypes.GetMimeType(extension)}";
|
||||
|
||||
public static string GetContentTypeHeader(string extension = null) => $"Content-Type: {GetMimeType(extension)}";
|
||||
|
||||
public static string GetMimeType(string extension = null) => extension?.ToLowerInvariant() switch
|
||||
{
|
||||
".js" => JavaScript, // Only handle known extensions from resources
|
||||
".json" => Json,
|
||||
".css" => Css,
|
||||
".html" => Html,
|
||||
_ => Binary,
|
||||
};
|
||||
public static string GetMimeType(string extension = null)
|
||||
=> WebpagePanel.MimeTypes.GetMimeType(extension);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace QuickLook.Plugin.MediaInfoViewer;
|
||||
@@ -100,14 +101,15 @@ public partial class Plugin : IViewer, IMoreMenuExtended
|
||||
if (isDark)
|
||||
{
|
||||
context.Theme = Themes.Dark;
|
||||
tvp.Foreground = new BrushConverter().ConvertFromString("#FFEFEFEF") as SolidColorBrush;
|
||||
tvp.Background = Brushes.Transparent;
|
||||
tvp.SetResourceReference(TextBlock.ForegroundProperty, "WindowTextForeground");
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Theme = Themes.Light;
|
||||
tvp.Foreground = new BrushConverter().ConvertFromString("#BBFAFAFA") as SolidColorBrush;
|
||||
tvp.Background = Brushes.Transparent;
|
||||
tvp.Background = OSThemeHelper.AppsUseDarkTheme()
|
||||
? new SolidColorBrush(Color.FromArgb(175, 255, 255, 255))
|
||||
: Brushes.Transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Violeta.Appearance;
|
||||
|
||||
namespace QuickLook;
|
||||
|
||||
@@ -105,14 +107,24 @@ public partial class ViewerWindow : INotifyPropertyChanged
|
||||
if (isDark)
|
||||
{
|
||||
CurrentTheme = Themes.Dark;
|
||||
|
||||
// Update theme for QuickLook controls
|
||||
if (!Resources.MergedDictionaries.Contains(_darkDict))
|
||||
Resources.MergedDictionaries.Add(_darkDict);
|
||||
|
||||
// Update theme for WPF-UI controls
|
||||
ThemeManager.Apply(ApplicationTheme.Dark);
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentTheme = Themes.Light;
|
||||
|
||||
// Update theme for QuickLook controls
|
||||
if (Resources.MergedDictionaries.Contains(_darkDict))
|
||||
Resources.MergedDictionaries.Remove(_darkDict);
|
||||
|
||||
// Update theme for WPF-UI controls
|
||||
ThemeManager.Apply(ApplicationTheme.Light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user