From 295dee03059b772dcceda12fbb386f26b9028351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Fri, 23 Oct 2020 02:20:58 +0100 Subject: [PATCH] v1.0.0.1 * (Change) Checked and click buttons highlight color for better distinguish * (Fix) Move user settings to LocalUser folder to allow save without run as admin * (Fix) Save button for print parameters were invisible --- CHANGELOG.md | 8 +++++++- .../Operations/OperationEditParameters.cs | 4 ++-- UVtools.WPF/App.axaml.cs | 14 ++++++++++++-- UVtools.WPF/Assets/Themes/UVtools.themes | 2 +- UVtools.WPF/Assets/Themes/UVtoolsDark.xaml | 2 +- UVtools.WPF/Assets/Themes/UVtoolsLight.xaml | 10 +++++----- UVtools.WPF/Assets/selected.theme | 1 - .../Tools/ToolEditParametersControl.axaml.cs | 4 +--- UVtools.WPF/MainWindow.axaml | 6 +++--- UVtools.WPF/UserSettings.cs | 19 ++++++++++++++++--- 10 files changed, 48 insertions(+), 22 deletions(-) delete mode 100644 UVtools.WPF/Assets/selected.theme diff --git a/CHANGELOG.md b/CHANGELOG.md index a795e3a..309ff07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog -## 10/22/2020 - v1.0.0.0 +## 23/10/2020 - v1.0.0.1 + +* (Change) Checked and click buttons highlight color for better distinguish +* (Fix) Move user settings to LocalUser folder to allow save without run as admin +* (Fix) Save button for print parameters were invisible + +## 22/10/2020 - v1.0.0.0 * (Add) Multi-OS with Linux and MacOS support * (Add) Themes support diff --git a/UVtools.Core/Operations/OperationEditParameters.cs b/UVtools.Core/Operations/OperationEditParameters.cs index 8b26745..c40ec55 100644 --- a/UVtools.Core/Operations/OperationEditParameters.cs +++ b/UVtools.Core/Operations/OperationEditParameters.cs @@ -38,9 +38,9 @@ namespace UVtools.Core.Operations } } - public override string ProgressTitle => null; + public override string ProgressTitle => "Change print parameters"; - public override string ProgressAction => null; + public override string ProgressAction => "Changing print parameters"; public override StringTag Validate(params object[] parameters) { diff --git a/UVtools.WPF/App.axaml.cs b/UVtools.WPF/App.axaml.cs index e1b6fdb..52c9838 100644 --- a/UVtools.WPF/App.axaml.cs +++ b/UVtools.WPF/App.axaml.cs @@ -50,7 +50,17 @@ namespace UVtools.WPF UserSettings.SetVersion(); ThemeSelector = Avalonia.ThemeManager.ThemeSelector.Create("Assets/Themes"); - ThemeSelector.LoadSelectedTheme("Assets/selected.theme"); + ThemeSelector.LoadSelectedTheme(Path.Combine(UserSettings.SettingsFolder, "selected.theme")); + if (ThemeSelector.SelectedTheme.Name == "UVtoolsDark") + { + foreach (var theme in ThemeSelector.Themes) + { + if (theme.Name != "UVtoolsLight") continue; + theme.ApplyTheme(); + break; + } + } + MainWindow = new MainWindow(); try @@ -70,7 +80,7 @@ namespace UVtools.WPF desktop.MainWindow = MainWindow; desktop.Exit += (sender, e) - => ThemeSelector.SaveSelectedTheme("Assets/selected.theme"); + => ThemeSelector.SaveSelectedTheme(Path.Combine(UserSettings.SettingsFolder, "selected.theme")); } base.OnFrameworkInitializationCompleted(); diff --git a/UVtools.WPF/Assets/Themes/UVtools.themes b/UVtools.WPF/Assets/Themes/UVtools.themes index caf7d59..409bb2b 100644 --- a/UVtools.WPF/Assets/Themes/UVtools.themes +++ b/UVtools.WPF/Assets/Themes/UVtools.themes @@ -48,7 +48,7 @@ "HighlightColor": "#FF119EDA", "ErrorColor": "#FFFF0000", "ErrorLowColor": "#10FF0000", - "ThemeBorderThickness": "11", + "ThemeBorderThickness": "1", "ThemeDisabledOpacity": 0.5, "FontSizeSmall": 12.0, "FontSizeNormal": 14.0, diff --git a/UVtools.WPF/Assets/Themes/UVtoolsDark.xaml b/UVtools.WPF/Assets/Themes/UVtoolsDark.xaml index 2c8dfc6..be0bf89 100644 --- a/UVtools.WPF/Assets/Themes/UVtoolsDark.xaml +++ b/UVtools.WPF/Assets/Themes/UVtoolsDark.xaml @@ -46,7 +46,7 @@ - 11 + 1 0.5 12 diff --git a/UVtools.WPF/Assets/Themes/UVtoolsLight.xaml b/UVtools.WPF/Assets/Themes/UVtoolsLight.xaml index 3dadc1d..c85b9b1 100644 --- a/UVtools.WPF/Assets/Themes/UVtoolsLight.xaml +++ b/UVtools.WPF/Assets/Themes/UVtoolsLight.xaml @@ -12,16 +12,16 @@ #FFAAAAAA #FF888888 #FF333333 - #FFFFFFFF - #FFAAAAAA - #FF888888 + #FFFFFFFF + #FFAAAAAA + #f1c40f #FFF0F0F0 - #FFD0D0D0 + #FFD0D0D0 #FF808080 #FF000000 #FF808080 - #FF086F9E + #FF086F9E #FFFF0000 #10FF0000 diff --git a/UVtools.WPF/Assets/selected.theme b/UVtools.WPF/Assets/selected.theme deleted file mode 100644 index fe05432..0000000 --- a/UVtools.WPF/Assets/selected.theme +++ /dev/null @@ -1 +0,0 @@ -UVtoolsLight \ No newline at end of file diff --git a/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs index d12721e..ec61293 100644 --- a/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs +++ b/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs @@ -1,11 +1,9 @@ -using System; -using System.Globalization; +using System.Globalization; using Avalonia; using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Layout; using Avalonia.Markup.Xaml; -using Avalonia.Media.Imaging; using UVtools.Core.Extensions; using UVtools.Core.FileFormats; using UVtools.Core.Operations; diff --git a/UVtools.WPF/MainWindow.axaml b/UVtools.WPF/MainWindow.axaml index b9528c1..2f30434 100644 --- a/UVtools.WPF/MainWindow.axaml +++ b/UVtools.WPF/MainWindow.axaml @@ -1406,7 +1406,7 @@ @@ -1420,7 +1420,7 @@ > - + @@ -1430,7 +1430,7 @@ > - + diff --git a/UVtools.WPF/UserSettings.cs b/UVtools.WPF/UserSettings.cs index bd8ee85..c6dc4bb 100644 --- a/UVtools.WPF/UserSettings.cs +++ b/UVtools.WPF/UserSettings.cs @@ -9,10 +9,12 @@ using System; using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using System.Xml.Serialization; using Avalonia.Media; using JetBrains.Annotations; using ReactiveUI; +using UVtools.Core; using Color=UVtools.WPF.Structures.Color; namespace UVtools.WPF @@ -943,10 +945,21 @@ namespace UVtools.WPF #endregion #region Singleton + + public static string SettingsFolder + { + get + { + var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), About.Software); + Directory.CreateDirectory(path); + return path; + } + } + /// /// Default filepath for store /// - private const string FilePath = "Assets/usersettings.xml"; + private static string FilePath => Path.Combine(SettingsFolder, "usersettings.xml"); private static UserSettings _instance; @@ -1077,9 +1090,9 @@ namespace UVtools.WPF } var serializer = new XmlSerializer(typeof(UserSettings)); - using var myXmlReader = new StreamReader(FilePath); try { + using var myXmlReader = new StreamReader(FilePath); _instance = (UserSettings)serializer.Deserialize(myXmlReader); if (_instance.General.MaxDegreeOfParallelism <= 0) _instance.General.MaxDegreeOfParallelism = Environment.ProcessorCount; @@ -1109,9 +1122,9 @@ namespace UVtools.WPF Instance.SavesCount++; _instance.ModifiedDateTime = DateTime.Now; var serializer = new XmlSerializer(_instance.GetType()); - using var myXmlWriter = new StreamWriter(FilePath); try { + using var myXmlWriter = new StreamWriter(FilePath); serializer.Serialize(myXmlWriter, _instance); } catch (Exception e)