UI - Refactorings, project builds and runs again :P

This commit is contained in:
Robert committed 2021-11-08 18:18:23 +01:00
1 parent c178fc6cf8
commit 41171a5ade
48 files changed
+895 -205

No files matched your search

@@ -1,9 +1,15 @@
namespace Artemis.Core
using System;
namespace Artemis.Core
{
/// <summary>
/// Represents a configuration dialog for a <see cref="Plugin" />
/// </summary>
public interface IPluginConfigurationDialog
{
/// <summary>
/// The type of view model the tab contains
/// </summary>
Type Type { get; }
}
}
+31 -23
View File
@@ -89,6 +89,28 @@ namespace Artemis.Core
}
}
/// <summary>
/// Occurs when the core has requested an application shutdown
/// </summary>
public static event EventHandler? ShutdownRequested;
/// <summary>
/// Occurs when the core has requested an application restart
/// </summary>
public static event EventHandler<RestartEventArgs>? RestartRequested;
/// <summary>
/// Opens the provided folder in the user's file explorer
/// </summary>
/// <param name="path">The full path of the folder to open</param>
public static void OpenFolder(string path)
{
if (OperatingSystem.IsWindows())
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", path);
else
throw new PlatformNotSupportedException("Can't open folders yet on non-Windows systems Q.Q");
}
/// <summary>
/// Gets the current application location
/// </summary>
@@ -103,6 +125,11 @@ namespace Artemis.Core
RestartRequested?.Invoke(null, e);
}
private static void OnShutdownRequested()
{
ShutdownRequested?.Invoke(null, EventArgs.Empty);
}
#region Scaling
internal static int RenderScaleMultiplier { get; set; } = 2;
@@ -118,32 +145,13 @@ namespace Artemis.Core
return SKRectI.Create(roundX, roundY, roundWidth, roundHeight);
return SKRectI.Create(
roundX - (roundX % RenderScaleMultiplier),
roundY - (roundY % RenderScaleMultiplier),
roundWidth - (roundWidth % RenderScaleMultiplier),
roundHeight - (roundHeight % RenderScaleMultiplier)
roundX - roundX % RenderScaleMultiplier,
roundY - roundY % RenderScaleMultiplier,
roundWidth - roundWidth % RenderScaleMultiplier,
roundHeight - roundHeight % RenderScaleMultiplier
);
}
#endregion
#region Events
/// <summary>
/// Occurs when the core has requested an application shutdown
/// </summary>
public static event EventHandler? ShutdownRequested;
/// <summary>
/// Occurs when the core has requested an application restart
/// </summary>
public static event EventHandler<RestartEventArgs>? RestartRequested;
private static void OnShutdownRequested()
{
ShutdownRequested?.Invoke(null, EventArgs.Empty);
}
#endregion
}
}