High DPI issues

Sebastian Kügler sebas at kde.org
Mon May 26 15:06:12 UTC 2014


On Monday, May 26, 2014 16:55:42 Teo Mrnjavac wrote:
> > Now, the most important difference to the approach I've seen in Qt, is
> > that
> > this is a QML binding in our case instead of a scaling factor which you
> > inject in the rendering engine. This means, we can change those not only
> > on
> > runtime, but have different settings for different parts of an
> > application.
> > Think of an application with 2 windows, one on your old school monitor,
> > the
> > other on your retina screen. We could adjust those depending on which
> > screen you're running, even inside the same application.
> >
> > 
> >
> > The official docs for this can be found here:
> > http://developer.ubuntu.com/api/devel/ubuntu-12.04/qml/ui-toolkit/resoluti
> > on -independence.html

Note that they actually got this wrong: They're not using a binding but an 
invokable, meaning that gridUnit changes aren't propagated automatically, but 
need to be triggered for re-evaluation. This looks like an API problem to me, 
so it's not easily fixable for them (without changing the API).

We've introduced gridUnits in Plasma as well, and are using them throughout. 
The difference with Ubuntu's implementations are:

- They're notifiable properties in Plasma. so you'd write units.gridUnit * 2, 
  not units.gridUnit(2), that's the fix for the above problem.

- gridUnit depends on the fontsize-as-rendered in Plasma, not an arbitrary 
  scaling factor (Michael isn't clear on where they get this factor from)

Bottom line is that the Ubuntu gridUnits stuff can very easily be ported (both 
ways), but Plasma's mechanism is at a higher level.

Cheers,
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list