Skip to content

Commit 6a6c411

Browse files
committed
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.
1 parent 39ee2f6 commit 6a6c411

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

QuickLook.Common

QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.MoreMenu.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using QuickLook.Common.Commands;
19+
using QuickLook.Common.Controls;
1920
using QuickLook.Common.Helpers;
2021
using QuickLook.Common.Plugin.MoreMenu;
2122
using System.Collections.Generic;
@@ -33,7 +34,7 @@ public IEnumerable<IMenuItem> GetMenuItems()
3334
// HTML <=> HTML TEXT
3435
yield return new MoreMenuItem()
3536
{
36-
Icon = "\uE943",
37+
Icon = FontSymbols.Code,
3738
Header = TranslationHelper.Get("MW_ReopenAsSourceCode", translationFile),
3839
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.TextViewer", _currentPath)),
3940
};

QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.MoreMenu.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using QuickLook.Common.Commands;
19+
using QuickLook.Common.Controls;
1920
using QuickLook.Common.Helpers;
2021
using QuickLook.Common.Plugin.MoreMenu;
2122
using System.Collections.Generic;
@@ -36,7 +37,7 @@ public IEnumerable<IMenuItem> GetMenuItems()
3637
// SVG IMAGE <=> XML TEXT
3738
".svg" => new MoreMenuItem()
3839
{
39-
Icon = "\uE943",
40+
Icon = FontSymbols.Code,
4041
Header = TranslationHelper.Get("MW_ReopenAsSourceCode", translationFile),
4142
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.TextViewer", _currentPath)),
4243
},

QuickLook.Plugin/QuickLook.Plugin.MediaInfoViewer/Plugin.MoreMenu.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using QuickLook.Common.Commands;
19+
using QuickLook.Common.Controls;
1920
using QuickLook.Common.Helpers;
2021
using QuickLook.Common.Plugin.MoreMenu;
2122
using System.Collections.Generic;
@@ -40,7 +41,7 @@ public IEnumerable<IMenuItem> GetMenuItems()
4041

4142
yield return new MoreMenuItem()
4243
{
43-
Icon = "\xea69",
44+
Icon = FontSymbols.Media,
4445
Header = TranslationHelper.Get("MW_ShowMediaInfo", translationFile),
4546
MenuItems = null,
4647
Command = ShowWithMediaInfoCommand,

QuickLook.Plugin/QuickLook.Plugin.TextViewer/Plugin.MoreMenu.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using QuickLook.Common.Commands;
19+
using QuickLook.Common.Controls;
1920
using QuickLook.Common.Helpers;
2021
using QuickLook.Common.Plugin.MoreMenu;
2122
using System.Collections.Generic;
@@ -38,15 +39,15 @@ public IEnumerable<IMenuItem> GetMenuItems()
3839
// .html;.htm;.xhtml;.shtml;.shtm;.xht;.hta
3940
".html" or ".htm" or ".xhtml" or ".shtml" or ".shtm" or ".xht" or ".hta" => new MoreMenuItem()
4041
{
41-
Icon = "\uE774",
42+
Icon = FontSymbols.Globe,
4243
Header = TranslationHelper.Get("MW_ReopenAsHtmlPreview", translationFile),
4344
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.HtmlViewer", _currentPath)),
4445
},
4546

4647
// SVG IMAGE <=> XML TEXT
4748
".svg" => new MoreMenuItem()
4849
{
49-
Icon = "\uE774",
50+
Icon = FontSymbols.Picture,
5051
Header = TranslationHelper.Get("MW_ReopenAsImagePreview", translationFile),
5152
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.ImageViewer", _currentPath)),
5253
},

QuickLook.Plugin/QuickLook.Plugin.VideoViewer/AudioTrack/MidiPlayer.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Melanchall.DryWetMidi.Interaction;
2020
using Melanchall.DryWetMidi.Multimedia;
2121
using QuickLook.Common.Annotations;
22+
using QuickLook.Common.Controls;
2223
using QuickLook.Common.Plugin;
2324
using System;
2425
using System.ComponentModel;
@@ -208,14 +209,4 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName
208209
{
209210
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
210211
}
211-
212-
/// <summary>
213-
/// Segoe Fluent Icons
214-
/// https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
215-
/// </summary>
216-
private sealed class FontSymbols
217-
{
218-
public const string Play = "\xe768";
219-
public const string Pause = "\xe769";
220-
}
221212
}

QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Converters.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18+
using QuickLook.Common.Controls;
1819
using System;
1920
using System.Globalization;
2021
using System.Windows;
@@ -49,7 +50,7 @@ object IValueConverter.ConvertBack(object value, Type targetType, object paramet
4950

5051
public sealed class VolumeToIconConverter : DependencyObject, IValueConverter
5152
{
52-
private static readonly string[] Volumes = ["\xE74F", "\xE993", "\xE994", "\xE995"];
53+
private static readonly string[] Volumes = [FontSymbols.Mute, FontSymbols.Volume1, FontSymbols.Volume2, FontSymbols.Volume3];
5354

5455
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
5556
{

0 commit comments

Comments
 (0)