This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,44 @@
using System;
using PlasticGui;
using Unity.CodeEditor;
using UnityEngine;
namespace Unity.PlasticSCM.Editor.Diff.Text
{
internal static class ChangeFont
{
internal static void Execute(
ICodeEditorSettingsChangeListener settingsChangeListener)
{
try
{
string currentFont =
PlasticGuiConfig.Get().Configuration.TextEditorFontFamily;
ChangeFontDialog.Show(
currentFont,
selectedFont => OnFontSelected(
selectedFont, settingsChangeListener));
}
catch (Exception e)
{
Debug.LogException(e);
}
}
// internal for testing purposes
internal static void OnFontSelected(
string selectedFont,
ICodeEditorSettingsChangeListener settingsChangeListener)
{
if (string.IsNullOrEmpty(selectedFont))
return;
settingsChangeListener.OnFontFamilyChanged(selectedFont);
PlasticGuiConfig.Get().Configuration.TextEditorFontFamily = selectedFont;
PlasticGuiConfig.Get().Save();
}
}
}