Skip to content
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

Unused node space in nodes with no output fields #54

Open
leissler opened this issue Dec 16, 2021 · 4 comments
Open

Unused node space in nodes with no output fields #54

leissler opened this issue Dec 16, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@leissler
Copy link

In typical nodes, like the ones in the examples, which have only input fields but no output fields, these input fields occupy less horizontal space than the editable fields below. This leads to a grey unused area on the right side of a node.
It is of course debatable if this looks good or ugly, but the fact is that this space could be used to make the input fields in an input-only node larger and make use of this space.

@leissler leissler added the bug Something isn't working label Dec 16, 2021
@leissler
Copy link
Author

Alright, I fixed this myself for the Executable Graph example.
Here's what I did:

In NodeView.cs in the ReloadPorts() method I added at the end:

        EnableInClassList("hasOnlyExecInput", Inputs.Count == 1);
        EnableInClassList("hasOnlyExecOutput", Outputs.Count == 1);

Then in ExecutableNodeView.uss I just added:

.hasOnlyExecInput.hasOnlyExecOutput #top {
height:0px;
}

I think that was already it (though I'm not 100% sure that I didn't change anything else).

BTW: I fixed another bug, where you couldn't drag nodes that were in the area of the Graph Window with the text label at the lower edge. You need to add the following line in the CanvasView constructor before you add the title label:

        title.pickingMode = PickingMode.Ignore;

Hope you can include it in one of the next releases.

@leissler
Copy link
Author

Ok, I solved it a bit cleaner, I guess:
I put the lines
EnableInClassList("hasOnlyExecInput", Inputs.Count == 1);
EnableInClassList("hasOnlyExecOutput", Outputs.Count == 1);
into ExecutableNodeView.OnInitialize() method, because it belongs into the that type of graph/nodes.
Still had to change CanvasView constructor.

@McManning
Copy link
Owner

I think this is a good change. Would you like to make a pull request for your suggestions / fixes, or would you prefer I just patch it?

@leissler
Copy link
Author

leissler commented Jan 2, 2022

I think these few lines are so small fixes that it's hardly worth a pull request.
Maybe you can just add them in some future commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants