mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
More prototyping 2
This commit is contained in:
@@ -514,7 +514,7 @@ public static partial class Application // Run (Begin, Run, End, Stop)
|
||||
{
|
||||
if (clear)
|
||||
{
|
||||
tl.SetNeedsDisplay();
|
||||
tl.SetNeedsDisplay(Screen);
|
||||
}
|
||||
tl.Draw ();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public partial class View // Drawing APIs
|
||||
|
||||
if (IsLayoutNeeded ())
|
||||
{
|
||||
Debug.WriteLine ($"Layout should be de-coupled from drawing: {this}");
|
||||
//Debug.WriteLine ($"Layout should be de-coupled from drawing: {this}");
|
||||
}
|
||||
|
||||
//// TODO: This ensures overlapped views are drawn correctly. However, this is inefficient.
|
||||
@@ -573,7 +573,7 @@ public partial class View // Drawing APIs
|
||||
{
|
||||
if (view.IsLayoutNeeded ())
|
||||
{
|
||||
Debug.WriteLine ($"Layout should be de-coupled from drawing: {view}");
|
||||
//Debug.WriteLine ($"Layout should be de-coupled from drawing: {view}");
|
||||
//view.LayoutSubviews ();
|
||||
}
|
||||
|
||||
|
||||
@@ -85,15 +85,7 @@ public partial class View // SuperView/SubView hierarchy management (SuperView,
|
||||
view.EndInit ();
|
||||
}
|
||||
|
||||
|
||||
SetLayoutNeeded();
|
||||
//CheckDimAuto ();
|
||||
// view.SetRelativeLayout(Application.Screen.Size);
|
||||
|
||||
//if (view.Visible)
|
||||
//{
|
||||
// SetNeedsDisplay();
|
||||
//};
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ public partial class View // Layout APIs
|
||||
SetTitleTextFormatterSize ();
|
||||
}
|
||||
|
||||
SetNeedsDisplay ();
|
||||
//SetNeedsDisplay ();
|
||||
SuperView?.SetNeedsDisplay ();
|
||||
}
|
||||
|
||||
@@ -821,6 +821,10 @@ public partial class View // Layout APIs
|
||||
if (!current.IsLayoutNeeded ())
|
||||
{
|
||||
current._layoutNeeded = true;
|
||||
current.Margin?.SetLayoutNeeded ();
|
||||
current.Border?.SetLayoutNeeded ();
|
||||
current.Padding?.SetLayoutNeeded ();
|
||||
|
||||
foreach (View subview in current.Subviews)
|
||||
{
|
||||
stack.Push (subview);
|
||||
|
||||
@@ -229,6 +229,7 @@ public partial class View : Responder, ISupportInitializeNotification
|
||||
// These calls were moved from BeginInit as they access Viewport which is indeterminate until EndInit is called.
|
||||
UpdateTextDirection (TextDirection);
|
||||
UpdateTextFormatterText ();
|
||||
|
||||
SetLayoutNeeded ();
|
||||
|
||||
if (_subviews is { })
|
||||
@@ -242,6 +243,9 @@ public partial class View : Responder, ISupportInitializeNotification
|
||||
}
|
||||
}
|
||||
|
||||
// TOOD: Figure out how to move this out of here and just depend on IsLayoutNeeded in Mainloop
|
||||
LayoutSubviews();
|
||||
|
||||
Initialized?.Invoke (this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ public class Bar : View, IOrientation, IDesignable
|
||||
{
|
||||
base.EndInit ();
|
||||
ColorScheme = Colors.ColorSchemes ["Menu"];
|
||||
LayoutBarItems (GetContentSize ());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -121,7 +120,7 @@ public class Bar : View, IOrientation, IDesignable
|
||||
/// <param name="newOrientation"></param>
|
||||
public void OnOrientationChanged (Orientation newOrientation)
|
||||
{
|
||||
SetLayoutNeeded ();
|
||||
LayoutBarItems (SuperView?.GetContentSize() ?? Application.Screen.Size);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -384,7 +384,6 @@ public class AllViewsTester : Scenario
|
||||
|
||||
_curView = view;
|
||||
_hostPane.Add (_curView);
|
||||
// Application.Refresh();
|
||||
}
|
||||
|
||||
private void DisposeCurrentView ()
|
||||
@@ -558,12 +557,12 @@ public class AllViewsTester : Scenario
|
||||
return;
|
||||
}
|
||||
|
||||
if (!view.Width!.Has<DimAuto> (out _) || (view.Width is null || view.Frame.Width == 0))
|
||||
if (!view.Width!.Has<DimAuto> (out _) || (view.Width is null))
|
||||
{
|
||||
view.Width = Dim.Fill ();
|
||||
}
|
||||
|
||||
if (!view.Height!.Has<DimAuto> (out _) || (view.Height is null || view.Frame.Height == 0))
|
||||
if (!view.Height!.Has<DimAuto> (out _) || (view.Height is null))
|
||||
{
|
||||
view.Height = Dim.Fill ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user