From 10821a1df2cb22e25c4cdf6ea63649ddde9e881c Mon Sep 17 00:00:00 2001 From: Tig Date: Mon, 20 Apr 2026 13:36:42 -0700 Subject: [PATCH 1/3] Refactor driver param, MinUI, and Terminal.Gui integration - Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text - Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev - Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified - Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow - Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView - Ensure explicit disposal of windows and apps in all entry points - Expose TreeView.GetSize() for accurate sizing - Update launchSettings.json and tests for new Driver param and MinUI usage - Improve null-safety, event handling, and consistency throughout UI code --- Terminal.Gui/Views/TreeView/TreeViewT.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Terminal.Gui/Views/TreeView/TreeViewT.cs b/Terminal.Gui/Views/TreeView/TreeViewT.cs index aeae194acf..f2f03db77e 100644 --- a/Terminal.Gui/Views/TreeView/TreeViewT.cs +++ b/Terminal.Gui/Views/TreeView/TreeViewT.cs @@ -686,11 +686,7 @@ private void UpdateContentSize () try { - IReadOnlyCollection> map = BuildLineMap (); - int width = map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0; - int height = map.Count; - - SetContentSize (new Size (width, height)); + SetContentSize (GetSize ()); } finally { @@ -698,6 +694,18 @@ private void UpdateContentSize () } } + /// + /// Gets the logical size of the tree based on currently visible branches. The width is the maximum width of any + /// visible branch, and the height is the total number of visible branches. + /// + /// + public Size GetSize () + { + IReadOnlyCollection> map = BuildLineMap (); + + return new Size (map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0, map.Count); + } + /// protected override void OnViewportChanged (DrawEventArgs e) { From b6baa4c40ea2081977c0e028639d97da1ad5ff8d Mon Sep 17 00:00:00 2001 From: Tig Date: Mon, 20 Apr 2026 13:38:56 -0700 Subject: [PATCH 2/3] Revert "Refactor driver param, MinUI, and Terminal.Gui integration" This reverts commit 10821a1df2cb22e25c4cdf6ea63649ddde9e881c. --- Terminal.Gui/Views/TreeView/TreeViewT.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Terminal.Gui/Views/TreeView/TreeViewT.cs b/Terminal.Gui/Views/TreeView/TreeViewT.cs index f2f03db77e..aeae194acf 100644 --- a/Terminal.Gui/Views/TreeView/TreeViewT.cs +++ b/Terminal.Gui/Views/TreeView/TreeViewT.cs @@ -686,7 +686,11 @@ private void UpdateContentSize () try { - SetContentSize (GetSize ()); + IReadOnlyCollection> map = BuildLineMap (); + int width = map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0; + int height = map.Count; + + SetContentSize (new Size (width, height)); } finally { @@ -694,18 +698,6 @@ private void UpdateContentSize () } } - /// - /// Gets the logical size of the tree based on currently visible branches. The width is the maximum width of any - /// visible branch, and the height is the total number of visible branches. - /// - /// - public Size GetSize () - { - IReadOnlyCollection> map = BuildLineMap (); - - return new Size (map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0, map.Count); - } - /// protected override void OnViewportChanged (DrawEventArgs e) { From 28b89e3e825f585ea26119302ada030b8fff5db1 Mon Sep 17 00:00:00 2001 From: Tig Date: Mon, 20 Apr 2026 13:41:58 -0700 Subject: [PATCH 3/3] Refactor tree size calculation into GetSize() method Extracted content size logic to a new public GetSize() method in TreeView. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize(). --- Terminal.Gui/Views/TreeView/TreeViewT.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Terminal.Gui/Views/TreeView/TreeViewT.cs b/Terminal.Gui/Views/TreeView/TreeViewT.cs index aeae194acf..2d745289a8 100644 --- a/Terminal.Gui/Views/TreeView/TreeViewT.cs +++ b/Terminal.Gui/Views/TreeView/TreeViewT.cs @@ -686,11 +686,7 @@ private void UpdateContentSize () try { - IReadOnlyCollection> map = BuildLineMap (); - int width = map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0; - int height = map.Count; - - SetContentSize (new Size (width, height)); + SetContentSize (GetSize ()); } finally { @@ -698,6 +694,18 @@ private void UpdateContentSize () } } + /// + /// Calculates the logical size of the tree based on currently expanded branches. The width is the maximum width of + /// all visible branches, and the height is the total number of visible branches. + /// + /// + public Size GetSize () + { + IReadOnlyCollection> map = BuildLineMap (); + + return new Size (map.Count > 0 ? map.Max (b => b.GetWidth ()) : 0, map.Count); + } + /// protected override void OnViewportChanged (DrawEventArgs e) {