From 95563d5cd8af392fa56857c0f749985f30aa43c5 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 00:30:21 +0100 Subject: [PATCH 01/13] Add a native AOT project. --- NativeAot/NativeAot.csproj | 22 ++++ NativeAot/Program.cs | 113 ++++++++++++++++++ .../FolderProfile_net8.0_win-x64_Debug.pubxml | 18 +++ ...olderProfile_net8.0_win-x64_Release.pubxml | 18 +++ NativeAot/Publish_linux-x64_Debug.sh | 5 + NativeAot/Publish_linux-x64_Release.sh | 5 + NativeAot/Publish_osx-x64_Debug.sh | 5 + NativeAot/Publish_osx-x64_Release.sh | 5 + NativeAot/README.md | 10 ++ 9 files changed, 201 insertions(+) create mode 100644 NativeAot/NativeAot.csproj create mode 100644 NativeAot/Program.cs create mode 100644 NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Debug.pubxml create mode 100644 NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Release.pubxml create mode 100644 NativeAot/Publish_linux-x64_Debug.sh create mode 100644 NativeAot/Publish_linux-x64_Release.sh create mode 100644 NativeAot/Publish_osx-x64_Debug.sh create mode 100644 NativeAot/Publish_osx-x64_Release.sh create mode 100644 NativeAot/README.md diff --git a/NativeAot/NativeAot.csproj b/NativeAot/NativeAot.csproj new file mode 100644 index 0000000000..6c5e1f136f --- /dev/null +++ b/NativeAot/NativeAot.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + enable + enable + true + false + + + + + + + + + + + + + diff --git a/NativeAot/Program.cs b/NativeAot/Program.cs new file mode 100644 index 0000000000..5ef38db051 --- /dev/null +++ b/NativeAot/Program.cs @@ -0,0 +1,113 @@ +// This is a test application for a native Aot file. + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using Terminal.Gui; + +namespace NativeAot; + +public static class Program +{ + [RequiresUnreferencedCode ("Calls Terminal.Gui.Application.Init(ConsoleDriver, String)")] + [RequiresDynamicCode ("Calls Terminal.Gui.Application.Init(ConsoleDriver, String)")] + private static void Main (string [] args) + { + Application.Init (); + + #region The code in this region is not intended for use in a native Aot self-contained. It's just here to make sure there is no functionality break with localization in Terminal.Gui using self-contained + + if (Equals(Thread.CurrentThread.CurrentUICulture, CultureInfo.InvariantCulture) && Application.SupportedCultures.Count == 0) + { + // Only happens if the project has true + Debug.Assert (Application.SupportedCultures.Count == 0); + } + else + { + Debug.Assert (Application.SupportedCultures.Count > 0); + Debug.Assert (Equals (CultureInfo.CurrentCulture, Thread.CurrentThread.CurrentUICulture)); + } + + #endregion + + ExampleWindow app = new (); + Application.Run (app); + + // Dispose the app object before shutdown + app.Dispose (); + + // Before the application exits, reset Terminal.Gui for clean shutdown + Application.Shutdown (); + + // To see this output on the screen it must be done after shutdown, + // which restores the previous screen. + Console.WriteLine ($@"Username: {ExampleWindow.UserName}"); + } +} + +// Defines a top-level window with border and title +public class ExampleWindow : Window +{ + public static string? UserName; + + public ExampleWindow () + { + Title = $"Example App ({Application.QuitKey} to quit)"; + + // Create input components and labels + var usernameLabel = new Label { Text = "Username:" }; + + var userNameText = new TextField + { + // Position text field adjacent to the label + X = Pos.Right (usernameLabel) + 1, + + // Fill remaining horizontal space + Width = Dim.Fill () + }; + + var passwordLabel = new Label + { + Text = "Password:", X = Pos.Left (usernameLabel), Y = Pos.Bottom (usernameLabel) + 1 + }; + + var passwordText = new TextField + { + Secret = true, + + // align with the text box above + X = Pos.Left (userNameText), + Y = Pos.Top (passwordLabel), + Width = Dim.Fill () + }; + + // Create login button + var btnLogin = new Button + { + Text = "Login", + Y = Pos.Bottom (passwordLabel) + 1, + + // center the login button horizontally + X = Pos.Center (), + IsDefault = true + }; + + // When login button is clicked display a message popup + btnLogin.Accept += (s, e) => + { + if (userNameText.Text == "admin" && passwordText.Text == "password") + { + MessageBox.Query ("Logging In", "Login Successful", "Ok"); + UserName = userNameText.Text; + Application.RequestStop (); + } + else + { + MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok"); + } + }; + + // Add the views to the Window + Add (usernameLabel, userNameText, passwordLabel, passwordText, btnLogin); + } +} diff --git a/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Debug.pubxml b/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Debug.pubxml new file mode 100644 index 0000000000..c883267bf0 --- /dev/null +++ b/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Debug.pubxml @@ -0,0 +1,18 @@ + + + + + Debug + Any CPU + bin\Debug\net8.0\publish\win-x64\ + FileSystem + <_TargetId>Folder + net8.0 + win-x64 + true + false + false + + \ No newline at end of file diff --git a/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Release.pubxml b/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Release.pubxml new file mode 100644 index 0000000000..79576fb52f --- /dev/null +++ b/NativeAot/Properties/PublishProfiles/FolderProfile_net8.0_win-x64_Release.pubxml @@ -0,0 +1,18 @@ + + + + + Release + Any CPU + bin\Release\net8.0\publish\win-x64\ + FileSystem + <_TargetId>Folder + net8.0 + win-x64 + true + false + false + + \ No newline at end of file diff --git a/NativeAot/Publish_linux-x64_Debug.sh b/NativeAot/Publish_linux-x64_Debug.sh new file mode 100644 index 0000000000..b58a83cc1e --- /dev/null +++ b/NativeAot/Publish_linux-x64_Debug.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +dotnet clean +dotnet build +dotnet publish -c Debug -r linux-x64 --self-contained diff --git a/NativeAot/Publish_linux-x64_Release.sh b/NativeAot/Publish_linux-x64_Release.sh new file mode 100644 index 0000000000..3cb8feb267 --- /dev/null +++ b/NativeAot/Publish_linux-x64_Release.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +dotnet clean +dotnet build +dotnet publish -c Release -r linux-x64 --self-contained diff --git a/NativeAot/Publish_osx-x64_Debug.sh b/NativeAot/Publish_osx-x64_Debug.sh new file mode 100644 index 0000000000..1fe41513c6 --- /dev/null +++ b/NativeAot/Publish_osx-x64_Debug.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +dotnet clean +dotnet build +dotnet publish -c Debug -r osx-x64 --self-contained diff --git a/NativeAot/Publish_osx-x64_Release.sh b/NativeAot/Publish_osx-x64_Release.sh new file mode 100644 index 0000000000..06b748b79d --- /dev/null +++ b/NativeAot/Publish_osx-x64_Release.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +dotnet clean +dotnet build +dotnet publish -c Release -r osx-x64 --self-contained diff --git a/NativeAot/README.md b/NativeAot/README.md new file mode 100644 index 0000000000..7a55ccfc7c --- /dev/null +++ b/NativeAot/README.md @@ -0,0 +1,10 @@ +# Terminal.Gui C# SelfContained + +This project aims to test the `Terminal.Gui` library to create a simple `native AOT` `self-container` GUI application in C#, ensuring that all its features are available. + +With `Debug` the `.csproj` is used and with `Release` the latest `nuget package` is used, either in `Solution Configurations` or in `Profile Publish` or in the `Publish_linux-x64` or in the `Publish_osx-x64` files. +Unlike self-contained single-file publishing, native AOT publishing must be generated on the same platform as the target execution version. Therefore, if the target execution is Linux, then the publishing must be generated on a Linux operating system. Attempting to generate on Windows for the Linux target will throw an exception. + +To publish the `native AOT` file in `Debug` or `Release` mode, it is not necessary to select it in the `Solution Configurations`, just choose the `Debug` or `Release` configuration in the `Publish Profile` or the `*.sh` files. + +When executing the file directly from the `native AOT` file and needing to debug it, it will be necessary to attach it to the debugger, just like any other standalone application and selecting `Native Code`. \ No newline at end of file From 48137b7cccae70bbee9c010cdfb4683324107f3f Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 01:03:56 +0100 Subject: [PATCH 02/13] Fixes Text.Json to work with native AOT. --- Terminal.Gui/Configuration/SourceGenerationContext.cs | 3 +++ Terminal.Gui/Drawing/Alignment.cs | 3 ++- Terminal.Gui/Drawing/AlignmentModes.cs | 3 ++- Terminal.Gui/Drawing/LineStyle.cs | 3 +++ Terminal.Gui/View/Adornment/ShadowStyle.cs | 5 ++++- Terminal.Gui/Views/Button.cs | 2 -- Terminal.Gui/Views/Dialog.cs | 4 ---- Terminal.Gui/Views/FrameView.cs | 1 - Terminal.Gui/Views/MessageBox.cs | 1 - Terminal.Gui/Views/Window.cs | 1 - 10 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Terminal.Gui/Configuration/SourceGenerationContext.cs b/Terminal.Gui/Configuration/SourceGenerationContext.cs index ed93b68cae..07a83f1ccb 100644 --- a/Terminal.Gui/Configuration/SourceGenerationContext.cs +++ b/Terminal.Gui/Configuration/SourceGenerationContext.cs @@ -14,6 +14,9 @@ namespace Terminal.Gui; [JsonSerializable (typeof (Key))] [JsonSerializable (typeof (GlyphDefinitions))] [JsonSerializable (typeof (ConfigProperty))] +[JsonSerializable (typeof (Alignment))] +[JsonSerializable (typeof (AlignmentModes))] +[JsonSerializable (typeof (LineStyle))] [JsonSerializable (typeof (ShadowStyle))] [JsonSerializable (typeof (string))] [JsonSerializable (typeof (bool))] diff --git a/Terminal.Gui/Drawing/Alignment.cs b/Terminal.Gui/Drawing/Alignment.cs index 6a160096f1..169e4c323a 100644 --- a/Terminal.Gui/Drawing/Alignment.cs +++ b/Terminal.Gui/Drawing/Alignment.cs @@ -1,10 +1,11 @@ - +using System.Text.Json.Serialization; namespace Terminal.Gui; /// /// Determines the position of items when arranged in a container. /// +[JsonConverter (typeof (JsonStringEnumConverter))] public enum Alignment { /// diff --git a/Terminal.Gui/Drawing/AlignmentModes.cs b/Terminal.Gui/Drawing/AlignmentModes.cs index b7e0bb87e0..1b6e262c48 100644 --- a/Terminal.Gui/Drawing/AlignmentModes.cs +++ b/Terminal.Gui/Drawing/AlignmentModes.cs @@ -1,10 +1,11 @@ - +using System.Text.Json.Serialization; namespace Terminal.Gui; /// /// Determines alignment modes for . /// +[JsonConverter (typeof (JsonStringEnumConverter))] [Flags] public enum AlignmentModes { diff --git a/Terminal.Gui/Drawing/LineStyle.cs b/Terminal.Gui/Drawing/LineStyle.cs index 47e37a97aa..a696bc9435 100644 --- a/Terminal.Gui/Drawing/LineStyle.cs +++ b/Terminal.Gui/Drawing/LineStyle.cs @@ -1,7 +1,10 @@ #nullable enable +using System.Text.Json.Serialization; + namespace Terminal.Gui; /// Defines the style of lines for a . +[JsonConverter (typeof (JsonStringEnumConverter))] public enum LineStyle { /// No border is drawn. diff --git a/Terminal.Gui/View/Adornment/ShadowStyle.cs b/Terminal.Gui/View/Adornment/ShadowStyle.cs index a410292c64..7a95e78ed2 100644 --- a/Terminal.Gui/View/Adornment/ShadowStyle.cs +++ b/Terminal.Gui/View/Adornment/ShadowStyle.cs @@ -1,8 +1,11 @@ -namespace Terminal.Gui; +using System.Text.Json.Serialization; + +namespace Terminal.Gui; /// /// Defines the style of shadow to be drawn on the right and bottom sides of the . /// +[JsonConverter (typeof (JsonStringEnumConverter))] public enum ShadowStyle { /// diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs index f489a8bb4e..1f26097fb8 100644 --- a/Terminal.Gui/Views/Button.cs +++ b/Terminal.Gui/Views/Button.cs @@ -39,8 +39,6 @@ public class Button : View, IDesignable /// Gets or sets whether s are shown with a shadow effect by default. /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] - public static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None; /// Initializes a new instance of . diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index 7b4da93557..739a9d388e 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -19,13 +19,11 @@ public class Dialog : Window /// The default for . /// This property can be set in a Theme. [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public static Alignment DefaultButtonAlignment { get; set; } = Alignment.End; /// The default for . /// This property can be set in a Theme. [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public static AlignmentModes DefaultButtonAlignmentModes { get; set; } = AlignmentModes.StartToEnd | AlignmentModes.AddSpaceBetweenItems; /// @@ -47,7 +45,6 @@ public class Dialog : Window /// Gets or sets whether all s are shown with a shadow effect by default. /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public new static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None; /// @@ -56,7 +53,6 @@ public class Dialog : Window /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public new static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; private readonly List [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; /// diff --git a/Terminal.Gui/Views/Window.cs b/Terminal.Gui/Views/Window.cs index 1a4caa2665..87486290ae 100644 --- a/Terminal.Gui/Views/Window.cs +++ b/Terminal.Gui/Views/Window.cs @@ -73,6 +73,5 @@ public Window () /// s. /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; } From 4d0b485245daf4cd998608ac51bd953d906b835d Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 01:10:39 +0100 Subject: [PATCH 03/13] Fix silent errors on unit tests when testing the Red color which has a length of 3. --- Terminal.Gui/Drawing/Color.Formatting.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal.Gui/Drawing/Color.Formatting.cs b/Terminal.Gui/Drawing/Color.Formatting.cs index e381289579..406ceff4b1 100644 --- a/Terminal.Gui/Drawing/Color.Formatting.cs +++ b/Terminal.Gui/Drawing/Color.Formatting.cs @@ -284,7 +284,7 @@ in text ), // Any string too short to possibly be any supported format. - { Length: > 0 and < 4 } => throw new ColorParseException ( + { Length: > 0 and < 3 } => throw new ColorParseException ( in text, "Text was too short to be any possible supported format.", in text From 0223e9856606a5d60d92723f05d13605d685fe08 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 01:15:42 +0100 Subject: [PATCH 04/13] Allowing test custom configuration without the config.json file match the unit tests configurations. --- UnitTests/Configuration/ThemeScopeTests.cs | 13 ++-- UnitTests/TestHelpers.cs | 72 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/UnitTests/Configuration/ThemeScopeTests.cs b/UnitTests/Configuration/ThemeScopeTests.cs index 7991da5e7f..4da1928c74 100644 --- a/UnitTests/Configuration/ThemeScopeTests.cs +++ b/UnitTests/Configuration/ThemeScopeTests.cs @@ -29,13 +29,18 @@ public void Apply_ShouldApplyUpdatedProperties () { Reset (); Assert.NotEmpty (Themes); - Assert.Equal (Alignment.End, Dialog.DefaultButtonAlignment); + Alignment savedValue = Dialog.DefaultButtonAlignment; + Alignment newValue = Alignment.Center != savedValue ? Alignment.Center : Alignment.Start; - Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.Center; + Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = newValue; ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply (); - Assert.Equal (Alignment.Center, Dialog.DefaultButtonAlignment); - Reset (); + Assert.Equal (newValue, Dialog.DefaultButtonAlignment); + + // Replace with the savedValue to avoid failures on other unit tests that rely on the default value + Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = savedValue; + ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply (); + Assert.Equal (savedValue, Dialog.DefaultButtonAlignment); } [Fact] diff --git a/UnitTests/TestHelpers.cs b/UnitTests/TestHelpers.cs index 4604b4eca6..784b21da5b 100644 --- a/UnitTests/TestHelpers.cs +++ b/UnitTests/TestHelpers.cs @@ -86,6 +86,11 @@ public override void After (MethodInfo methodUnderTest) } #endif ConfigurationManager.Reset (); + + if (CM.Locations != CM.ConfigLocations.None) + { + SetCurrentConfig (_savedValues); + } } } @@ -110,10 +115,77 @@ public override void Before (MethodInfo methodUnderTest) } #endif Application.Init ((ConsoleDriver)Activator.CreateInstance (_driverType)); + + if (CM.Locations != CM.ConfigLocations.None) + { + _savedValues = GetCurrentConfig (); + } } } private bool AutoInit { get; } + + private List _savedValues; + + private List GetCurrentConfig () + { + CM.Reset (); + + List savedValues = + [ + Dialog.DefaultButtonAlignment, + Dialog.DefaultButtonAlignmentModes, + MessageBox.DefaultBorderStyle + ]; + CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.End; + CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignmentModes"].PropertyValue = AlignmentModes.AddSpaceBetweenItems; + CM.Themes! ["Default"] ["MessageBox.DefaultBorderStyle"].PropertyValue = LineStyle.Double; + ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply (); + + return savedValues; + } + + private void SetCurrentConfig (List values) + { + CM.Reset (); + bool needApply = false; + + foreach (object value in values) + { + switch (value) + { + case Alignment alignment: + if ((Alignment)CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue! != alignment) + { + needApply = true; + CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = alignment; + } + + break; + case AlignmentModes alignmentModes: + if ((AlignmentModes)CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignmentModes"].PropertyValue! != alignmentModes) + { + needApply = true; + CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignmentModes"].PropertyValue = alignmentModes; + } + + break; + case LineStyle lineStyle: + if ((LineStyle)CM.Themes! ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue! != lineStyle) + { + needApply = true; + CM.Themes! ["Default"] ["MessageBox.DefaultBorderStyle"].PropertyValue = lineStyle; + } + + break; + } + } + + if (needApply) + { + ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply (); + } + } } [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method)] From 3727b888a1ec27ef221e0e573346456166b7e12e Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 01:17:26 +0100 Subject: [PATCH 05/13] Fix unit test if tested alone. --- UnitTests/Configuration/ThemeTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UnitTests/Configuration/ThemeTests.cs b/UnitTests/Configuration/ThemeTests.cs index 99038bd868..fc1694f8a5 100644 --- a/UnitTests/Configuration/ThemeTests.cs +++ b/UnitTests/Configuration/ThemeTests.cs @@ -76,6 +76,9 @@ public void TestApply_UpdatesColors () [Fact] public void TestSerialize_RoundTrip () { + // This is needed to test only this alone + Reset (); + var theme = new ThemeScope (); theme ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.End; From 4ab56f85d15d72cf9e4dff974f021ac76ec8d79f Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 4 Aug 2024 01:18:34 +0100 Subject: [PATCH 06/13] Add native project into solution. --- Terminal.sln | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Terminal.sln b/Terminal.sln index 550bbe4ed1..23a60d7b60 100644 --- a/Terminal.sln +++ b/Terminal.sln @@ -45,6 +45,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{C7A51224-5 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelfContained", "SelfContained\SelfContained.csproj", "{524DEA78-7E7C-474D-B42D-52ED4C04FF14}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NativeAot", "NativeAot\NativeAot.csproj", "{E6D716C6-AC94-4150-B10A-44AE13F79344}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -79,6 +81,10 @@ Global {524DEA78-7E7C-474D-B42D-52ED4C04FF14}.Debug|Any CPU.Build.0 = Debug|Any CPU {524DEA78-7E7C-474D-B42D-52ED4C04FF14}.Release|Any CPU.ActiveCfg = Release|Any CPU {524DEA78-7E7C-474D-B42D-52ED4C04FF14}.Release|Any CPU.Build.0 = Release|Any CPU + {E6D716C6-AC94-4150-B10A-44AE13F79344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6D716C6-AC94-4150-B10A-44AE13F79344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6D716C6-AC94-4150-B10A-44AE13F79344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6D716C6-AC94-4150-B10A-44AE13F79344}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From c275f80feb46528e353db80ac954f8b3faec89ad Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 5 Aug 2024 18:05:26 +0100 Subject: [PATCH 07/13] Fix merge errors. --- Terminal.Gui/Views/Dialog.cs | 5 +---- Terminal.Gui/Views/MessageBox.cs | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index 6bd714a8a4..11d57bb4a9 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -19,10 +19,9 @@ public class Dialog : Window /// The default for . /// This property can be set in a Theme. [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public static Alignment DefaultButtonAlignment { get; set; } = Alignment.End; // Default is set in config.json - /// The default for . + /// The default for . /// This property can be set in a Theme. [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] public static AlignmentModes DefaultButtonAlignmentModes { get; set; } = AlignmentModes.StartToEnd | AlignmentModes.AddSpaceBetweenItems; @@ -46,7 +45,6 @@ public class Dialog : Window /// Gets or sets whether all s are shown with a shadow effect by default. /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public new static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None; // Default is set in config.json /// @@ -55,7 +53,6 @@ public class Dialog : Window /// [SerializableConfigurationProperty (Scope = typeof (ThemeScope))] - [JsonConverter (typeof (JsonStringEnumConverter))] public new static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; // Default is set in config.json private readonly List