Resizable photo panel?

This topic has been viewed 4247 times and has 5 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
enkonyito
Posts: 607
Joined: Thu May 28, 2015 4:52 pm

Resizable photo panel?

Post by enkonyito »

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
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Resizable photo panel?

Post by Puybaret »

You can accept that the dialog box showing the photo panel is resizable by calling

Code: Select all

dialog.setResizable(true);
in [font=courier new]displayView[/font] method.
But of course, you main have to pay more attention to the layout of the panel...
Emmanuel Puybaret, Sweet Home 3D creator
enkonyito
Posts: 607
Joined: Thu May 28, 2015 4:52 pm

Re: Resizable photo panel?

Post by enkonyito »

You can accept that the dialog box showing the photo panel is resizable by calling

Code: Select all

dialog.setResizable(true);
in [font=courier new]displayView[/font] method.
That's what I meant by simple solution (manual resizing). [;)]
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
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Resizable photo panel?

Post by Puybaret »

setMinimumSize was added to [font=courier new]Window[/font] class in Java 6, but there's still no [font=courier new]setMaximumSize[/font] method [:(]

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 [font=courier new]dialog.setResizable(true)[/font]. I checked in [font=courier new]PhotoPanel[/font] 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
enkonyito
Posts: 607
Joined: Thu May 28, 2015 4:52 pm

Re: Resizable photo panel?

Post by enkonyito »

I followed your advice by changing the layout of the components under the image preview.

with dummy label at left and right
Image

without dummy label at left and right
Image

Which one is best?
EnkoNyito
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Resizable photo panel?

Post by hansmex »

Top version is best 😀
Hans

new website - under constuction
hansdirkse.info
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest