Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge v2_develop into v2_release #3720

Merged
merged 11 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Terminal.Gui/Configuration/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public enum ConfigLocations
TypeInfoResolver = SourceGenerationContext.Default
};

[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
internal static readonly SourceGenerationContext _serializerContext = new (_serializerOptions);

[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Terminal.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@
<EnableSourceLink>true</EnableSourceLink>
<Authors>Miguel de Icaza, Tig Kindel (@tig), @BDisp</Authors>
</PropertyGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Terminal.Gui/View/Layout/Dim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace Terminal.Gui;
/// </item>
/// <item>
/// <term>
/// <see cref="Dim.Fill(int)"/>
/// <see cref="Dim.Fill(Dim)"/>
/// </term>
/// <description>
/// Creates a <see cref="Dim"/> object that fills the dimension from the View's X position
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/View/Layout/Pos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public static Pos Percent (int percent)
/// <summary>
/// Indicates whether the specified type <typeparamref name="T"/> is in the hierarchy of this Pos object.
/// </summary>
/// <param name="pos">A reference to this <see cref="Pos}"/> instance.</param>
/// <param name="pos">A reference to this <see cref="Pos"/> instance.</param>
/// <returns></returns>
public bool Has<T> (out Pos pos) where T : Pos
{
Expand Down
2 changes: 2 additions & 0 deletions Terminal.Gui/View/View.Hierarchy.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#nullable enable
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace Terminal.Gui;

public partial class View // SuperView/SubView hierarchy management (SuperView, SubViews, Add, Remove, etc.)
{
[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
private static readonly IList<View> _empty = new List<View> (0).AsReadOnly ();

private List<View>? _subviews; // This is null, and allocated on demand.
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/View/View.Layout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public Pos Y
/// .
/// </para>
/// <para>
/// If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
/// If set to a relative value (e.g. <see cref="Dim.Fill(Dim)"/>) the value is indeterminate until the view has
/// been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
/// called.
/// </para>
Expand Down Expand Up @@ -500,7 +500,7 @@ public Dim? Height
/// .
/// </para>
/// <para>
/// If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
/// If set to a relative value (e.g. <see cref="Dim.Fill(Dim)"/>) the value is indeterminate until the view has
/// been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
/// called.
/// </para>
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Views/ColorPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private void CreateNameField ()
_tfName.Autocomplete = auto;

_tfName.HasFocusChanged += UpdateValueFromName;
_tfName.Accept += (_s, _) => UpdateValueFromName ();
_tfName.Accept += (s, _) => UpdateValueFromName ();
}

private void CreateTextField ()
Expand Down Expand Up @@ -303,7 +303,7 @@ private void UpdateSingleBarValueFromTextField (object? sender)
}
}

private void UpdateValueFromName (object sender, HasFocusEventArgs e)
private void UpdateValueFromName (object? sender, HasFocusEventArgs e)
{
// if the new value of Focused is true then it is an enter event so ignore
if (e.NewValue)
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/Toplevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class Toplevel : View
/// <summary>
/// Initializes a new instance of the <see cref="Toplevel"/> class,
/// defaulting to full screen. The <see cref="View.Width"/> and <see cref="View.Height"/> properties will be set to the
/// dimensions of the terminal using <see cref="Dim.Fill"/>.
/// dimensions of the terminal using <see cref="Dim.Fill(Dim)"/>.
/// </summary>
public Toplevel ()
{
Expand Down
8 changes: 6 additions & 2 deletions UICatalog/UICatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.ObjectModel;
using System.CommandLine;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -55,9 +56,11 @@ public class UICatalogApp
private static int _cachedScenarioIndex;
private static string? _cachedTheme = string.Empty;
private static ObservableCollection<string>? _categories;
[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
private static readonly FileSystemWatcher _currentDirWatcher = new ();
private static ViewDiagnosticFlags _diagnosticFlags;
private static string _forceDriver = string.Empty;
[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
private static readonly FileSystemWatcher _homeDirWatcher = new ();
private static bool _isFirstRunning = true;
private static Options _options;
Expand Down Expand Up @@ -406,7 +409,7 @@ public UICatalogTopLevel ()
_diagnosticFlags = Diagnostics;

_themeMenuItems = CreateThemeMenuItems ();
_themeMenuBarItem = new ("_Themes", _themeMenuItems);
_themeMenuBarItem = new ("_Themes", _themeMenuItems!);

MenuBar menuBar = new ()
{
Expand Down Expand Up @@ -676,7 +679,7 @@ public void ConfigChanged ()

ColorScheme = Colors.ColorSchemes [_topLevelColorScheme];

MenuBar!.Menus [0].Children [0].ShortcutKey = Application.QuitKey;
MenuBar!.Menus [0].Children! [0]!.ShortcutKey = Application.QuitKey;

if (StatusBar is { })
{
Expand Down Expand Up @@ -783,6 +786,7 @@ private void CategoryView_SelectedChanged (object? sender, ListViewItemEventArgs

private void ConfigAppliedHandler (object? sender, ConfigurationManagerEventArgs? a) { ConfigChanged (); }

[SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
private MenuItem [] CreateDiagnosticFlagsMenuItems ()
{
const string OFF = "View Diagnostics: _Off";
Expand Down
3 changes: 1 addition & 2 deletions UnitTests/FileServices/FileDialogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Terminal.Gui.FileServicesTests;

public class FileDialogTests (ITestOutputHelper output)
public class FileDialogTests ()
{
[Theory]
[InlineData (true)]
Expand Down Expand Up @@ -787,7 +787,6 @@ private TextField GetTextField (FileDialog dlg, FileDialogPart part)
return dlg.Subviews.OfType<TextField> ().ElementAt (0);
case FileDialogPart.SearchField:
return dlg.Subviews.OfType<TextField> ().ElementAt (1);
break;
default:
throw new ArgumentOutOfRangeException (nameof (part), part, null);
}
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
False
</IncludeTestAssembly>
</PropertyGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion UnitTests/View/Layout/Dim.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public void Only_DimAbsolute_And_DimFactor_As_A_Different_Procedure_For_Assignin
#if DEBUG
Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ());
#else
Assert.Equal ("Combine(Fill(0)-Absolute(2))", v2.Height.ToString ());
Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ());
#endif
Assert.Equal (47, v2.Frame.Width); // 49-2=47
Assert.Equal (89, v2.Frame.Height); // 98-5-2-2=89
Expand Down
Loading