Merge pull request #326 from monich/landscape-settings

Optimize settings page for landscape layout
This commit is contained in:
Sebastian Wolf 2021-01-18 18:45:48 +01:00 committed by GitHub
commit c992c3ed00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,8 @@ Page {
id: settingsPage
allowedOrientations: Orientation.All
readonly property bool landscapeLayout: (width > height && Screen.sizeCategory > Screen.Small) || Screen.sizeCategory > Screen.Medium
SilicaFlickable {
id: settingsContainer
contentHeight: column.height
@ -42,7 +44,14 @@ Page {
text: qsTr("Behavior")
}
Grid {
width: parent.width
columns: landscapeLayout ? 2 : 1
readonly property real columnWidth: width/columns
TextSwitch {
width: parent.columnWidth
checked: appSettings.sendByEnter
text: qsTr("Send message by enter")
description: qsTr("Send your message by pressing the enter key")
@ -53,6 +62,7 @@ Page {
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.focusTextAreaAfterSend
text: qsTr("Focus text input area after send")
description: qsTr("Focus the text input area after sending a message")
@ -63,6 +73,7 @@ Page {
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.useOpenWith
text: qsTr("Open-with menu integration")
description: qsTr("Integrate Fernschreiber into open-with menu of Sailfish OS")
@ -72,6 +83,21 @@ Page {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationTurnsDisplayOn && enabled
text: qsTr("Notification turns on the display")
height: appSettings.notificationFeedback === AppSettings.NotificationFeedbackNone ? 0 : implicitHeight
clip: height < implicitHeight
visible: height > 0
automaticCheck: false
onClicked: {
appSettings.notificationTurnsDisplayOn = !checked
}
Behavior on height { SmoothedAnimation { duration: 200 } }
}
}
ComboBox {
id: feedbackComboBox
label: qsTr("Notification feedback")
@ -123,33 +149,18 @@ Page {
}
}
TextSwitch {
checked: appSettings.notificationTurnsDisplayOn && enabled
text: qsTr("Notification turns on the display")
height: appSettings.notificationFeedback === AppSettings.NotificationFeedbackNone ? 0 : implicitHeight
clip: height < implicitHeight
visible: height > 0
automaticCheck: false
onClicked: {
appSettings.notificationTurnsDisplayOn = !checked
}
Behavior on height { SmoothedAnimation { duration: 200 } }
}
SectionHeader {
text: qsTr("Appearance")
}
TextSwitch {
checked: appSettings.animateStickers
text: qsTr("Animate stickers")
automaticCheck: false
onClicked: {
appSettings.animateStickers = !checked
}
}
Grid {
width: parent.width
columns: landscapeLayout ? 2 : 1
readonly property real columnWidth: width/columns
TextSwitch {
width: parent.columnWidth
checked: appSettings.showStickersAsImages
text: qsTr("Show stickers as images")
description: qsTr("Show background for stickers and align them centrally like images")
@ -159,6 +170,17 @@ Page {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.animateStickers
text: qsTr("Animate stickers")
automaticCheck: false
onClicked: {
appSettings.animateStickers = !checked
}
}
}
SectionHeader {
text: qsTr("Privacy")
}
@ -177,16 +199,14 @@ Page {
text: qsTr("Storage")
}
TextSwitch {
checked: appSettings.storageOptimizer
text: qsTr("Enable storage optimizer")
automaticCheck: false
onClicked: {
appSettings.storageOptimizer = !checked
}
}
Grid {
width: parent.width
columns: landscapeLayout ? 2 : 1
readonly property real columnWidth: width/columns
TextSwitch {
width: parent.columnWidth
checked: appSettings.onlineOnlyMode
text: qsTr("Enable online-only mode")
description: qsTr("Disables offline caching. Certain features may be limited or missing in this mode. Changes require a restart of Fernschreiber to take effect.")
@ -196,6 +216,17 @@ Page {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.storageOptimizer
text: qsTr("Enable storage optimizer")
automaticCheck: false
onClicked: {
appSettings.storageOptimizer = !checked
}
}
}
Item {
width: 1
height: Theme.paddingLarge // Some space at the bottom