mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 00:46:39 +01:00
Simplify the Screen property in ApplicationImpl by removing the _screen field and its locking mechanism. The getter now directly retrieves the screen size from the Driver or defaults to 2048x2048. The setter now calls Driver?.SetScreenSize to update the screen size, eliminating the need for the ResetScreen method.
Update `RaiseScreenChangedEvent` to no longer explicitly set the `Screen` property. Remove unnecessary `.ToArray()` conversion in `View.Draw`. Clarify `Screen` property documentation in `IApplication` to specify constraints on location and size. Update tests to reflect the new behavior where setting the `Screen` property raises the `ScreenChanged` event. Rename and adjust test cases accordingly.
This commit is contained in:
@@ -383,7 +383,7 @@ public class IApplicationScreenChangedTests (ITestOutputHelper output)
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Screen_Property_Setting_Does_Not_Fire_ScreenChanged_Event ()
|
||||
public void Screen_Property_Setting_Raises_ScreenChanged_Event ()
|
||||
{
|
||||
// Arrange
|
||||
using IApplication app = Application.Create ();
|
||||
@@ -397,11 +397,10 @@ public class IApplicationScreenChangedTests (ITestOutputHelper output)
|
||||
|
||||
try
|
||||
{
|
||||
// Act - Manually set Screen property (not via driver resize)
|
||||
// Act - Manually set Screen property
|
||||
app.Screen = new (0, 0, 100, 50);
|
||||
|
||||
// Assert - Event should not fire for manual property setting
|
||||
Assert.False (eventFired);
|
||||
Assert.True (eventFired);
|
||||
Assert.Equal (new (0, 0, 100, 50), app.Screen);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user