Closed tznind closed 2 months ago
200 failing tests
TestColorScheme_RoundTrip
unit test fails because ColorScheme
is initializing like this:
this.button = new Terminal.Gui.Button();
this.greyOnBlack = new Terminal.Gui.ColorScheme();
this.greyOnBlack.Normal = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black);
this.greyOnBlack.HotNormal = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black);
this.greyOnBlack.Focus = new Terminal.Gui.Attribute(Terminal.Gui.Color.Black, Terminal.Gui.Color.DarkGray);
this.greyOnBlack.HotFocus = new Terminal.Gui.Attribute(Terminal.Gui.Color.Black, Terminal.Gui.Color.DarkGray);
this.greyOnBlack.Disabled = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black);
And must be initialized like this:
this.button = new Terminal.Gui.Button();
this.greyOnBlack = new Terminal.Gui.ColorScheme()
{
Normal = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black),
HotNormal = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black),
Focus = new Terminal.Gui.Attribute(Terminal.Gui.Color.Black, Terminal.Gui.Color.DarkGray),
HotFocus = new Terminal.Gui.Attribute(Terminal.Gui.Color.Black, Terminal.Gui.Color.DarkGray),
Disabled = new Terminal.Gui.Attribute(Terminal.Gui.Color.DarkGray, Terminal.Gui.Color.Black)
};
We cannot use initializer lists in code gen because it is not supported. Need to add the constructor call instead.
@BDisp fixed ColorSchemeToCode, should now use the new constructor in https://github.com/gui-cs/TerminalGuiDesigner/pull/289/commits/03a28768f9a6c34e4045802721682533d3f62c2c
215 tests to go 😢
In the NullDim_ActsLikeAbsoluteZero
unit test change to this, because View.Dim is never null now
Assert.That( v.Width, Is.Not.Null, "As of v1.7.0 a new View started getting null for its Width, if this assert fails it means that behaviour was reverted and this test can be altered or suppressed" );
This did the trick.
var fSide = posView.GetType().GetField("<side>P", BindingFlags.NonPublic | BindingFlags.Instance) ?? throw new Exception("PosView was missing expected field 'side'");
var iSide = fSide.GetValue(posView)
See how I got the field name.
TabView
isn't copying the Tab.DisplayText
which now is a View
and is TabRow
subview.
Nice detective work on "<side>P"
. I think I will hold off on that for now though as I have raised https://github.com/gui-cs/Terminal.Gui/issues/3482 which will likely let us get rid of the reflection entirely in the pos/dim helpers.
Ok think I got all the DisplayText
bits fixed
You need also change from Text
to DisplayText
in the PasteOperations.cs
.
You'll need to create a Auto
item to the DimType
enum, otherwise it will assume the null for the Width
property. I don't know if it will have many changes when be merged.
You'll need to create a
Auto
item to theDimType
enum, otherwise it will assume the null for theWidth
property. I don't know if it will have many changes when be merged.
I was thinking about this and came to the conclusion that using DimType
and common functions is not the best option because Pos/Dim
is changing radically and with many references that are not common. I think the best way is to use Pos/Dim
itself in a switch block and manipulate the different calculations in the options, you can use some common functions but it is not possible in all cases.
Yes, I agree. Previously these were internal
classes and TGD did not have visibles attribute (hence the methods and enums).
Now it should be more possible to use is
and query properties on them.
But I think it will have to wait till that refactoring is done in https://github.com/gui-cs/Terminal.Gui/issues/3482.
Another problem I'm encountering is with resizing a view because on the sides and bottom, as long as there is a border, it will just move the view instead of resizing it. I think the TG should rethink this behavior. Movement should only be possible from the top and sides and at the bottom it should only allow resizing.
Movement should only be possible from the top and sides and at the bottom it should only allow resizing.
This is how it is supposed to work. Bottom right few cells are for resizing, the rest are for moving. This allows a 1xN view to be resized (regardless of whether or not it has a frame).
I think there is a bug in the mouse handling code of TGD. It worked before in v1 and v2 before all the mouse changes. Possibly in the migration to the new mouse API something is not translating positions correctly.
This is probably why all the mouse click and drag tests are now failing
I got some improvements but not enough :-)
Only 1 failing test now.
I think it might be around screen/local coordinates of views. I need to do more manual testing to understand any gaps. I especially need to test multiple nested views that are not at origin of parent view to ensure coordinates are all resolving correctly.
Other outstanding issues:
Updates Terminal.Gui v2 dependency to latest.