-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Design Updates - Code Updates
- Loading branch information
Showing
17 changed files
with
561 additions
and
651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,63 @@ | ||
using Microsoft.UI.Xaml; | ||
using NickvisionSpotlight.Models; | ||
using NickvisionSpotlight.UI; | ||
using NickvisionSpotlight.UI.Controls; | ||
using NickvisionSpotlight.UI.Views; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace NickvisionSpotlight | ||
namespace NickvisionSpotlight; | ||
|
||
/// <summary> | ||
/// The Application | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
private MainWindow? _window; | ||
|
||
/// <summary> | ||
/// The Application | ||
/// Constructs an App | ||
/// </summary> | ||
public partial class App : Application | ||
public App() | ||
{ | ||
private MainWindow? _window; | ||
|
||
/// <summary> | ||
/// Constructs an App | ||
/// </summary> | ||
public App() | ||
InitializeComponent(); | ||
//AppInfo | ||
AppInfo.Current.Name = "Nickvision Spotlight"; | ||
AppInfo.Current.Description = "A utility for working with Windows Spotlight images."; | ||
AppInfo.Current.Version = new Version("2022.8.1"); | ||
AppInfo.Current.Changelog = "- Design Updates\n- Code Cleanup"; | ||
AppInfo.Current.GitHubRepo = new Uri("https://github.com/nlogozzo/NickvisionSpotlight"); | ||
AppInfo.Current.IssueTracker = new Uri("https://github.com/nlogozzo/NickvisionSpotlight/issues/new"); | ||
//Load Config | ||
if (Configuration.Current.Theme == Theme.Light) | ||
{ | ||
InitializeComponent(); | ||
//AppInfo | ||
AppInfo.Current.Name = "Nickvision Spotlight"; | ||
AppInfo.Current.Description = "A utility for working with Windows Spotlight images."; | ||
AppInfo.Current.Version = new Version("2022.8.0"); | ||
AppInfo.Current.Changelog = "- Rewrite with Windows App SDK and C#"; | ||
AppInfo.Current.GitHubRepo = new Uri("https://github.com/nlogozzo/NickvisionSpotlight"); | ||
AppInfo.Current.IssueTracker = new Uri("https://github.com/nlogozzo/NickvisionSpotlight/issues/new"); | ||
//Load Config | ||
if (Configuration.Current.Theme == Theme.Light) | ||
{ | ||
RequestedTheme = ApplicationTheme.Light; | ||
} | ||
else if (Configuration.Current.Theme == Theme.Dark) | ||
{ | ||
RequestedTheme = ApplicationTheme.Dark; | ||
} | ||
RequestedTheme = ApplicationTheme.Light; | ||
} | ||
|
||
/// <summary> | ||
/// Occurs when the application is launched | ||
/// </summary> | ||
/// <param name="args">LaunchActivatedEventArgs</param> | ||
protected override async void OnLaunched(LaunchActivatedEventArgs args) | ||
else if (Configuration.Current.Theme == Theme.Dark) | ||
{ | ||
_window = new MainWindow(); | ||
var windowContent = _window.Content; | ||
var splashScreen = new SplashScreen(); | ||
_window.Content = splashScreen; | ||
_window.Activate(); | ||
await StartupAsync(splashScreen); | ||
_window.Content = windowContent; | ||
RequestedTheme = ApplicationTheme.Dark; | ||
} | ||
} | ||
|
||
private async Task StartupAsync(SplashScreen splashScreen) | ||
{ | ||
splashScreen.Description = "Loading application..."; | ||
await Task.Delay(500); | ||
splashScreen.Description = "Syncing spotlight images..."; | ||
await Messenger.Current.SendAsync("MainWindow.SyncSpotlightImagesAsync"); | ||
} | ||
/// <summary> | ||
/// Occurs when the application is launched | ||
/// </summary> | ||
/// <param name="args">LaunchActivatedEventArgs</param> | ||
protected override async void OnLaunched(LaunchActivatedEventArgs args) | ||
{ | ||
_window = new MainWindow(); | ||
var windowContent = _window.Content; | ||
var splashScreen = new SplashScreen(); | ||
_window.Content = splashScreen; | ||
_window.Activate(); | ||
await StartupAsync(splashScreen); | ||
_window.Content = windowContent; | ||
} | ||
|
||
private async Task StartupAsync(SplashScreen splashScreen) | ||
{ | ||
splashScreen.Description = "Loading application..."; | ||
await Task.Delay(500); | ||
splashScreen.Description = "Syncing spotlight images..."; | ||
await _window.SyncSpotlightImagesAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,54 @@ | ||
using System; | ||
|
||
namespace NickvisionSpotlight.Models | ||
namespace NickvisionSpotlight.Models; | ||
|
||
/// <summary> | ||
/// A model for the information about the application | ||
/// </summary> | ||
public class AppInfo | ||
{ | ||
private static AppInfo? _instance; | ||
|
||
/// <summary> | ||
/// A model for the information about the application | ||
/// Gets the singleton object | ||
/// </summary> | ||
public class AppInfo | ||
{ | ||
private static AppInfo? _instance; | ||
public static AppInfo Current => _instance ??= new AppInfo(); | ||
|
||
public static AppInfo Current => _instance ??= new AppInfo(); | ||
|
||
public string Name { get; set; } | ||
public string Description { get; set; } | ||
public Version Version { get; set; } | ||
public string Changelog { get; set; } | ||
public Uri GitHubRepo { get; set; } | ||
public Uri IssueTracker { get; set; } | ||
/// <summary> | ||
/// The name of the application | ||
/// </summary> | ||
public string Name { get; set; } | ||
/// <summary> | ||
/// The description of the application | ||
/// </summary> | ||
public string Description { get; set; } | ||
/// <summary> | ||
/// The running version of the application | ||
/// </summary> | ||
public Version Version { get; set; } | ||
/// <summary> | ||
/// The changelog for the running version of the application | ||
/// </summary> | ||
public string Changelog { get; set; } | ||
/// <summary> | ||
/// The GitHub repo for the application | ||
/// </summary> | ||
public Uri GitHubRepo { get; set; } | ||
/// <summary> | ||
/// The issue tracker for the application | ||
/// </summary> | ||
public Uri IssueTracker { get; set; } | ||
|
||
/// <summary> | ||
/// Constructs an AppInfo | ||
/// </summary> | ||
private AppInfo() | ||
{ | ||
Name = ""; | ||
Description = ""; | ||
Version = new Version("0.0.0"); | ||
Changelog = ""; | ||
GitHubRepo = new Uri("about:blank"); | ||
IssueTracker = new Uri("about:blank"); | ||
} | ||
/// <summary> | ||
/// Constructs an AppInfo | ||
/// </summary> | ||
private AppInfo() | ||
{ | ||
Name = ""; | ||
Description = ""; | ||
Version = new Version("0.0.0"); | ||
Changelog = ""; | ||
GitHubRepo = new Uri("about:blank"); | ||
IssueTracker = new Uri("about:blank"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace NickvisionSpotlight.UI.Controls | ||
namespace NickvisionSpotlight.UI.Controls; | ||
|
||
/// <summary> | ||
/// A model of the properties to show in an InfoBar | ||
/// </summary> | ||
public class InfoBarMessageInfo | ||
{ | ||
/// <summary> | ||
/// A model of the properties to show in an InfoBar | ||
/// The title of the InfoBar | ||
/// </summary> | ||
public class InfoBarMessageInfo | ||
{ | ||
public string Title { get; set; } | ||
public string Message { get; set; } | ||
public InfoBarSeverity Severity { get; set; } | ||
public string Title { get; set; } | ||
/// <summary> | ||
/// The message of the InfoBar | ||
/// </summary> | ||
public string Message { get; set; } | ||
/// <summary> | ||
/// The severity of the InfoBar | ||
/// </summary> | ||
public InfoBarSeverity Severity { get; set; } | ||
|
||
/// <summary> | ||
/// Constructs an InfoBarMessageInfo | ||
/// </summary> | ||
/// <param name="title">The title of the InfoBar</param> | ||
/// <param name="message">The message of the InfoBar</param> | ||
/// <param name="severity">The severity of the InfoBar</param> | ||
public InfoBarMessageInfo(string title = "", string message = "", InfoBarSeverity severity = InfoBarSeverity.Informational) | ||
{ | ||
Title = title; | ||
Message = message; | ||
Severity = severity; | ||
} | ||
/// <summary> | ||
/// Constructs an InfoBarMessageInfo | ||
/// </summary> | ||
/// <param name="title">The title of the InfoBar</param> | ||
/// <param name="message">The message of the InfoBar</param> | ||
/// <param name="severity">The severity of the InfoBar</param> | ||
public InfoBarMessageInfo(string title = "", string message = "", InfoBarSeverity severity = InfoBarSeverity.Informational) | ||
{ | ||
Title = title; | ||
Message = message; | ||
Severity = severity; | ||
} | ||
} |
Oops, something went wrong.