Commit 114b4140 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳 Committed by Linus Jahn

Move multimedia settings to settings

And refactor the settings page to display multiple list items correctly
Signed-off-by: Linus Jahn's avatarLinus Jahn <lnj@kaidan.im>
parent 74abdd09
Pipeline #14150 passed with stages
in 43 minutes and 9 seconds
......@@ -107,17 +107,6 @@ ChatPageBase {
text: qsTr("View profile")
onTriggered: pageStack.push(userProfilePage, {jid: kaidan.messageModel.chatPartner, name: chatName})
},
Kirigami.Action {
text: qsTr("Multimedia settings")
icon {
name: "settings-configure"
}
onTriggered: {
pageStack.push(multimediaSettingsPage, {jid: kaidan.messageModel.chatPartner, name: chatName})
}
},
Kirigami.Action {
readonly property int type: Enums.MessageType.MessageImage
......
......@@ -81,7 +81,6 @@ Kirigami.ApplicationWindow {
Component {id: settingsPage; SettingsPage {}}
Component {id: qrCodeScannerPage; QrCodeScannerPage {}}
Component {id: userProfilePage; UserProfilePage {}}
Component {id: multimediaSettingsPage; MultimediaSettingsPage {}}
/**
* Shows a passive notification for a long period.
......
......@@ -10,7 +10,6 @@
<file>GlobalDrawer.qml</file>
<file>QrCodeScannerPage.qml</file>
<file>UserProfilePage.qml</file>
<file>MultimediaSettingsPage.qml</file>
<file>elements/SubRequestAcceptSheet.qml</file>
<file>elements/RosterAddContactSheet.qml</file>
......@@ -55,5 +54,6 @@
<file>settings/SettingsPage.qml</file>
<file>settings/SettingsSheet.qml</file>
<file>settings/ChangePassword.qml</file>
<file>settings/MultimediaSettings.qml</file>
</qresource>
</RCC>
......@@ -46,30 +46,6 @@ Kirigami.Page {
bottomPadding: 0
leftPadding: 0
Timer {
id: pageTimer
interval: 10
onTriggered: {
if (!root.isCurrentPage) {
// Close the current page if it's not the current one after 10ms
pageStack.pop()
}
// Stop the timer regardless of whether the page was closed or not
pageTimer.stop()
}
}
onIsCurrentPageChanged: {
/*
* Start the timer if we are getting or loosing focus.
* Probably due to some kind of animation, isCurrentPage changes a few ms after
* this has been triggered.
*/
pageTimer.start()
}
MediaRecorder {
id: recorder
}
......@@ -637,6 +613,7 @@ Kirigami.Page {
} else if (button === standardButton(Controls.DialogButtonBox.Reset)) {
recorder.resetUserSettings()
} else if (button === standardButton(Controls.DialogButtonBox.Save)) {
stack.pop()
recorder.saveUserSettings()
}
}
......
......@@ -37,27 +37,25 @@ Kirigami.BasicListItem {
property string name
property string description
reserveSpaceForIcon: false
reserveSpaceForIcon: icon
RowLayout {
ColumnLayout {
Kirigami.Heading {
text: name
textFormat: Text.PlainText
elide: Text.ElideRight
maximumLineCount: 1
level: 2
Layout.fillWidth: true
Layout.maximumHeight: Kirigami.Units.gridUnit * 1.5
}
ColumnLayout {
Layout.fillHeight: true
Kirigami.Heading {
text: name
textFormat: Text.PlainText
elide: Text.ElideRight
maximumLineCount: 1
level: 2
Layout.fillWidth: true
Layout.maximumHeight: Kirigami.Units.gridUnit * 1.5
}
Controls.Label {
Layout.fillWidth: true
text: description
wrapMode: Text.WordWrap
textFormat: Text.PlainText
font.pixelSize: 14
}
Controls.Label {
Layout.fillWidth: true
text: description
wrapMode: Text.WordWrap
textFormat: Text.PlainText
}
}
}
......@@ -55,17 +55,20 @@ Kirigami.Page {
Component {
id: settingsContent
ColumnLayout {
Column {
spacing: 0
SettingsItem {
Layout.alignment: Qt.AlignTop
name: qsTr("Change password")
description: qsTr("Changes your account's password. You will need to re-enter it on your other devices.")
onClicked: stack.push(changePassword)
onClicked: stack.push("ChangePassword.qml")
icon: "lock"
reserveSpaceForIcon: true
}
SettingsItem {
name: qsTr("Multimedia Settings")
description: qsTr("Configure photo, video and audio recording settings")
onClicked: stack.push("MultimediaSettings.qml")
icon: "settings-configure"
}
}
}
Component {id: changePassword; ChangePassword {}}
}
......@@ -38,15 +38,15 @@ import org.kde.kirigami 2.8 as Kirigami
* fill the complete width, so it looks a bit nicer on large screens.
*/
Kirigami.OverlaySheet {
ColumnLayout {
Kirigami.Heading {
Layout.fillWidth: true
text: settingsPage.title
}
header: Kirigami.Heading {
text: settingsPage.title
}
contentItem: ColumnLayout {
SettingsPage {
Layout.preferredHeight: root.height * 0.9
Layout.maximumHeight: 500
Layout.preferredWidth: Layout.maximumWidth
Layout.maximumWidth: 600
Layout.maximumHeight: 600
id: settingsPage
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment