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