Review Request 126349: Add screenPixelRatio(int screen) to desktop scripting API

Sebastian Kügler sebas at kde.org
Mon Dec 14 22:00:22 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126349/#review89500
-----------------------------------------------------------


The idea is that gridUnit looks at the current screen "the code is called from", and then serves the right gridUnit value, so the value changes, for example when the app or plasmoid moves to another screen. I'm not sure that'll work in the scripting API, since that is not bound to a certain screen.

Still, I'd prefer using gridUnit, so I'd much rather expose that, than adding another function with slightly different semantics here.

Also, calling it screenPixelRatio here and devicePixelRatio elsewhere makes it quite inconsistent.

Furthermore, I'm reluctant about an API addition in the stable branch.

- Sebastian Kügler


On Dec. 14, 2015, 6 p.m., Eike Hein wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126349/
> -----------------------------------------------------------
> 
> (Updated Dec. 14, 2015, 6 p.m.)
> 
> 
> Review request for Plasma and David Edmundson.
> 
> 
> Repository: plasma-workspace
> 
> 
> Description
> -------
> 
> This adds a global function qreal screenPixelRatio(int screen) to the desktop scripting API to complement screenGeometry(). Since we don't do per-screen scaling in Plasma currently the implementation ignores the argument. It's otherwise matching Units::devicePixelRatio.
> 
> If this becomes available, I can use it in the default panel layout script to scale the default panel thickness, which is currently unscaled - i.e. when Plasma scales up on a hi-dpi screen the panel will be initialized to be tiny anyway, which is a pretty egregrious papercut on hidpi systems.
> 
> 
> Diffs
> -----
> 
>   shell/scripting/appinterface.h 93aa014 
>   shell/scripting/appinterface.cpp 2c54f1e 
> 
> Diff: https://git.reviewboard.kde.org/r/126349/diff/
> 
> 
> Testing
> -------
> 
> Adjusted layout script, determined it works nicely.
> 
> 
> Thanks,
> 
> Eike Hein
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151214/95795868/attachment.html>


More information about the Plasma-devel mailing list