[Lazarus] Package -> New Component ...

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
Hello

I improved the New Component feature and its GUI in r59170.
Now it accepts 3 icons for different resolutions. The higher
resolution icons will be picked automatically if their file names have
'_150' and '_200' suffix. They can be selected manually, too.
Parts of the GUI were dummy. For example it allowed a user to change a
unit's filename but then complained if he did so. Now a generated file
name is shown in a label. The directory for a unit file can still be
selected.
There are other minor improvements although more would be needed I guess.
Please check out.

The resource type generated is still the old Lazarus Recourse (.lrs).
The next step is to generate the FPC's Delphi compatible resource
(.res).

I try to hurry this up because a new book about Lazarus will have a
chapter about this New Component feature and the old dialog was badly
outdated. The HighDPI support with multi-resolution icons is a major
new feature in Lazarus / LCL after all.
I would like to push this improvement to the 2.0 branch although it
touches the IDE's resource strings and thus breaks the basic rule of
letting translators do their job in peace after a release branch is
forked.
What do you think?

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
26.09.2018 21:08, Juha Manninen via Lazarus пишет:
> I try to hurry this up because a new book about Lazarus will have a
> chapter about this New Component feature and the old dialog was badly
> outdated. The HighDPI support with multi-resolution icons is a major
> new feature in Lazarus / LCL after all.

Hurrying and rushing features at the last moment is never good. Chances
are the dialog will have regressions and it may turn out that further
significant rework will be needed.

> I would like to push this improvement to the 2.0 branch although it
> touches the IDE's resource strings and thus breaks the basic rule of
> letting translators do their job in peace after a release branch is
> forked.
> What do you think?

Changes are quite minimal, so I don't see any major problem from this side.

--
Best regards,
  Maxim Ganetsky                  mailto:[hidden email]
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
On Thu, Sep 27, 2018 at 2:13 AM Maxim Ganetsky via Lazarus
<[hidden email]> wrote:
> Hurrying and rushing features at the last moment is never good. Chances
> are the dialog will have regressions and it may turn out that further
> significant rework will be needed.

In general that is true. However my changes were quite moderate in complexity.
The code does not switch to the new resource type but still uses the old .lrs.
It does not change the way of selecting ancestor type which will need
improvements later.
The changes for GUI fixed some clear usability bugs.
I tested the multi-icon feature thoroughly but only with Linux + KDE
so far. Windows people, please test and give feedback.

> Changes are quite minimal, so I don't see any major problem from this side.

In that case I would say it is safe to merge after getting some
feedback from testers.

BTW, the new book does not need to explain which resource type is used
when intruducing this feature and dialog.
We can "quietly" update for the new .res type later, maybe in Lazarus 2.0.2.

Regards,
Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Once all images are loaded into the dialog the 32x32 and 48x48 images
are truncated because the three buttons have the same size. Wouldn't it
be better to adapt the size of the buttons to the size of the images, or
make the buttons as large as the largest image so that truncating is
avoided?

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
On Thu, Sep 27, 2018 at 3:19 PM Werner Pamler via Lazarus
<[hidden email]> wrote:
> Once all images are loaded into the dialog the 32x32 and 48x48 images
> are truncated because the three buttons have the same size. Wouldn't it
> be better to adapt the size of the buttons to the size of the images, or
> make the buttons as large as the largest image so that truncating is
> avoided?

Yes. I will look at this.

Do the icons work OK in component palette after a component got installed?

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
Am 27.09.2018 um 17:10 schrieb Juha Manninen via Lazarus:
> Do the icons work OK in component palette after a component got installed?

Yes, I tested on a VM with 150% resolution, and the icon of the newly
created test component looked as crisp as the others.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
One more issue: Are the labels 'Icon 24x24:', 'Icon 36x36:' and 'Icon
48x48:' good or should they mention the percentages 150% and 200%?

I have the resizable button code ready and will comit it soon.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
Am 28.09.2018 um 09:07 schrieb Juha Manninen via Lazarus:
> One more issue: Are the labels 'Icon 24x24:', 'Icon 36x36:' and 'Icon
> 48x48:' good or should they mention the percentages 150% and 200%?

I'd keep it like this. 48x48 is clear to everybody, 200% maybe not. And
it also makes clear that the standard palette icon size is 24x24, not
16x16.

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.

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.

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.

Werner
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
On Fri, Sep 28, 2018 at 12:34 PM Werner Pamler via Lazarus
<[hidden email]> 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
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Package -> New Component ...

Free Pascal - Lazarus mailing list
One clarification: The InitialDirectory for selecting images is set
when the unit directory changes. Usually it is the package directory.
When an icon is selected from another directory, the code relies on OS
/ widgetset to remember the new path and use it next time the dialog
opens. It works with GTK2 and QT. Does it work the same way with all
widgetsets, I am not sure.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus