Orientation lock toggle context menu

orientation toggle in the top menu should have a context menu with choices for landscape/portrait/dynamic, like in the Settings=>Display page.

a long-press dropdown would be easier than orienting the phone sideways and then pulling down the menu and locking it and orienting it back. (when e.g.: looking at an image with wrong exif orientation in a gallery app)

its ESPECIALLY useful for me as a bug workaround. sometimes the orientation sensor stops working on my phone and i need to go to the settings page to get landscape. restarting sensord (or restarting the phone) fixes it, but sometimes i dont realize its happening until i am about to show someone a landscape photo.

of course, this is easy enough to add myself:
/usr/share/jolla-settings/pages/display/OrientationLock.qml

import QtQuick 2.0
import Sailfish.Silica 1.0
import com.jolla.settings 1.0
import org.nemomobile.systemsettings 1.0

SettingsToggle {
...
    menu: ContextMenu {
        MenuItem {
            text: qsTrId("settings_system-orientation_portrait")
            onClicked: {
              displaySettings.orientationLock = "portrait"
            }
        }
        MenuItem {
            text: qsTrId("settings_system-orientation_landscape")
            onClicked: {
              displaySettings.orientationLock = "landscape"
            }
        }
        MenuItem {
            text: "Inverted " + qsTrId("settings_system-orientation_portrait")
            onClicked: {
              displaySettings.orientationLock = "portrait-inverted"
            }
        }
        MenuItem {
            text: "Inverted " + qsTrId("settings_system-orientation_landscape")
            onClicked: {
              displaySettings.orientationLock = "landscape-inverted"
            }
        }
        MenuItem {
            text: "Dynamic"
            onClicked: {
              displaySettings.orientationLock = "dynamic"
            }
        }
    }
...
}

2 Likes

For one time orientation lock you can hold your finger on screen, rotate device and lift your finger. Screen does not rotate until you rotate device without holding screen. Unfortunately it seems not to fully work with Android apps. When you release finger, orientation changes.

PS. I know it’s not exactly what asked and quite late reply, but I just bumped to this topic. :slightly_smiling_face:

thanks for the reply. there are several reasons why the normal hold-and-rotate isnt sufficient.

  1. orientation is not locked by hold-and-rotate; boomers are still gonna rotate the phone by accident when you hand it to them to look at a picture.
  2. i use lipstick2vnc all the time to read+reply to texts from my laptop, and i want to rotate the view without having to go pick up the phone, wherever it is, and rotate it. (this is the case where it is most annoying that the top menu doesnt have options to CHANGE the rotation, only to KEEP the rotation)
  3. hold+rotate is broken in waydroid. the android apps will be rotated the WRONG way, moving with the accelerometer to be always sideways, until you hold-and-rotate again. also, like you say, some aliendalvik apps dont work with this method properly
1 Like