[Lazarus] Package -> New Component ...

Juha Manninen juha.manninen62 at gmail.com
Fri Sep 28 13:25:18 CEST 2018


On Fri, Sep 28, 2018 at 12:34 PM Werner Pamler via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> Playing with the "New component" dialog a bit more I noticed that it is
> possible to select a 32x32 image although the 24x24 button has been
> pressed. My first thoughts were: Shouldn't the routine check for the
> image size? But maybe this is intentional - I don't even know how the
> component palette behaves when it gets a component with a non-standard
> sized icon.

AFAIK the icons are scaled then. It may depend on widgetset. At least
nothing crashes with a non-standard icon.
I would keep it now like it is. The size told in the label can be seen
as a recommendation. A user must be able to choose an icon with
different size if that is all he has.
Later we can tweak with errors and warnings about wrong sizes if needed.

> I don't know if this already happens, but the dialog should try to load
> the image and see if the file is not defective - otherwise the user
> might see unexpected errors after installation of the new component.

The image is loaded into the button glyph. Any defect should be visible then.
This can also be tweaked further later if needed.

> Another idea: the dialog should use the path to the previously selected
> image as InitialDirectory of the FileDialog because images of different
> sizes are usually stored in close vicinity of the folder hierarchy.
> Currently, the dialog switches back to the package directory, and I have
> to navigate to the images again.

I improved that, too.
Please test with r59176. It includes the button resize logic.
I plan to mark these 2 commits for merging to fixes_2.0. Maxim showed
green light for changing resource strings there.

Juha


More information about the Lazarus mailing list