[Gambas-user] Global GUI-Scale ? (Control-size & -Pos varies in different HW)

Benoît Minisini g4mba5 at gmail.com
Wed Sep 5 20:35:18 CEST 2018


Le 05/09/2018 à 20:24, ub2 at gmx.ch a écrit :
> 
> Dear Gambas cracks
> 
> 
> Already struggling quite a while in vain with code, preferences and in
> the internet, I'd like to ask for some good ideas here.
> 
> 
> I'm using Gambas programs on different Hardware:
> HW-1) on a Notebook with ext. Monitor:
> 	Gambas=3.11.4,
> 	Distribution=Ubuntu 16.04.5 LTS,
> 	Desktop=XFCE
> 	Resolution:1920x1080 + 1920x1200
> HW-2) on a Raspberry 3B with an ext. Monitor:
> 	Gambas=3.9.1,
> 	Distribution=debian 9.4,
> 	Desktop=LXDE
> 	Resolution:1680x1050
> HW-3) on a Nexus4 with UBPorts, OTA-4, Libertine
> 	... in work
> 
> 
> What I do not understand:
> - Why are Gambas-forms not shown similar* on both platforms?
> 	... not even in the IDE's?
> 
> *Control-position and size with the same amount of Pixels
> 	(see also attached Screenshots)
> 
> 
> What I'm hoping to find:
> - Is there a kind of "Global GUI-Scale" in Gambas available?
> - Would that allow to scale "GUIs" in a simple manner to different
> Hardware-resolutions ? 	
> (eg: Notebook, Pi-Display, Pi-extMon, Smartphone, ...?)
> 
> 
> Any help (Ideas, links, keywords, ...) would be very appreciated.
> 
> 
> For "Demo-GUI with 2 Controls" and further System-Details see attached
> program. 	(GlobalGuiScale_180905a_Forum.tar.gz)
> 
> 
> Thanks for your help.
> (... and for Gambas!)
> 
> 
> ub2
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 

The GUI defined from the form editor scales proportionnaly to the 
default font height (the scale is the Desktop.Scale property).

The idea behind is that the user usally choose a default font size 
according to its screen and the resolution of that screen.

If the default font height on two different systems have the same height 
in pixels, then the dimensions of the controls will be the same in 
pixels too.

If you don't want a form to follow that behaviour, use the 'Scaled' IDE 
property (it is not a real property actually).

I strongly discourage using that property! Otherwise your GUI won't 
adapt to the font used by the user of your application.

Regards,

-- 
Benoît Minisini


More information about the User mailing list