NodeGraphQt icon indicating copy to clipboard operation
NodeGraphQt copied to clipboard

Occupying the whole node area with a custom widget

Open EssenOH opened this issue 1 year ago • 2 comments

I am trying to place a custom widget occupying entire node area, but I got following result :

image

I'd like to make it such as following :

image

so, I have assigned input port without name, and didn't assign output port, but the custom node always keep some space from the input port as the picture.

EssenOH avatar Jun 08 '24 08:06 EssenOH

Likely related to #402

jack-mil avatar Jun 10 '24 13:06 jack-mil

What do you think about this change ?

    # width = port_width + max([text_w, port_text_width]) + side_padding
    # height = max([text_h, p_input_height, p_output_height, widget_height])
    # if widget_width:
    #     # add additional width for node widget.
    #     width += widget_width

    height = max([text_h, p_input_height, p_output_height, widget_height])
    if widget_width:
        # add additional width for node widget.
        if port_text_width:
            width = port_width + max([text_w, port_text_width]) + side_padding
            width += widget_width
        else:
            width = port_width + max([text_w, widget_width])
    else:
        width = port_width + max([text_w, port_text_width]) + side_padding

    if widget_height:
        # add bottom margin for node widget.
        height += 2.0
    height *= 1.05
    return width, height

image

Still, there is some space on left side, but it is much better than before.

EssenOH avatar Jun 15 '24 08:06 EssenOH