maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [question] Using "rotated" option in qml file... (https://talk.maemo.org/showthread.php?t=96890)

Schturman 2016-06-22 07:23

[question] Using "rotated" option in qml file...
 
Hi.
Maybe someone can explain me what the problem and why option "rotated" using only last parameter...
For example I wanted to use it in spacing block, like this:
Code:

Item {
    width: parent.width
    height: Screen.sizeCategory < Screen.Large ? Theme.paddingLarge*6 : (rotated ? Theme.paddingLarge*6 : Theme.paddingLarge*18)
    }

On my tablet it should use Theme.paddingLarge*6 in landscape and Theme.paddingLarge*18 in portrait mode. But for some reasons it use only Theme.paddingLarge*18 in both rotations...

Can someone explain me what the problem here?

The whole code is here: http://pastebin.com/YsyP6j6A
Thanks

Markkyboy 2016-06-23 13:13

Re: [question] Using "rotated" option in qml file...
 
Hey Schturman, I won't pretend to know quite what you're asking, but from playing with other files, I have noted that changing Large for Small where " < Screen.Large ? Theme.padding" is written has an effect. ...or maybe change to Screen.Medium instead of .Small........as you know, I tinker!, so above suggestions may not help at all!

Schturman 2016-06-23 13:35

Re: [question] Using "rotated" option in qml file...
 
Quote:

Originally Posted by Markkyboy (Post 1508237)
Hey Schturman, I won't pretend to know quite what you're asking, but from playing with other files, I have noted that changing Large for Small where " < Screen.Large ? Theme.padding" is written has an effect. ...or maybe change to Screen.Medium instead of .Small........as you know, I tinker!, so above suggestions may not help at all!

Hmm, I thought the tablet recognized as Screen.Large. Thanks for tip, I will try...

coderus 2016-06-23 13:37

Re: [question] Using "rotated" option in qml file...
 
use page.isPortrait instead. Lipstick.compositor is working only inside Lipstick compositor windows (homescreen) :)

Schturman 2016-06-23 13:59

Re: [question] Using "rotated" option in qml file...
 
Quote:

Originally Posted by coderus (Post 1508240)
use page.isPortrait instead. Lipstick.compositor is working only inside Lipstick compositor windows (homescreen) :)

Thanks for explanation Coderus, it should look like this ?:
Code:

Item {
    width: parent.width
    height: Screen.sizeCategory < Screen.Large ? Theme.paddingLarge*6 : (page.isPortrait ? Theme.paddingLarge*6 : Theme.paddingLarge*18)
    }


coderus 2016-06-23 14:11

Re: [question] Using "rotated" option in qml file...
 
seems so, try yourself and check :)

Schturman 2016-06-23 14:30

Re: [question] Using "rotated" option in qml file...
 
Quote:

Originally Posted by coderus (Post 1508243)
seems so, try yourself and check :)

Thanks, will do it. I'm not near pc now, will test it later and will report.

Schturman 2016-06-23 16:44

Re: [question] Using "rotated" option in qml file...
 
coderus, it work perfectly. I learned something new :)
Thank you very much.

coderus 2016-06-23 17:02

Re: [question] Using "rotated" option in qml file...
 
well, you can always start learning a normal way: https://sailfishos.org/develop/docs/...lica-all.html/

Schturman 2016-06-24 18:14

Re: [question] Using "rotated" option in qml file...
 
Quote:

Originally Posted by coderus (Post 1508251)
well, you can always start learning a normal way: https://sailfishos.org/develop/docs/...lica-all.html/

Coderus, I'm trying to do the same with column, when whole qml file is column, started with:
Code:

Column {
id: mycolumn

I'm tried to change page.isPortrait to mycolumn.isPortrait, but it not work... It use only last parameter (-Theme.paddingLarge), for example:
Code:

height: mycolumn.isPortrait ? Theme.paddingLarge*9 : -Theme.paddingLarge
Tried to read here about Page and Coumn (https://sailfishos.org/develop/docs/...lumnview.html/), but didn't found answer to my question.

Can you suggest something ?
Thanks


All times are GMT. The time now is 21:56.

vBulletin® Version 3.8.8