-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #224. Border BorderBrush and Background causes compiler error when his value is -1. #225
Conversation
A better option is to show all the public read/write properties of the derived class to allow the user set anything. |
Thanks for creating this. I will take a closer look at it shortly. I think though that we want to make changes in If I understand the new Terminal.Gui syntax correctly:
So I think the correct behaviour is:
This I think is more consistent than the if statements and custom methods? I can make this change and see what happens. I notice that in the current implementation of this PR the FrameView now has Black on Green for border explicitly (different from
In the interests of stability I have taken an approach of manually adding each property as designable so that it can be tested thouroughly before released. The problem with reflection is new stuff can creep in untested and result in unstable/wrong behaviour of editor. |
I've created a feature branch for this where I will look at alternative approach. Here is a draft PR to easily see the diff in approach: |
Also worth noting that I have disabled Borders completely in the |
With this new change when you add a BUT when you reload it it shows green and black and it's Color properties are 0. I will try to reduce this to minimum repro and see if it is an issue with Terminal.Gui itself. The code generated looks fine.
|
Border doesn't not exist on v2, now it's Frame. I recommend you maintaining the two versions for users that still want use the v1 and for the one who want to use the v2. |
I don't have any wrong behavior with the generated code. And using the [Test]
public void TestRoundTrip_BorderColors_NeverSet()
{
var result = RoundTrip<Window, FrameView>((d, v) =>
{
// Our view should not have any border color to start with
Assert.AreEqual(-1,(int) v.Border.BorderBrush);
Assert.AreEqual(-1,(int) v.Border.Background);
},out FrameView o);
// Since there were no changes we would expect them to stay the same
// after reload
Assert.AreEqual(-1, (int)o.Border.BorderBrush);
Assert.AreEqual(-1, (int)o.Border.Background);
} |
See #227 please. Thanks. |
Any time I move a FrameView or Window the border changes to black. While ff1f6f8f4fbf849a22a4e364fc3845dc3ba42bd4 makes the test pass, it doesn't fix the issue in the editor (See above). Also it feels very much like a workaround. I think the issue could be with Terminal.Gui itself:
I will dig some more around bullet point 2 when I have some time but at the moment Border seems to be too unstable to merge. |
Yes I already stated that in the #227.
Yes, it was 😞
Well, you know that wasn't me who decided to invent a nonexistent
Normally a
I agree with you about the around with bullet 2 and I also will try discover a better fix for that in the core library. |
If you use with the |
@tznind can you provide a unit test where a Edit: |
Can confirm that
Can confirm that copy/paste results in a black border. However saving and reloading does not persist it. I will look into writing a unit test asap. I wonder if setting the property to -1 at runtime causes the behaviour. |
I already submit the PR gui-cs/Terminal.Gui#2835 that fix this issue. The unit tests will fail without the fix. |
Is gui-cs/Terminal.Gui#2835 in 1.14.0? Even with v1.14 I am getting test failures with this branch. And dragging a FrameView changes its border to black/green. |
In this PR all tests passed and not having |
Also updated to net7.0. Now the unit tests pass.
Now is possible to set the
Border.BorderBrush
and theBorder.Background
.border.mp4