Print at Dec 21, 2025, 7:10:29 PM View all posts in this thread on one page
Posted by enkonyito at Feb 19, 2018, 3:55:31 AM
Resizable photo panel?
In this thread , it is discussed the possibility of changing the size of the photo panel.

The simple solution to make it resizable involves other consequences:
- deformation without respect of the ratio
- maximum size limit not taken into account
- truncated text when changing language

The solution to include this size change in user preferences does not seem possible from a plug-in.

Is it possible to change the size of the photo panel as needed?
----------------------------------------
EnkoNyito

Posted by Puybaret at Feb 21, 2018, 8:53:11 AM
Re: Resizable photo panel?
You can accept that the dialog box showing the photo panel is resizable by calling
dialog.setResizable(true);
in displayView method.
But of course, you main have to pay more attention to the layout of the panel...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by enkonyito at Feb 22, 2018, 1:13:13 AM
Re: Resizable photo panel?
You can accept that the dialog box showing the photo panel is resizable by calling
dialog.setResizable(true);
in displayView method.
That's what I meant by simple solution (manual resizing). wink

But of course, you main have to pay more attention to the layout of the panel...
I noticed that there is a minimum size depending on LookAndFeel and language chosen.


On the other hand, is it normal that the maximum size is not taken into account when resizing?

Can you confirm that it is not possible to add a new user preference from a plug-in?

From your experience, what do you think of the option suggested by ndorigatti which is to add a button to change the size of the panel?
----------------------------------------
EnkoNyito

Posted by Puybaret at Feb 22, 2018, 2:19:27 PM
Re: Resizable photo panel?
setMinimumSize was added to Window class in Java 6, but there's still no setMaximumSize method sad

There's no API in UserPreferences class to manage additional preferences, and nothing in the user interface for that. At the moment, this can be done only by subclassing this class in a derived version of Sweet Home 3D.

Managing the size of the panel isn't difficult, just call dialog.setResizable(true). I checked in PhotoPanel class and the photo component at the top will be enlarged accordingly. But the space at the left and right of the components at the bottom may look uselessly large if you don't manage their layout differently. It's probably the reason why I didn't make the dialog resizable.
An other option could be to add some zoom -/+ buttons to view details in the photo component, like in the background image import wizard.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by enkonyito at Feb 24, 2018, 4:10:46 AM
Re: Resizable photo panel?
I followed your advice by changing the layout of the components under the image preview.

with dummy label at left and right


without dummy label at left and right


Which one is best?
----------------------------------------
EnkoNyito

Posted by hansmex at Feb 24, 2018, 4:14:52 AM
Re: Resizable photo panel?
Top version is best 😀
----------------------------------------
Hans

new website - under constuction
hansdirkse.info