From 7bb8a3e03f92d29d50b79aad18947ccadd55a30f Mon Sep 17 00:00:00 2001 From: Adrian Mateoaea Date: Thu, 19 Mar 2020 22:58:55 +0200 Subject: [PATCH 1/3] Update project internals --- .extra/setup-script.iss | 130 ++- Luna/App.config | 91 +- Luna/App.xaml | 68 +- Luna/App.xaml.cs | 127 ++- Luna/Controls/WindowHeader.xaml | 70 ++ Luna/Controls/WindowHeader.xaml.cs | 67 ++ Luna/Custom/AnimatedView.xaml | 78 -- Luna/Custom/AnimatedView.xaml.cs | 20 - Luna/Helpers/RegistryHandler.cs | 32 - Luna/Helpers/Rules.cs | 27 - Luna/Helpers/WallpaperHandler.cs | 27 - Luna/Luna.csproj | 363 ++++--- Luna/MainWindow.xaml | 135 --- Luna/MainWindow.xaml.cs | 124 --- Luna/Models/SettingsModel.cs | 221 ++++ Luna/Models/UpdateModel.cs | 142 +++ Luna/Properties/AssemblyInfo.cs | 109 +- Luna/Properties/Settings.Designer.cs | 304 +++--- Luna/Properties/Settings.settings | 73 +- Luna/Properties/app.manifest | 148 +-- Luna/Resources/ThemeTool.exe | Bin 0 -> 5632 bytes .../MetroDark.MSControls.Core.Implicit.xaml | 976 ++++++++++++++++++ Luna/Theme/Styles.Extended.Wpf.Toolkit.xaml | 77 ++ Luna/Theme/Styles.Shared.xaml | 774 ++++++++++++++ Luna/Theme/Styles.WPF.xaml | 827 +++++++++++++++ Luna/Theme/Theme.Colors.xaml | 104 ++ .../MetroDark.MSControls.Core.Implicit.xaml | 966 ----------------- Luna/Themes/Metro/Dark/Styles.Shared.xaml | 740 ------------- Luna/Themes/Metro/Dark/Styles.WPF.xaml | 802 -------------- Luna/Themes/Metro/Dark/Theme.Colors.xaml | 80 -- .../Light/Metro.MSControls.Core.Implicit.xaml | 939 ----------------- Luna/Themes/Metro/Light/Styles.Shared.xaml | 695 ------------- Luna/Themes/Metro/Light/Styles.WPF.xaml | 798 -------------- Luna/Themes/Metro/Light/Theme.Colors.xaml | 80 -- Luna/Utils/AutoFileSaver.cs | 89 ++ Luna/Utils/AutoUpdater.cs | 179 ++++ Luna/Utils/Converters.cs | 38 + Luna/Utils/Handlers/AppearanceHandler.cs | 56 + Luna/Utils/Handlers/RegistryHandler.cs | 43 + .../Handlers}/TaskHandler.cs | 138 ++- Luna/Utils/Handlers/ThemeHandler.cs | 50 + Luna/Utils/Handlers/WallpaperHandler.cs | 38 + Luna/Utils/JsonDownloader.cs | 36 + Luna/Utils/Logger/AbstractLogger.cs | 77 ++ Luna/Utils/Logger/AppLogger.cs | 25 + Luna/Utils/Logger/ConsoleLogger.cs | 12 + Luna/Utils/Logger/FileLogger.cs | 49 + Luna/Utils/Logger/ILogger.cs | 24 + Luna/Utils/Logger/MultiLogger.cs | 81 ++ Luna/Utils/NotifyPropertyChanged.cs | 15 + Luna/Utils/ObjectSerializer.cs | 28 + Luna/Windows/MessageWindow.xaml | 42 + Luna/Windows/MessageWindow.xaml.cs | 49 + Luna/Windows/SettingsWindow.xaml | 127 +++ Luna/Windows/SettingsWindow.xaml.cs | 122 +++ Luna/Windows/UpdateWindow.xaml | 112 ++ Luna/Windows/UpdateWindow.xaml.cs | 39 + Luna/packages.config | 8 +- 58 files changed, 5378 insertions(+), 6313 deletions(-) create mode 100644 Luna/Controls/WindowHeader.xaml create mode 100644 Luna/Controls/WindowHeader.xaml.cs delete mode 100644 Luna/Custom/AnimatedView.xaml delete mode 100644 Luna/Custom/AnimatedView.xaml.cs delete mode 100644 Luna/Helpers/RegistryHandler.cs delete mode 100644 Luna/Helpers/Rules.cs delete mode 100644 Luna/Helpers/WallpaperHandler.cs delete mode 100644 Luna/MainWindow.xaml delete mode 100644 Luna/MainWindow.xaml.cs create mode 100644 Luna/Models/SettingsModel.cs create mode 100644 Luna/Models/UpdateModel.cs create mode 100644 Luna/Resources/ThemeTool.exe create mode 100644 Luna/Theme/MetroDark.MSControls.Core.Implicit.xaml create mode 100644 Luna/Theme/Styles.Extended.Wpf.Toolkit.xaml create mode 100644 Luna/Theme/Styles.Shared.xaml create mode 100644 Luna/Theme/Styles.WPF.xaml create mode 100644 Luna/Theme/Theme.Colors.xaml delete mode 100644 Luna/Themes/Metro/Dark/MetroDark.MSControls.Core.Implicit.xaml delete mode 100644 Luna/Themes/Metro/Dark/Styles.Shared.xaml delete mode 100644 Luna/Themes/Metro/Dark/Styles.WPF.xaml delete mode 100644 Luna/Themes/Metro/Dark/Theme.Colors.xaml delete mode 100644 Luna/Themes/Metro/Light/Metro.MSControls.Core.Implicit.xaml delete mode 100644 Luna/Themes/Metro/Light/Styles.Shared.xaml delete mode 100644 Luna/Themes/Metro/Light/Styles.WPF.xaml delete mode 100644 Luna/Themes/Metro/Light/Theme.Colors.xaml create mode 100644 Luna/Utils/AutoFileSaver.cs create mode 100644 Luna/Utils/AutoUpdater.cs create mode 100644 Luna/Utils/Converters.cs create mode 100644 Luna/Utils/Handlers/AppearanceHandler.cs create mode 100644 Luna/Utils/Handlers/RegistryHandler.cs rename Luna/{Helpers => Utils/Handlers}/TaskHandler.cs (93%) create mode 100644 Luna/Utils/Handlers/ThemeHandler.cs create mode 100644 Luna/Utils/Handlers/WallpaperHandler.cs create mode 100644 Luna/Utils/JsonDownloader.cs create mode 100644 Luna/Utils/Logger/AbstractLogger.cs create mode 100644 Luna/Utils/Logger/AppLogger.cs create mode 100644 Luna/Utils/Logger/ConsoleLogger.cs create mode 100644 Luna/Utils/Logger/FileLogger.cs create mode 100644 Luna/Utils/Logger/ILogger.cs create mode 100644 Luna/Utils/Logger/MultiLogger.cs create mode 100644 Luna/Utils/NotifyPropertyChanged.cs create mode 100644 Luna/Utils/ObjectSerializer.cs create mode 100644 Luna/Windows/MessageWindow.xaml create mode 100644 Luna/Windows/MessageWindow.xaml.cs create mode 100644 Luna/Windows/SettingsWindow.xaml create mode 100644 Luna/Windows/SettingsWindow.xaml.cs create mode 100644 Luna/Windows/UpdateWindow.xaml create mode 100644 Luna/Windows/UpdateWindow.xaml.cs diff --git a/.extra/setup-script.iss b/.extra/setup-script.iss index 2d57113..e34e217 100644 --- a/.extra/setup-script.iss +++ b/.extra/setup-script.iss @@ -1,69 +1,61 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -#define MyAppName "Luna" -#define MyAppVersion "1.0" -#define MyAppPublisher "Adrian Mateoaea" -#define MyAppURL "https://github.com/adrianmteo/Luna" -#define MyAppExeName "Luna.exe" - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{7FDBD0F5-0E11-4048-8C62-A5F64BB878AF} -AppName={#MyAppName} -AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} -AppPublisher={#MyAppPublisher} -AppPublisherURL={#MyAppURL} -AppSupportURL={#MyAppURL} -AppUpdatesURL={#MyAppURL} -DefaultDirName={localappdata}\{#MyAppName} -DisableProgramGroupPage=yes -; Remove the following line to run in administrative install mode (install for all users.) -PrivilegesRequired=lowest -OutputBaseFilename={#MyAppName}Setup -Compression=lzma -SolidCompression=yes -WizardStyle=modern -UninstallDisplayIcon={app}\{#MyAppExeName} -UninstallDisplayName={#MyAppName} -DirExistsWarning=no -VersionInfoCompany={#MyAppPublisher} -VersionInfoCopyright=Copyright � {#MyAppPublisher} 2020 -VersionInfoProductVersion={#MyAppVersion} -VersionInfoVersion={#MyAppVersion} - -[Code] -procedure InitializeWizard; -begin - WizardForm.SelectDirBrowseLabel.Visible:=False; - WizardForm.DirEdit.Enabled:=False; - WizardForm.DirBrowseButton.Enabled:=False; -end; - -[Messages] -SetupAppTitle={#MyAppName} Setup -SetupWindowTitle={#MyAppName} Setup - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked - -[Files] -Source: "..\Luna\bin\Release\Luna.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\Luna\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon - -[Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent - -[UninstallRun] -Filename: "{app}\{#MyAppExeName}"; Parameters: "/clean" - +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Luna" +#define MyAppVersion "1.1" +#define MyAppPublisher "Adrian Mateoaea" +#define MyAppURL "https://github.com/adrianmteo/Luna" +#define MyAppExeName "Luna.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{7FDBD0F5-0E11-4048-8C62-A5F64BB878AF} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={localappdata}\{#MyAppName} +DisableProgramGroupPage=yes +; Remove the following line to run in administrative install mode (install for all users.) +PrivilegesRequired=lowest +OutputBaseFilename={#MyAppName}Setup +Compression=lzma +SolidCompression=yes +WizardStyle=modern +UninstallDisplayIcon={app}\{#MyAppExeName} +UninstallDisplayName={#MyAppName} +DirExistsWarning=no +VersionInfoCompany={#MyAppPublisher} +VersionInfoCopyright=Copyright {#MyAppPublisher} 2020 +VersionInfoProductVersion={#MyAppVersion} +VersionInfoVersion={#MyAppVersion} + +[Messages] +SetupAppTitle={#MyAppName} Setup +SetupWindowTitle={#MyAppName} Setup + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "..\Luna\bin\Release\Luna.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\Luna\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall + +[UninstallRun] +Filename: "{app}\{#MyAppExeName}"; Parameters: "/clean" + diff --git a/Luna/App.config b/Luna/App.config index c726ca8..168b20e 100644 --- a/Luna/App.config +++ b/Luna/App.config @@ -1,45 +1,48 @@ - - - - -
- - - - - - - - - False - - - False - - - False - - - False - - - - - - - - - 7 - - - 0 - - - 7 - - - 0 - - - + + + + +
+ + + + + + + + + False + + + False + + + False + + + False + + + + + + + + + 7 + + + 0 + + + 7 + + + 0 + + + True + + + \ No newline at end of file diff --git a/Luna/App.xaml b/Luna/App.xaml index f229e8c..105eac3 100644 --- a/Luna/App.xaml +++ b/Luna/App.xaml @@ -1,54 +1,14 @@ - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/Luna/App.xaml.cs b/Luna/App.xaml.cs index 4d1bc1a..73c3fe5 100644 --- a/Luna/App.xaml.cs +++ b/Luna/App.xaml.cs @@ -1,57 +1,70 @@ -using Luna.Helpers; -using Luna.Properties; -using System; -using System.Windows; - -namespace Luna -{ - public partial class App : Application - { - [STAThread] - public static void Main(string[] args) - { - if (args.Length > 0) - { - foreach (string arg in args) - { - switch (arg) - { - case "/light": - SwitchToLightTheme(); - break; - - case "/dark": - SwitchToDarkTheme(); - break; - - case "/clean": - TaskHandler.DeleteTasks(); - break; - - default: - break; - } - } - } - else - { - App app = new App(); - app.InitializeComponent(); - app.Run(); - } - } - public static void SwitchToLightTheme() - { - if (Settings.Default.ChangeAppTheme) RegistryHandler.AppsUseLightTheme(true); - if (Settings.Default.ChangeSystemTheme) RegistryHandler.SystemUsesLightTheme(true); - if (Settings.Default.ChangeWallpaper) WallpaperHandler.ChangeWallpaper(Settings.Default.LightWallpaperPath); - } - - public static void SwitchToDarkTheme() - { - if (Settings.Default.ChangeAppTheme) RegistryHandler.AppsUseLightTheme(false); - if (Settings.Default.ChangeSystemTheme) RegistryHandler.SystemUsesLightTheme(false); - if (Settings.Default.ChangeWallpaper) WallpaperHandler.ChangeWallpaper(Settings.Default.DarkWallpaperPath); - } - } -} +using Luna.Models; +using Luna.Utils; +using Luna.Utils.Handlers; +using Luna.Utils.Logger; +using System; +using System.Windows; + +namespace Luna +{ + public partial class App : Application + { + private static readonly ILogger Logger = AppLogger.GetLoggerForCurrentClass(); + + [STAThread] + public static void Main(string[] args) + { + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + + if (args.Length > 0) + { + Logger.Info("Starting app with command line arguments: {0}", string.Join(", ", args)); + + AutoFileSaver autoFileSaver = new AutoFileSaver("settings.xml", true); + AppearanceHandler handler = new AppearanceHandler(autoFileSaver.Model); + + foreach (string arg in args) + { + switch (arg) + { + case "/light": + handler.SwitchToLightTheme(); + break; + + case "/dark": + handler.SwitchToDarkTheme(); + break; + + case "/update": + // TODO: wait then exit + AutoUpdater autoUpdater = new AutoUpdater(true); + autoUpdater.CheckForUpdates(); + break; + + case "/clean": + TaskHandler.DeleteTasks(); + break; + + default: + Logger.Error("Command line argument is not accepted: {0}", arg); + break; + } + } + } + else + { + App app = new App(); + app.InitializeComponent(); + app.Run(); + } + } + + private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + if (e.ExceptionObject is Exception ex) + { + Logger.Exception(ex); + } + } + } +} diff --git a/Luna/Controls/WindowHeader.xaml b/Luna/Controls/WindowHeader.xaml new file mode 100644 index 0000000..3dc2686 --- /dev/null +++ b/Luna/Controls/WindowHeader.xaml @@ -0,0 +1,70 @@ + + + + + + + + + + + diff --git a/Luna/Controls/WindowHeader.xaml.cs b/Luna/Controls/WindowHeader.xaml.cs new file mode 100644 index 0000000..1f11254 --- /dev/null +++ b/Luna/Controls/WindowHeader.xaml.cs @@ -0,0 +1,67 @@ +using System.Windows; +using System.Windows.Controls; + +namespace Luna.Controls +{ + public partial class WindowHeader : UserControl + { + private static readonly DependencyProperty HasUpdateProperty = DependencyProperty.Register("HasUpdate", typeof(bool), typeof(WindowHeader), new PropertyMetadata(false)); + public bool HasUpdate + { + get { return (bool)GetValue(HasUpdateProperty); } + set { SetValue(HasUpdateProperty, value); } + } + + private static readonly RoutedEvent OnClickUpdateEvent = EventManager.RegisterRoutedEvent("OnClickUpdate", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(WindowHeader)); + + public event RoutedEventHandler OnClickUpdate + { + add { AddHandler(OnClickUpdateEvent, value); } + remove { RemoveHandler(OnClickUpdateEvent, value); } + } + + private Window _window; + + public WindowHeader() + { + InitializeComponent(); + } + + private void WindowHeader_Loaded(object sender, RoutedEventArgs e) + { + if (sender is DependencyObject dependencyObject) + { + _window = Window.GetWindow(dependencyObject); + } + } + + private void ButtonMinimize_Click(object sender, RoutedEventArgs e) + { + if (_window != null) + { + _window.WindowState = WindowState.Minimized; + } + } + + private void ButtonMaximize_Click(object sender, RoutedEventArgs e) + { + if (_window != null) + { + _window.WindowState = _window.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; + } + } + + private void ButtonClose_Click(object sender, RoutedEventArgs e) + { + if (_window != null) + { + _window.Close(); + } + } + + private void ButtonUpdate_Click(object sender, RoutedEventArgs e) + { + RaiseEvent(new RoutedEventArgs(OnClickUpdateEvent)); + } + } +} diff --git a/Luna/Custom/AnimatedView.xaml b/Luna/Custom/AnimatedView.xaml deleted file mode 100644 index 8dff3d5..0000000 --- a/Luna/Custom/AnimatedView.xaml +++ /dev/null @@ -1,78 +0,0 @@ - - - - 0:0:0.300 - 0:0:0.300 - 40 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Luna/Custom/AnimatedView.xaml.cs b/Luna/Custom/AnimatedView.xaml.cs deleted file mode 100644 index 6eff3e3..0000000 --- a/Luna/Custom/AnimatedView.xaml.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -namespace Luna -{ - public partial class AnimatedView : UserControl - { - public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(bool), typeof(AnimatedView), new PropertyMetadata(true)); - public bool Value - { - get { return (bool)GetValue(ValueProperty); } - set { SetValue(ValueProperty, value); } - } - - public AnimatedView() - { - InitializeComponent(); - } - } -} diff --git a/Luna/Helpers/RegistryHandler.cs b/Luna/Helpers/RegistryHandler.cs deleted file mode 100644 index 4d49d76..0000000 --- a/Luna/Helpers/RegistryHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Luna.Helpers -{ - class RegistryHandler - { - public static void AppsUseLightTheme(bool enabled) - { - RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", true); - - if (key != null) - { - key.SetValue("AppsUseLightTheme", enabled ? 1 : 0, RegistryValueKind.DWord); - } - } - - public static void SystemUsesLightTheme(bool enabled) - { - RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", true); - - if (key != null) - { - key.SetValue("SystemUsesLightTheme", enabled ? 1 : 0, RegistryValueKind.DWord); - } - } - } -} diff --git a/Luna/Helpers/Rules.cs b/Luna/Helpers/Rules.cs deleted file mode 100644 index 1bc6411..0000000 --- a/Luna/Helpers/Rules.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Globalization; -using System.Windows.Controls; - -namespace Luna -{ - public class NumberRule : ValidationRule - { - public int Min { get; set; } - - public int Max { get; set; } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - if (!int.TryParse((string)value, out int hour)) - { - return new ValidationResult(false, "Input is not a number"); - } - - if (hour < Min || hour > Max) - { - return new ValidationResult(false, $"Input must be between {Min} and {Max}"); - } - - return ValidationResult.ValidResult; - } - } -} diff --git a/Luna/Helpers/WallpaperHandler.cs b/Luna/Helpers/WallpaperHandler.cs deleted file mode 100644 index 89fce49..0000000 --- a/Luna/Helpers/WallpaperHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Luna.Helpers -{ - internal sealed class win32 - { - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern int SystemParametersInfo(int uAction, int uParam, String pvParam, int fWinIni); - } - - class WallpaperHandler - { - public static void ChangeWallpaper(string filePath) - { - if (filePath != null && File.Exists(filePath)) - { - win32.SystemParametersInfo(0x0014, 0, filePath, 1 | 2); - } - } - } -} diff --git a/Luna/Luna.csproj b/Luna/Luna.csproj index c719db8..66167d1 100644 --- a/Luna/Luna.csproj +++ b/Luna/Luna.csproj @@ -1,163 +1,202 @@ - - - - - Debug - AnyCPU - {2DE9EC75-02AA-471B-A2CD-58A19F7BC391} - WinExe - Luna - Luna - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - Properties\app.manifest - - - Luna.App - - - Resources\Icon.ico - - - - ..\packages\TaskScheduler.2.8.18\lib\net452\Microsoft.Win32.TaskScheduler.dll - - - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - AnimatedView.xaml - - - App.xaml - Code - - - MainWindow.xaml - Code - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - + + + + + Debug + AnyCPU + {2DE9EC75-02AA-471B-A2CD-58A19F7BC391} + WinExe + Luna + Luna + v4.7.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + Properties\app.manifest + + + Luna.App + + + Resources\Icon.ico + + + + ..\packages\TaskScheduler.2.8.18\lib\net452\Microsoft.Win32.TaskScheduler.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + 4.0 + + + + + + ..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.dll + + + ..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll + + + ..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll + + + ..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll + + + ..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.Toolkit.dll + + + + + + + MessageWindow.xaml + + + + SettingsWindow.xaml + + + UpdateWindow.xaml + + + + + + + + + + + + + + + + WindowHeader.xaml + + + MSBuild:Compile + Designer + + + + + + App.xaml + Code + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + Always + + + \ No newline at end of file diff --git a/Luna/MainWindow.xaml b/Luna/MainWindow.xaml deleted file mode 100644 index ba7f0e7..0000000 --- a/Luna/MainWindow.xaml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index 770aad6..bbaca13 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,64 @@ -# Luna - -A super lightweight dark mode automatic switcher for Windows 10 - -**Features** - -- Set light/dark theme activation times -- Toggle app/system theme based on activation times -- Change wallpaper to light/dark activation times - -![](.repo/recording.gif) - -[![](.repo/download.png)](https://github.com/adrianmteo/Luna/releases/latest/download/LunaSetup.exe) - -## Install - -You can download and install the latest release from [here](https://github.com/adrianmteo/Luna/releases). - -**Note:** Windows SmartScreen might show you this warning screen. This is because the setup file is not being signed but the app is 100% safe to be run. - -![](.repo/smartscreen.png) - -## Description - -I've built this app in my spare time to resolve my frustration with Windows 10 for not having automatic dark theme switcher. This may be included in the next releases of Windows 10 but for now here is Luna! - -This is a super lightweight app built using C# and WPF technologies. It creates task schedules for light/dark theme times. There are no running processes in the background and there is not need to start when Windows starts. - -3rd party libraries used: -- [Infragistics Metro Light and Dark Theme for WPF](https://www.infragistics.com/community/blogs/b/blagunas/posts/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls) -- [TaskScheduler](https://github.com/dahall/taskscheduler) - -## Command line parameters - -| Parameter | Description | -| --------- | ------------------------------------------------------- | -| `/light` | Switches to the light theme based on the saved settings | -| `/dark` | Switches to the dark theme based on the saved settings | -| `/clean` | Cleans all task schedules created by the app | - -## Future plans - -As time passes I might add new features (or contributions) to complete an experience that Windows 10 doesn't have (yet). - -## Contributions - -To make this app better for everyone, feel free to contribute with ideas, bug reports or even better: pull requests :) +# Luna + +A super lightweight automatic theme changer for Windows 10 + +![](.repo/screenshot1.png) +![](.repo/screenshot2.png) + +[![](.repo/download.png)](https://github.com/adrianmteo/Luna/releases/latest/download/LunaSetup.exe) + +## Features + +- 🎉 Change Window light/dark theme based on set times +- 🎉 Change the Windows theme to a custom theme (see image below) and this includes changing: + - Background (image, slideshow or solid color) + - Colors + - Sounds + - Mouse cursor + - ![](.repo/theme.png) +- 🎉 Change system or app color theme +- 🎉 Change wallpaper for light/dark theme + +## Install + +You can download and install the latest release from [here](https://github.com/adrianmteo/Luna/releases). + +**Note:** Windows SmartScreen might show you this warning screen. This is because the setup file is not being signed but the app is 100% safe to be run. + +![](.repo/smartscreen.png) + +## Description + +I've built this app in my spare time to resolve my frustration with Windows 10 for not having automatic dark theme switcher. This may be included in the next releases of Windows 10 but for now here is Luna! + +This is a super lightweight app built using C# and WPF technologies. It creates task schedules for light/dark theme times. There are no running processes in the background and there is not need to start when Windows starts. + +3rd party libraries used: + +- [Infragistics Metro Light and Dark Theme for WPF](https://www.infragistics.com/community/blogs/b/blagunas/posts/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls) +- [TaskScheduler](https://github.com/dahall/taskscheduler) +- [Extended WPF Toolkit](https://github.com/xceedsoftware/wpftoolkit) +- ThemeTool.exe - a Windows internal theme testing program used to change the Windows theme + +## Command line parameters + +| Parameter | Description | +| --------- | ------------------------------------------------------- | +| `/light` | Switches to the light theme based on the saved settings | +| `/dark` | Switches to the dark theme based on the saved settings | +| `/update` | Silently checks for an update and installs it | +| `/clean` | Cleans all task schedules created by the app | + +## Build + +Clone and open the solution in Visual Studio. Right-click on the project and click `Restore NuGet Packages`. + +If you want to build the `Release` configuration and generate the setup executable (which is done automatically by building the `Release` configuration) you need to download and install [Inno Setup](https://jrsoftware.org/isinfo.php). The output setup executable can be found under `.extra\Output`. + +## Future plans + +As time passes I might add new features (or contributions) to complete an experience that Windows 10 doesn't have (yet). + +## Contributions + +To make this app better for everyone, feel free to contribute with ideas, bug reports or even better: pull requests :)