mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 01:38:01 +01:00
Fixed stuff broke by merge
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
using static Terminal.Gui.SpinnerStyle;
|
||||
|
||||
namespace Terminal.Gui;
|
||||
|
||||
@@ -894,7 +895,24 @@ public partial class View
|
||||
|
||||
foreach (View v in ordered)
|
||||
{
|
||||
LayoutSubview (v, ContentSize);
|
||||
if (v.Width is Dim.DimAuto || v.Height is Dim.DimAuto)
|
||||
{
|
||||
// If the view is auto-sized...
|
||||
Rectangle f = v.Frame;
|
||||
v._frame = new (v.Frame.X, v.Frame.Y, 0, 0);
|
||||
LayoutSubview (v, Viewport.Size);
|
||||
|
||||
if (v.Frame != f)
|
||||
{
|
||||
// The subviews changed; do it again
|
||||
v.LayoutNeeded = true;
|
||||
LayoutSubview (v, Viewport.Size);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LayoutSubview (v, Viewport.Size);
|
||||
}
|
||||
}
|
||||
|
||||
// If the 'to' is rooted to 'from' and the layoutstyle is Computed it's a special-case.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using static Terminal.Gui.SpinnerStyle;
|
||||
|
||||
namespace Terminal.Gui;
|
||||
|
||||
public partial class View
|
||||
@@ -171,6 +173,7 @@ public partial class View
|
||||
? Math.Max (HotKeySpecifier.GetColumns (), 0)
|
||||
: 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Frame dimensions required to fit <see cref="Text"/> within <see cref="Viewport"/> using the text
|
||||
/// <see cref="NavigationDirection"/> specified by the <see cref="TextFormatter"/> property and accounting for any
|
||||
@@ -251,11 +254,37 @@ public partial class View
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int w = Viewport.Size.Width + GetHotKeySpecifierLength ();
|
||||
|
||||
TextFormatter.Size = new (
|
||||
ContentSize.Width + GetHotKeySpecifierLength (),
|
||||
ContentSize.Height + GetHotKeySpecifierLength (false)
|
||||
);
|
||||
if (Width is Dim.DimAuto widthAuto && widthAuto._style != Dim.DimAutoStyle.Subviews)
|
||||
{
|
||||
if (Height is Dim.DimAuto)
|
||||
{
|
||||
// Both are auto.
|
||||
TextFormatter.Size = new Size (SuperView?.Viewport.Width ?? 0, SuperView?.Viewport.Height ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
TextFormatter.Size = new Size (SuperView?.Viewport.Width ?? 0, Viewport.Size.Height + GetHotKeySpecifierLength ());
|
||||
}
|
||||
|
||||
w = TextFormatter.FormatAndGetSize ().Width;
|
||||
}
|
||||
else
|
||||
{
|
||||
TextFormatter.Size = new Size (w, SuperView?.Viewport.Height ?? 0);
|
||||
}
|
||||
|
||||
int h = Viewport.Size.Height + GetHotKeySpecifierLength ();
|
||||
|
||||
if (Height is Dim.DimAuto heightAuto && heightAuto._style != Dim.DimAutoStyle.Subviews)
|
||||
{
|
||||
TextFormatter.NeedsFormat = true;
|
||||
h = TextFormatter.FormatAndGetSize ().Height;
|
||||
}
|
||||
|
||||
TextFormatter.Size = new Size (w, h);
|
||||
}
|
||||
|
||||
private bool IsValidAutoSize (out Size autoSize)
|
||||
|
||||
Reference in New Issue
Block a user