mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 01:38:01 +01:00
* Fixes #4208. MainLoopSyncContext doesn't work with the v2 drivers * Fixes #3951. Add DimFuncWithView with a View dependency * Revert to iteration which will handle the necessary processes * Revert "Revert to iteration which will handle the necessary processes" This reverts commit50015ac6da. * Layout and draw before position cursor * Add optional View parameter and property to the DimFunc and PosFunc * Trying fix unit test error * Revert layout changes * Fixes #4216. Legacy drivers aren't refreshing the screen correctly on view drag * Add assertion proving NeedsLayout is always false before call OnSubViewsLaidOut * Fix unit test error * Increasing time to abort * Revert "Increasing time to abort" This reverts commitd7306e72f3. * Trying fix integration tests * Still trying fix integrations unit tests * Revert comment * Layout is performed during the iteration * Using Dim.Func with status bar view * Still trying fix integrations tests by locking _subviews * Still trying fix integrations tests by locking _subviews * Add internal SnapshotSubviews method * Remove lock from SnapshotSubviews method * Using SnapshotSubviews method in the DrawSubViews method * Remove lock from SnapshotSubviews method * Using SnapshotSubviews method in the DrawSubViews method * Using SnapshotSubviews * Prevent new app if the previous wasn't yet finished * Replace SnapshotSubviews method with ViewCollectionHelpers class * Lock entire GuiTestContext constructor * Using Snapshot in the ordered field * Fixes #4221 Extra modifiers f1 to f4 in v2net (#4220) * Assume we are running in a terminal that supports true color by default unless user explicitly forces 16 * Add support for extra modifiers for F1 to F4 keys * Revert "Assume we are running in a terminal that supports true color by default unless user explicitly forces 16" This reverts commit4cc2530de0. * Cleanup * Update comments * Code cleanup --------- Co-authored-by: Tig <tig@users.noreply.github.com> * Move ViewCollectionHelpers class to a separate file * Remove Border.Layout call in the DoDrawAdornmentsSubViews method. * Remove adornments layout call within the draw --------- Co-authored-by: Tig <tig@users.noreply.github.com> Co-authored-by: Thomas Nind <31306100+tznind@users.noreply.github.com>
This commit is contained in:
@@ -10,7 +10,7 @@ public class NeedsDrawTests
|
||||
View view = new () { Width = 0, Height = 0 };
|
||||
view.BeginInit ();
|
||||
view.EndInit ();
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsDraw);
|
||||
|
||||
//Assert.False (view.SubViewNeedsDraw);
|
||||
}
|
||||
@@ -70,14 +70,16 @@ public class NeedsDrawTests
|
||||
view.NeedsDraw = false;
|
||||
|
||||
view.BeginInit ();
|
||||
Assert.True (view.NeedsDraw); // Because layout is still needed
|
||||
Assert.False (view.NeedsDraw); // Because layout is still needed
|
||||
|
||||
view.Layout ();
|
||||
Assert.False (view.NeedsDraw);
|
||||
// NeedsDraw is true after layout and NeedsLayout is false if SubViewsLaidOut doesn't call SetNeedsLayout
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsLayout);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NeedsDraw_False_After_EndInit ()
|
||||
public void NeedsDraw_True_After_EndInit_Where_Call_Layout ()
|
||||
{
|
||||
var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single };
|
||||
Assert.True (view.NeedsDraw);
|
||||
@@ -96,7 +98,7 @@ public class NeedsDrawTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NeedsDraw_After_SetLayoutNeeded ()
|
||||
public void NeedsDraw_After_SetLayoutNeeded_And_Layout ()
|
||||
{
|
||||
var view = new View { Width = 2, Height = 2 };
|
||||
Assert.True (view.NeedsDraw);
|
||||
@@ -107,8 +109,12 @@ public class NeedsDrawTests
|
||||
Assert.False (view.NeedsLayout);
|
||||
|
||||
view.SetNeedsLayout ();
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsDraw);
|
||||
Assert.True (view.NeedsLayout);
|
||||
|
||||
view.Layout ();
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsLayout);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -121,21 +127,27 @@ public class NeedsDrawTests
|
||||
Assert.False (view.NeedsDraw);
|
||||
Assert.False (view.NeedsLayout);
|
||||
|
||||
// SRL won't change anything since the view is Absolute
|
||||
// SRL won't change anything since the view frame wasn't changed
|
||||
view.SetRelativeLayout (Application.Screen.Size);
|
||||
Assert.False (view.NeedsDraw);
|
||||
|
||||
view.SetNeedsLayout ();
|
||||
|
||||
// SRL won't change anything since the view is Absolute
|
||||
// SRL won't change anything since the view frame wasn't changed
|
||||
// SRL doesn't depend on NeedsLayout, but LayoutSubViews does
|
||||
view.SetRelativeLayout (Application.Screen.Size);
|
||||
Assert.False (view.NeedsDraw);
|
||||
Assert.True (view.NeedsLayout);
|
||||
|
||||
view.Layout ();
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsLayout);
|
||||
|
||||
view.NeedsDraw = false;
|
||||
|
||||
// SRL won't change anything since the view is Absolute. However, Layout has not been called
|
||||
// SRL won't change anything since the view frame wasn't changed. However, Layout has not been called
|
||||
view.SetRelativeLayout (new (10, 10));
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.False (view.NeedsDraw);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -149,17 +161,20 @@ public class NeedsDrawTests
|
||||
Width = Dim.Fill (),
|
||||
Height = Dim.Fill ()
|
||||
};
|
||||
Assert.True (superView.NeedsDraw);
|
||||
|
||||
// A layout wasn't called yet, so NeedsDraw is still empty
|
||||
Assert.False (superView.NeedsDraw);
|
||||
|
||||
superView.Add (view);
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.True (superView.NeedsDraw);
|
||||
// A layout wasn't called yet, so NeedsDraw is still empty
|
||||
Assert.False (view.NeedsDraw);
|
||||
Assert.False (superView.NeedsDraw);
|
||||
|
||||
superView.BeginInit ();
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.True (superView.NeedsDraw);
|
||||
Assert.False (view.NeedsDraw);
|
||||
Assert.False (superView.NeedsDraw);
|
||||
|
||||
superView.EndInit ();
|
||||
superView.EndInit (); // Call Layout
|
||||
Assert.True (view.NeedsDraw);
|
||||
Assert.True (superView.NeedsDraw);
|
||||
|
||||
@@ -177,9 +192,10 @@ public class NeedsDrawTests
|
||||
Width = Dim.Fill (),
|
||||
Height = Dim.Fill ()
|
||||
};
|
||||
Assert.True (superView.NeedsDraw);
|
||||
Assert.False (superView.NeedsDraw);
|
||||
|
||||
superView.Layout ();
|
||||
Assert.True (superView.NeedsDraw);
|
||||
|
||||
superView.NeedsDraw = false;
|
||||
superView.SetRelativeLayout (new (10, 10));
|
||||
|
||||
Reference in New Issue
Block a user