From 04d7d3f23cf49972e78db61320d3809e90201d9d Mon Sep 17 00:00:00 2001 From: Lukas H Date: Thu, 21 Dec 2023 13:05:29 +0100 Subject: [PATCH 1/2] fix: color button --- EasyGUI/Controls/Buttons/BaseButton.xaml | 2 +- EasyGUI/Controls/Buttons/CancelButton.xaml | 2 +- EasyGUI/Controls/Buttons/ValidateButton.xaml | 2 +- EasyGUI/Resources/GlobalStyles.xaml | 6 +++--- EasyGUI/Resources/Themes/Dark.xaml | 5 ++++- EasyGUI/Resources/Themes/White.xaml | 3 +++ 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/EasyGUI/Controls/Buttons/BaseButton.xaml b/EasyGUI/Controls/Buttons/BaseButton.xaml index be7cbf8..30e352e 100644 --- a/EasyGUI/Controls/Buttons/BaseButton.xaml +++ b/EasyGUI/Controls/Buttons/BaseButton.xaml @@ -33,7 +33,7 @@ - diff --git a/EasyGUI/Controls/Buttons/CancelButton.xaml b/EasyGUI/Controls/Buttons/CancelButton.xaml index d28dc19..bc553e1 100644 --- a/EasyGUI/Controls/Buttons/CancelButton.xaml +++ b/EasyGUI/Controls/Buttons/CancelButton.xaml @@ -26,7 +26,7 @@ - diff --git a/EasyGUI/Controls/Buttons/ValidateButton.xaml b/EasyGUI/Controls/Buttons/ValidateButton.xaml index 0badca9..e7acc42 100644 --- a/EasyGUI/Controls/Buttons/ValidateButton.xaml +++ b/EasyGUI/Controls/Buttons/ValidateButton.xaml @@ -26,7 +26,7 @@ - diff --git a/EasyGUI/Resources/GlobalStyles.xaml b/EasyGUI/Resources/GlobalStyles.xaml index 4fd990d..59b0bb5 100644 --- a/EasyGUI/Resources/GlobalStyles.xaml +++ b/EasyGUI/Resources/GlobalStyles.xaml @@ -32,7 +32,7 @@ - + @@ -60,13 +60,13 @@ Grid.Column="0" CornerRadius="6,0,0,6" Margin="1" - Background="{DynamicResource BackgroundBrush}" + Background="{DynamicResource TextWhiteBrush}" BorderBrush="{DynamicResource DarkGrayBrush}" BorderThickness="0,0,1,0" /> diff --git a/EasyGUI/Resources/Themes/Dark.xaml b/EasyGUI/Resources/Themes/Dark.xaml index 5fbe165..7d18b35 100644 --- a/EasyGUI/Resources/Themes/Dark.xaml +++ b/EasyGUI/Resources/Themes/Dark.xaml @@ -8,8 +8,11 @@ #C1C1C7 + + #F7F7FB + - #F7F7FB + #2E2E33 #F7F7FB diff --git a/EasyGUI/Resources/Themes/White.xaml b/EasyGUI/Resources/Themes/White.xaml index 405100f..6a7e6f6 100644 --- a/EasyGUI/Resources/Themes/White.xaml +++ b/EasyGUI/Resources/Themes/White.xaml @@ -8,6 +8,9 @@ #BBB9C6 + + #F7F7FB + #ffffff From 4a860af36ffe75a2dde871351401e4d71272fd8c Mon Sep 17 00:00:00 2001 From: Lukas H Date: Thu, 21 Dec 2023 13:16:22 +0100 Subject: [PATCH 2/2] feat: port du server dans les settings --- EasyGUI/Controls/SettingsPopup.xaml | 9 ++++++++- EasyGUI/Controls/SettingsPopup.xaml.cs | 20 ++++++++++++++++++++ EasyGUI/Resources/Strings.Designer.cs | 9 +++++++++ EasyGUI/Resources/Strings.fr.Designer.cs | 9 +++++++++ EasyGUI/Resources/Strings.fr.resx | 3 +++ EasyGUI/Resources/Strings.resx | 3 +++ 6 files changed, 52 insertions(+), 1 deletion(-) diff --git a/EasyGUI/Controls/SettingsPopup.xaml b/EasyGUI/Controls/SettingsPopup.xaml index 8b9b739..28247c6 100644 --- a/EasyGUI/Controls/SettingsPopup.xaml +++ b/EasyGUI/Controls/SettingsPopup.xaml @@ -97,7 +97,14 @@ - + + + + diff --git a/EasyGUI/Controls/SettingsPopup.xaml.cs b/EasyGUI/Controls/SettingsPopup.xaml.cs index 834873e..70bc1fc 100644 --- a/EasyGUI/Controls/SettingsPopup.xaml.cs +++ b/EasyGUI/Controls/SettingsPopup.xaml.cs @@ -52,6 +52,13 @@ public partial class SettingsPopup : INotifyPropertyChanged new PropertyMetadata(default(string)) ); + private static readonly DependencyProperty ServerPortProperty = DependencyProperty.Register( + nameof(ServerPort), + typeof(int?), + typeof(SettingsPopup), + new PropertyMetadata(default(int?)) + ); + private string? _baseCulture; private string? _baseTheme; @@ -120,6 +127,16 @@ public string MaxFileSize } } + public int ServerPort + { + get => (int)GetValue(ServerPortProperty); + set + { + SetValue(ServerPortProperty, value); + OnPropertyChanged(); + } + } + public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) @@ -170,6 +187,7 @@ private void UpdateProperties() "dark" => 1, _ => 0 }; + ServerPort = (int)ConfigManager.Instance.ServerPort!; } private void ValidateButton_OnClick(object sender, RoutedEventArgs e) @@ -231,6 +249,8 @@ private void ValidateButton_OnClick(object sender, RoutedEventArgs e) _ => "light" }); + ConfigManager.Instance.ServerPort = ServerPort; + // Save config ConfigManager.Instance.WriteConfig(); diff --git a/EasyGUI/Resources/Strings.Designer.cs b/EasyGUI/Resources/Strings.Designer.cs index f8c5f1f..8f61aef 100644 --- a/EasyGUI/Resources/Strings.Designer.cs +++ b/EasyGUI/Resources/Strings.Designer.cs @@ -592,6 +592,15 @@ public static string SettingsPopup_PriorityFilesExtensions { } } + /// + /// Looks up a localized string similar to Server port. + /// + public static string SettingsPopup_ServerPort { + get { + return ResourceManager.GetString("SettingsPopup_ServerPort", resourceCulture); + } + } + /// /// Looks up a localized string similar to Settings. /// diff --git a/EasyGUI/Resources/Strings.fr.Designer.cs b/EasyGUI/Resources/Strings.fr.Designer.cs index c33bf7e..c279e21 100644 --- a/EasyGUI/Resources/Strings.fr.Designer.cs +++ b/EasyGUI/Resources/Strings.fr.Designer.cs @@ -592,6 +592,15 @@ public static string SettingsPopup_PriorityFilesExtensions { } } + /// + /// Looks up a localized string similar to Port du server. + /// + public static string SettingsPopup_ServerPort { + get { + return ResourceManager.GetString("SettingsPopup_ServerPort", resourceCulture); + } + } + /// /// Looks up a localized string similar to Paramètres. /// diff --git a/EasyGUI/Resources/Strings.fr.resx b/EasyGUI/Resources/Strings.fr.resx index bb93013..3546eb8 100644 --- a/EasyGUI/Resources/Strings.fr.resx +++ b/EasyGUI/Resources/Strings.fr.resx @@ -223,4 +223,7 @@ Nous nous excusons pour la gêne occasionnée. Sombre + + Port du server + \ No newline at end of file diff --git a/EasyGUI/Resources/Strings.resx b/EasyGUI/Resources/Strings.resx index 33e38b8..313ffd9 100644 --- a/EasyGUI/Resources/Strings.resx +++ b/EasyGUI/Resources/Strings.resx @@ -223,4 +223,7 @@ We are sorry for this inconvenience. Dark + + Server port + \ No newline at end of file