using device targets in qml plasmoids

Aaron J. Seigo aseigo at kde.org
Wed Oct 24 14:36:35 UTC 2012


On Wednesday, October 24, 2012 16:09:23 Sebastian Kügler wrote:
> By the way, something notmart and I discussed a few days ago ... it would be
> handy if we had the input method ("touch", ...) accessible from the QML

another approach would be to put your touch specific bits into javascript files 
that are included from the QML to provide the missing functionality.

so, for instance, for SLC it might have a contents/code/platform.js and a 
touch/code/platform.js file that looks like:

function iconSpacing() { return /* some value */ }

or it could even just declare some global variable(s):

var iconSpacing = <some default>
import platform.js

and platform.js would do:

iconSpacing = <some other value>

(or some such thing .. haven't tested either of the above with actual code, 
but they ought to both work :)

the nice thing about this approach is that we have just the one concept: 
target-based file loading.

of course, this won't work well if the differences are large and not just 
simple changes to property values.

it would be helpful to gather some real world use cases (like the SLC one) to 
see if this will actually cover our needs. seems you've run into some already?

-- 
Aaron J. Seigo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20121024/6a2092dd/attachment.sig>


More information about the Plasma-devel mailing list