mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Rename IApplication.Current to TopRunnable
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -89,13 +89,13 @@ public class CanFocusTests
|
||||
public void CanFocus_Set_True_Get_AdvanceFocus_Works ()
|
||||
{
|
||||
IApplication app = Application.Create ();
|
||||
app.Current = new () { App = app };
|
||||
app.TopRunnable = new () { App = app };
|
||||
|
||||
Label label = new () { Text = "label" };
|
||||
View view = new () { Text = "view", CanFocus = true };
|
||||
app.Current.Add (label, view);
|
||||
app.TopRunnable.Add (label, view);
|
||||
|
||||
app.Current.SetFocus ();
|
||||
app.TopRunnable.SetFocus ();
|
||||
Assert.Equal (view, app.Navigation!.GetFocused ());
|
||||
Assert.False (label.CanFocus);
|
||||
Assert.False (label.HasFocus);
|
||||
@@ -125,7 +125,7 @@ public class CanFocusTests
|
||||
Assert.True (label.HasFocus);
|
||||
Assert.False (view.HasFocus);
|
||||
|
||||
app.Current.Dispose ();
|
||||
app.TopRunnable.Dispose ();
|
||||
app.ResetState ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
|
||||
}
|
||||
|
||||
Toplevel top = new ();
|
||||
Application.Current = top;
|
||||
Application.TopRunnable = top;
|
||||
|
||||
View otherView = new ()
|
||||
{
|
||||
@@ -117,7 +117,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
|
||||
}
|
||||
|
||||
Toplevel top = new ();
|
||||
Application.Current = top;
|
||||
Application.TopRunnable = top;
|
||||
|
||||
View otherView = new ()
|
||||
{
|
||||
@@ -148,8 +148,8 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
|
||||
// Ensure the view is Visible
|
||||
view.Visible = true;
|
||||
|
||||
Application.Current.SetFocus ();
|
||||
Assert.True (Application.Current!.HasFocus);
|
||||
Application.TopRunnable.SetFocus ();
|
||||
Assert.True (Application.TopRunnable!.HasFocus);
|
||||
Assert.True (top.HasFocus);
|
||||
|
||||
// Start with the focus on our test view
|
||||
@@ -280,7 +280,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
|
||||
|
||||
Toplevel top = new ();
|
||||
|
||||
Application.Current = top;
|
||||
Application.TopRunnable = top;
|
||||
|
||||
View otherView = new ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user