nodeeditor icon indicating copy to clipboard operation
nodeeditor copied to clipboard

Comments

Open russelltg opened this issue 9 years ago • 11 comments

I think it would be nice to be able to comment on nodes, in two fashions:

  1. Directly on the node, something like this:
    image
  2. Or a box around a group of nodes like: image

Thoughts?

russelltg avatar Jan 02 '17 06:01 russelltg

Do you want do make this comments editable? Or like a tool-tip box?

paceholder avatar Jan 08 '17 18:01 paceholder

They should be editable, like comments in code.

Tooltips for what nodes do could be another feature too though...

russelltg avatar Jan 08 '17 19:01 russelltg

Maybe there could be a virtual function in NodeDataModel that gives HTML for documentation on hover. That would definitely be useful

russelltg avatar Jan 08 '17 19:01 russelltg

I think I can embed a comment QLabel under the node's caption. This would be of the zero size, if empty, and grow automatically as the user adds the text.

I also planned to make a grouping Node that would work as a container for several nodes. This should resolve the sketch in the second picture

paceholder avatar Jan 08 '17 19:01 paceholder

I can embed a comment QLabel

Would this be a description of the node type (set by NodeDataModel) or a comment for the user (set by the user)?

russelltg avatar Jan 08 '17 19:01 russelltg

I meant an editable comment field for the user.

I made the task #41 for tool-tips.

paceholder avatar Jan 08 '17 19:01 paceholder

I'll take this one on, you can asign me (I don't think i have permissions to)

russelltg avatar Mar 21 '17 16:03 russelltg

The way I'm thinking about implementing this is everything is normal, then when you hover over the node, some hint appears that you can enter a comment, something like this:

image

Then if you click on that ... then you can start entering a comment on that node. After you've added a comment, it is always visible.

API wise, I'm thinking two functions and a signal in NodeScene:

public:
    void setNodeComment(Node& n, QString comment);
    QString nodeComment(Node& n) const;

signals:
    void commentChanged(Node& n, QString newComment);

What do you think?

russelltg avatar Mar 22 '17 23:03 russelltg

Or maybe you could show some pencil icon on hover image

Although, I like the idea with the field above the node with ... (is it doable without too much manual painting?)

What is the purpose of putting comment-related functions to Scene? Can't we put them to nodes?

paceholder avatar Mar 23 '17 07:03 paceholder

Node isn't a part of the public API, I could make it a part though.

russelltg avatar Mar 23 '17 13:03 russelltg

As far as painting, I don't think it should be too much work, but I haven't done very much work with QPainter in the past, so I don't know. Seems pretty straightforward though.

russelltg avatar Mar 24 '17 03:03 russelltg