From 46ae45f06174476764b535c8db5909e8348bc8ec Mon Sep 17 00:00:00 2001 From: Jimmy White Date: Sun, 14 Jul 2024 15:07:02 +0100 Subject: [PATCH] Integrate Material Design UI updates This commit represents a major overhaul of the application's user interface, focusing on the integration of Material Design principles across various XAML files and some backend adjustments. Key changes include the removal of old ResourceDictionary themes in favor of direct Material Design components, such as `materialDesign:DialogHost` and `materialDesign:Card`, in AddProfileDialog.xaml. CustomDialog.xaml and ErrorBox.xaml have seen updates to use Material Design resources for `TextElement`, `Background`, and `FontFamily`, with a general shift in `FontSize` to `12` for a more consistent look. The application's version has been updated in the Elite Dangerous Addon Launcher V2.csproj file. MainWindow.xaml.cs has been enhanced with better error handling and a new bug fix note in the "What's New" section. SearchProgressWindow.xaml and WhatsNew.xaml also received updates to fully align with Material Design standards, removing outdated visual settings and ensuring a cohesive and modern user experience. --- AddProfileDialog.xaml | 10 +--------- CustomDialog.xaml | 12 +++++++----- Elite Dangerous Addon Launcher V2.csproj | 4 ++-- ErrorBox.xaml | 12 +++++++----- MainWindow.xaml.cs | 14 ++++++++++++-- SearchProgressWindow.xaml | 10 ++++++---- WhatsNew.xaml | 7 +++++-- 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/AddProfileDialog.xaml b/AddProfileDialog.xaml index ae14933..57ac41d 100644 --- a/AddProfileDialog.xaml +++ b/AddProfileDialog.xaml @@ -10,15 +10,7 @@ TextOptions.TextRenderingMode="Auto" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{DynamicResource MaterialDesignFont}"> - - - - - - - - - + diff --git a/CustomDialog.xaml b/CustomDialog.xaml index 1267280..2ded03c 100644 --- a/CustomDialog.xaml +++ b/CustomDialog.xaml @@ -6,13 +6,15 @@ Width="400" Height="200" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - TextElement.Foreground="{DynamicResource MaterialDesignBody}" - TextElement.FontWeight="Regular" - TextElement.FontSize="13" + TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" + Background="{DynamicResource MaterialDesign.Brush.Background}" + TextElement.FontWeight="Regular" + TextElement.FontSize="12" + FontFamily="{materialDesign:MaterialDesignFont}" + TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" - Background="{DynamicResource MaterialDesignPaper}" - FontFamily="{DynamicResource MaterialDesignFont}"> +> diff --git a/Elite Dangerous Addon Launcher V2.csproj b/Elite Dangerous Addon Launcher V2.csproj index 96d7d35..7d1d058 100644 --- a/Elite Dangerous Addon Launcher V2.csproj +++ b/Elite Dangerous Addon Launcher V2.csproj @@ -6,8 +6,8 @@ Elite_Dangerous_Addon_Launcher_V2 enable true - 1.1.5.397 - 1.1.5.397 + 1.1.5.405 + 1.1.5.405 elite-dangerous-icon.ico app.png https://github.com/jimmyeao/Elite-Dangerous-Addon-Launcher-V2 diff --git a/ErrorBox.xaml b/ErrorBox.xaml index 9adf26a..61c9736 100644 --- a/ErrorBox.xaml +++ b/ErrorBox.xaml @@ -6,13 +6,15 @@ Width="400" Height="200" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - TextElement.Foreground="{DynamicResource MaterialDesignBody}" - TextElement.FontWeight="Regular" - TextElement.FontSize="13" + TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" + Background="{DynamicResource MaterialDesign.Brush.Background}" + TextElement.FontWeight="Regular" + TextElement.FontSize="12" + FontFamily="{materialDesign:MaterialDesignFont}" + TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" - Background="{DynamicResource MaterialDesignPaper}" - FontFamily="{DynamicResource MaterialDesignFont}"> +> diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 47e4914..ee3ae22 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -391,7 +391,7 @@ public void ShowWhatsNew() List list = new List(); - ListItem listItem1 = new ListItem(new Paragraph(new Run("Fixed bug blurry text on some forms"))); + ListItem listItem1 = new ListItem(new Paragraph(new Run("Fixed bug with adding profiles causing a crash on first run"))); list.ListItems.Add(listItem1); // ListItem listItem2 = new ListItem(new Paragraph(new Run("Profile Options for import/export and copy/rename/delete"))); @@ -523,7 +523,17 @@ private void DeleteButton_Click(object sender, RoutedEventArgs e) var appToDelete = (MyApp)button.DataContext; // remove the item from the collection - AppState.Instance.CurrentProfile.Apps.Remove(appToDelete); + try + { + AppState.Instance.CurrentProfile.Apps.Remove(appToDelete); + Log.Information($"App {appToDelete.Name} deleted..", appToDelete.Name); + } + + catch (Exception ex) + { + // handle exception + Log.Error(ex, "An error occurred trying to delete an app.."); + } _ = SaveProfilesAsync(); } } diff --git a/SearchProgressWindow.xaml b/SearchProgressWindow.xaml index 2fe1fc4..81e0ae8 100644 --- a/SearchProgressWindow.xaml +++ b/SearchProgressWindow.xaml @@ -6,13 +6,15 @@ Height="150" Width="400" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - TextElement.Foreground="{DynamicResource MaterialDesignBody}" + TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" + Background="{DynamicResource MaterialDesign.Brush.Background}" TextElement.FontWeight="Regular" - TextElement.FontSize="13" + TextElement.FontSize="12" + FontFamily="{materialDesign:MaterialDesignFont}" + TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" - Background="{DynamicResource MaterialDesignPaper}" - FontFamily="{DynamicResource MaterialDesignFont}"> + > + >