[Lazarus] Scaling of menuitem icons

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

[Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
Hi

When higher DPI setting is used on Windows, Lazarus IDE appears to obey nicely.
All icons are also scaled, together with texts.

On my Linux + KDE system however icons of the IDE's main menuitems do not scale.
In KDE settings panel -> Fonts I set the "Force font's DPI" value to
144 which is about 150%.
Then I start lazarus and everything is scaled including menu texts but
not the icons beside them. Icons everywhere else like in the IDE
Coolbar and component palette are scaled. Editor toolbar also has
scaled icons and the exact same icons show smaller in the main menu.
This happens with both GTK2 and QT bindings.
Could somebody please test with other desktop / window manager systems.
Who knows the High DPI code well enough to fix the issue?

I wanted to take a screenshot but the IDE's menus always close when
Spectacle (screeshot app) takes it. This is another bug somewhere.
Menus of well behaving KDE apps, for example Kate's, do not close.

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

Re: [Lazarus] Scaling of menuitem icons

vojtech.cihak

It seems the same here (KDE and Lazarus Qt4). I was able to take screenshot with Spectacle (rectangular area).

 

V.

______________________________________________________________
> Od: "Juha Manninen via Lazarus" <[hidden email]>
> Komu: "Lazarus mailing list" <[hidden email]>
> Datum: 13.10.2018 22:09
> Předmět: [Lazarus] Scaling of menuitem icons
>

Hi

When higher DPI setting is used on Windows, Lazarus IDE appears to obey nicely.
All icons are also scaled, together with texts.

On my Linux + KDE system however icons of the IDE's main menuitems do not scale.
In KDE settings panel -> Fonts I set the "Force font's DPI" value to
144 which is about 150%.
Then I start lazarus and everything is scaled including menu texts but
not the icons beside them. Icons everywhere else like in the IDE
Coolbar and component palette are scaled. Editor toolbar also has
scaled icons and the exact same icons show smaller in the main menu.
This happens with both GTK2 and QT bindings.
Could somebody please test with other desktop / window manager systems.
Who knows the High DPI code well enough to fix the issue?

I wanted to take a screenshot but the IDE's menus always close when
Spectacle (screeshot app) takes it. This is another bug somewhere.
Menus of well behaving KDE apps, for example Kate's, do not close.

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

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

menu144dpi.png (85K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Saturday 13 October 2018 22:08:59 Juha Manninen via Lazarus wrote:
>
> I wanted to take a screenshot but the IDE's menus always close when
> Spectacle (screeshot app) takes it.

Do you use a delay?
https://userbase.kde.org/Spectacle#Screenshot_delay

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

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
On Sun, Oct 14, 2018 at 10:10 AM Martin Schreiber via Lazarus
<[hidden email]> wrote:
> Do you use a delay?
> https://userbase.kde.org/Spectacle#Screenshot_delay

Yes I did. I tried all variations including the rectangular area that
Vojtěch Čihák used.
Strangely enough, I remember I could include menus in a screenshot
earlier. Something has changed maybe in the libs provided by Manjaro.
Who knows...
I will test again some time later.

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

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
 >  On my Linux + KDE system however icons of the IDE's main menuitems
do not scale.
 > In KDE settings panel -> Fonts I set the "Force font's DPI" value to
144 which is about 150%.

I remember I worked on it:

1.) Gtk2: I added support for Gtk2. See screenshot. It works well for me
if I use "xrandr --dpi 144x144" as it is suggested in
http://wiki.lazarus.freepascal.org/High_DPI

Your settings revealed a bug in Gtk2 bindings. Patch is attached.

2.) Qt: I wasn't able to add support of high-resolution icons in menus
under Qt. My conclusion was that either Qt itself or LCL-Qt bindings do
not support big icons in menus. When I used the correct size icon in the
menu it was always (badly) downscaled to 16x16 pixels.


Greetings
Ondrej


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

gtk2-logpixels.patch (743 bytes) Download Attachment
Laz-Gtk2.png (55K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
On 10/19/2018 10:15 AM, Ondrej Pokorny via Lazarus wrote:

>  >  On my Linux + KDE system however icons of the IDE's main menuitems
> do not scale.
>  > In KDE settings panel -> Fonts I set the "Force font's DPI" value to
> 144 which is about 150%.
>
> I remember I worked on it:
>
> 1.) Gtk2: I added support for Gtk2. See screenshot. It works well for me
> if I use "xrandr --dpi 144x144" as it is suggested in
> http://wiki.lazarus.freepascal.org/High_DPI
>
> Your settings revealed a bug in Gtk2 bindings. Patch is attached.
>
> 2.) Qt: I wasn't able to add support of high-resolution icons in menus
> under Qt. My conclusion was that either Qt itself or LCL-Qt bindings do
> not support big icons in menus. When I used the correct size icon in the
> menu it was always (badly) downscaled to 16x16 pixels.

Probably the only solution is to use QProxyStyle class.
There's no QProxyStyle class in Qt4/Qt5 C bindings and to fix this
problem it should be implemented with it's overrides.
QProxyStyle can return any size for PM_SmallIconSize, but in that case
we should know what's the current size of "normal" icons in LCL.

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

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
On 19.10.2018 11:43, zeljko wrote:
> QProxyStyle can return any size for PM_SmallIconSize, but in that case
> we should know what's the current size of "normal" icons in LCL.

The current size of "normal" icons in LCL is perfectly known, as well as
the size of any menu icon in LCL. Call the TMenuItem.GetIconSize
function to get it.

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

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
On 10/19/2018 11:46 AM, Ondrej Pokorny wrote:
> On 19.10.2018 11:43, zeljko wrote:
>> QProxyStyle can return any size for PM_SmallIconSize, but in that case
>> we should know what's the current size of "normal" icons in LCL.
>
> The current size of "normal" icons in LCL is perfectly known, as well as
> the size of any menu icon in LCL. Call the TMenuItem.GetIconSize
> function to get it.

Tnx

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

Re: [Lazarus] Scaling of menuitem icons

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, Oct 19, 2018 at 11:16 AM Ondrej Pokorny via Lazarus
<[hidden email]> wrote:
> Your settings revealed a bug in Gtk2 bindings. Patch is attached.

Applied in r59325. It works now with GTK2. Very nice, thanks!

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