Active Topics

 


Reply
Thread Tools
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#111
i dont know a way to do this in pure qml without c++ code
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Posts: 301 | Thanked: 531 times | Joined on Aug 2010 @ The Netherlands
#112
Alright. Well, I looked at c++ and didn't know how to implement it. So I just leave it for now.

Another question then. The first page looks awful in Landscape. It seems the height is still as high as in Portrait. One level deeper is normal behavior, but one level deeper it is also strange.

First page is here: https://github.com/cow-n-berg/harbou...CachesPage.qml

I think I don't mess around with any height, only for the ListItem. How can it happen?
Attached Images
  
__________________
Palm Treo -> N900 -> N9 -> Jolla -> SailfishX -> XA2
Developer mode novice, and enjoying it
 

The Following User Says Thank You to rob_kouw For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#113
Originally Posted by rob_kouw View Post
Alright. Well, I looked at c++ and didn't know how to implement it. So I just leave it for now.

First page is here: https://github.com/cow-n-berg/harbou...CachesPage.qml

I think I don't mess around with any height, only for the ListItem. How can it happen?
I note from your CachesPage.qml you have set allowedOrientations to Portrait only, perhaps to add Landscape also. I'm not sure if this will fix the problem, but it can't be helping.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Posts: 301 | Thanked: 531 times | Joined on Aug 2010 @ The Netherlands
#114
Originally Posted by Markkyboy View Post
I note from your CachesPage.qml you have set allowedOrientations to Portrait only, perhaps to add Landscape also. I'm not sure if this will fix the problem, but it can't be helping.
Thanks for helping! Right, I decided to limit this CachesPage to Portrait, after I wrote the question above. Apologies for the miscommunication.
__________________
Palm Treo -> N900 -> N9 -> Jolla -> SailfishX -> XA2
Developer mode novice, and enjoying it
 

The Following User Says Thank You to rob_kouw For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#115
I have a similar problem with landscape with regard to positioning items.

This is editing directly on the device not in SDK, where I know Lipstick is not allowed.

A few years back, we could do the following for rotating items when in landscape;

HTML Code:
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Lipstick 1.0 <----- import Lipstick
import "weather.js" as WeatherData

Grid {
    id: labels

    property bool rotated: {    <----add this
        Lipstick.compositor.topmostWindowOrientation &
        (Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation)
    }

    rows: 2
    columns: 2

    // rotated ? landscape : portrait
    rowSpacing: rotated ? 270 : 580    < -----and adjust this with the 'rotated' property
    columnSpacing: rotated ? 500 : 170

    anchors.centerIn: parent
The above is just a snippet to show the added code which used to work in nearly any file, but now it is not working. I get the following error;

Code:
[W] unknown:10 - file:///usr/share/wind-dash/qml/pages/Labels.qml:10: ReferenceError: Lipstick is not defined
Has something changed?, how can I work around this?, I would like my grid of labels to change position when the app is viewed in landscape.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#116
you want rotation but dont want to rotate page? use rotation sensor.
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#117
Originally Posted by coderus View Post
you want rotation but don't want to rotate page? use rotation sensor.
are you replying to me coderus?
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#118
correct [10 chars]
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#119
Originally Posted by coderus View Post
correct [10 chars]
then you totally misunderstand my question. I did not include any information about page rotation as my app already rotates to landscape.

The problem is, my row and column spacings are not changing position when turned to landscape. The code I posted previously allowed me to do just that, now it does not work.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#120
Okay,

I've found another way to achieve my goal.

I took a good look in `/usr/lib/qt5/qml/Sailfish/Lipstick` and found some code pertaining to rotation/rotating items; `isLandscape` does the job, so the code now looks like this;

Code:
import QtQuick 2.0
import Sailfish.Silica 1.0
import "weather.js" as WeatherData

Grid {
    id: labels
    rows: 2
    columns: 2

    rowSpacing: isLandscape ? 270 : 580
    columnSpacing: isLandscape ? 500 : 170

    anchors.centerIn: parent
No need for import statements or additional properties, time to tidy up other aspects of this 'wind dashboard'.
Attached Images
  
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..

Last edited by Markkyboy; 2020-09-02 at 16:21.
 

The Following 3 Users Say Thank You to Markkyboy For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 09:15.