mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-10-13 14:29:54 +00:00
Refactor icon usage to use FontSymbols constants
Replaced hardcoded icon strings with FontSymbols constants in MoreMenu and converter classes for consistency and maintainability. Removed duplicate FontSymbols class from MidiPlayer and updated usages to reference QuickLook.Common.Controls.
This commit is contained in:
Submodule QuickLook.Common updated: 2dc2616aeb...ffda8978fa
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Commands;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using System.Collections.Generic;
|
||||
@@ -33,7 +34,7 @@ public partial class Plugin
|
||||
// HTML <=> HTML TEXT
|
||||
yield return new MoreMenuItem()
|
||||
{
|
||||
Icon = "\uE943",
|
||||
Icon = FontSymbols.Code,
|
||||
Header = TranslationHelper.Get("MW_ReopenAsSourceCode", translationFile),
|
||||
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.TextViewer", _currentPath)),
|
||||
};
|
||||
|
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Commands;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using System.Collections.Generic;
|
||||
@@ -36,7 +37,7 @@ public partial class Plugin
|
||||
// SVG IMAGE <=> XML TEXT
|
||||
".svg" => new MoreMenuItem()
|
||||
{
|
||||
Icon = "\uE943",
|
||||
Icon = FontSymbols.Code,
|
||||
Header = TranslationHelper.Get("MW_ReopenAsSourceCode", translationFile),
|
||||
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.TextViewer", _currentPath)),
|
||||
},
|
||||
|
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Commands;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using System.Collections.Generic;
|
||||
@@ -40,7 +41,7 @@ public partial class Plugin
|
||||
|
||||
yield return new MoreMenuItem()
|
||||
{
|
||||
Icon = "\xea69",
|
||||
Icon = FontSymbols.Media,
|
||||
Header = TranslationHelper.Get("MW_ShowMediaInfo", translationFile),
|
||||
MenuItems = null,
|
||||
Command = ShowWithMediaInfoCommand,
|
||||
|
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Commands;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using System.Collections.Generic;
|
||||
@@ -38,7 +39,7 @@ public partial class Plugin
|
||||
// .html;.htm;.xhtml;.shtml;.shtm;.xht;.hta
|
||||
".html" or ".htm" or ".xhtml" or ".shtml" or ".shtm" or ".xht" or ".hta" => new MoreMenuItem()
|
||||
{
|
||||
Icon = "\uE774",
|
||||
Icon = FontSymbols.Globe,
|
||||
Header = TranslationHelper.Get("MW_ReopenAsHtmlPreview", translationFile),
|
||||
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.HtmlViewer", _currentPath)),
|
||||
},
|
||||
@@ -46,7 +47,7 @@ public partial class Plugin
|
||||
// SVG IMAGE <=> XML TEXT
|
||||
".svg" => new MoreMenuItem()
|
||||
{
|
||||
Icon = "\uE774",
|
||||
Icon = FontSymbols.Picture,
|
||||
Header = TranslationHelper.Get("MW_ReopenAsImagePreview", translationFile),
|
||||
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.ImageViewer", _currentPath)),
|
||||
},
|
||||
|
@@ -19,6 +19,7 @@ using Melanchall.DryWetMidi.Core;
|
||||
using Melanchall.DryWetMidi.Interaction;
|
||||
using Melanchall.DryWetMidi.Multimedia;
|
||||
using QuickLook.Common.Annotations;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Plugin;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
@@ -208,14 +209,4 @@ internal class MidiPlayer : IDisposable, INotifyPropertyChanged
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Segoe Fluent Icons
|
||||
/// https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
|
||||
/// </summary>
|
||||
private sealed class FontSymbols
|
||||
{
|
||||
public const string Play = "\xe768";
|
||||
public const string Pause = "\xe769";
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Controls;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
@@ -49,7 +50,7 @@ public sealed class TimeTickToShortStringConverter : DependencyObject, IValueCon
|
||||
|
||||
public sealed class VolumeToIconConverter : DependencyObject, IValueConverter
|
||||
{
|
||||
private static readonly string[] Volumes = ["\xE74F", "\xE993", "\xE994", "\xE995"];
|
||||
private static readonly string[] Volumes = [FontSymbols.Mute, FontSymbols.Volume1, FontSymbols.Volume2, FontSymbols.Volume3];
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
Reference in New Issue
Block a user