Clicking dialog outside of its content

Dear Community,
I have an issue with dialogs and its layout. basically I have Dialog that has fixed layout and piece of content assigned to it. On the piece of content there is a groupbox with dynamic size based on visible widgets.

The issue is with fewer widgets visible the groupbox gets smaller and it is not covering whole layout area. In runtime it causes the transparent area. If this area is clicked nothing happens even though user would expect dialog to be closed when click is outside of the boundary of the visible dialog.

For better explanation see the attached picture.
The blue area is the layout of the dialog.
Content of the dialog is the red area. The red area can get larger (expand down) if more widgets are visible.
What I want is to click outside of the red are but inside the blue area and let the dialog to be closed.
How to solve this?
I was thinking placing blank groupbox with a size of the whole layout but before I do this workaround I wanted to ask for more elegant solution.
Thank you

Hey Ondrej,

maybe you can add a (non visible through styling) button or other widget behind your groupBox.
Click event of non visible widget can be used to close dialog.

I did this in my visualization since I don’t know how to create dialogs with dynamic sizes.

Hopefully this is an option for you :slight_smile:
Simon

1 Like

Hello Simon,
thats my backup plan :smiley: I would like to use some cleaner solution if possible but I will end up doing the same.

Thanks for hint!
Ondrej

1 Like

:backhand_index_pointing_up: this is the way. A simple rectangle will do the job nicely!