View Single 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: