1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 14:55:43 +02:00

settingsview: make all areas of settings view scrollable

Also, it comes with little ui fixes:
1. Advanced sip security settings, tls version comboBox geometry fix
2. Margin between account deletion button and user identity for sip account

Gitlab: #104
Change-Id: Ia9af7a7031e3ab8221b77b7c1f06b2f3aeb4528d
This commit is contained in:
Ming Rui Zhang 2020-09-16 17:08:21 -04:00
parent 8a064c3a64
commit c821c75443
15 changed files with 385 additions and 403 deletions

View file

@ -91,6 +91,7 @@ Item {
property int menuFontSize: 12
property int maximumWidthSettingsView: 600
property int settingsHeaderpreferredHeight: 64
property int preferredFieldWidth: 256
property int preferredFieldHeight: 32
property int preferredMarginSize: 16

View file

@ -134,6 +134,7 @@ Rectangle {
Rectangle {
id: settingsViewRect
anchors.fill: root
signal stopAudioMeter
@ -151,79 +152,132 @@ Rectangle {
}
}
StackLayout {
id: rightSettingsWidget
SettingsHeader {
id: settingsHeader
anchors.fill: parent
anchors.top: settingsViewRect.top
anchors.left: settingsViewRect.left
anchors.leftMargin: {
var pageWidth = rightSettingsStackLayout.itemAt(
rightSettingsStackLayout.currentIndex).contentWidth
return (settingsViewRect.width - pageWidth) / 2 + JamiTheme.preferredMarginSize
}
property int pageIdCurrentAccountSettingsPage: 0
property int pageIdGeneralSettingsPage: 1
property int pageIdAvSettingPage: 2
property int pageIdPluginSettingsPage: 3
height: JamiTheme.settingsHeaderpreferredHeight
currentIndex: {
title: {
switch(selectedMenu){
case SettingsView.Account:
return pageIdCurrentAccountSettingsPage
return qsTr("Account Settings")
case SettingsView.General:
return pageIdGeneralSettingsPage
return qsTr("General")
case SettingsView.Media:
return pageIdAvSettingPage
return JamiStrings.avSettingsTitle
case SettingsView.Plugin:
return pageIdPluginSettingsPage
return qsTr("Plugin")
}
}
// current account setting scroll page, index 0
CurrentAccountSettings {
id: pageIdCurrentAccountSettings
onBackArrowClicked: root.settingsBackArrowClicked()
}
Layout.fillHeight: true
Layout.fillWidth: true
ScrollView {
id: settingsViewScrollView
isSIP: settingsViewRect.isSIP
property ScrollBar vScrollBar: ScrollBar.vertical
onNavigateToMainView: {
leaveSettingsSlot(true)
anchors.top: settingsHeader.bottom
anchors.horizontalCenter: settingsViewRect.horizontalCenter
height: settingsViewRect.height - settingsHeader.height
width: settingsViewRect.width
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
clip: true
contentHeight: rightSettingsStackLayout.height
StackLayout {
id: rightSettingsStackLayout
anchors.centerIn: parent
width: settingsViewScrollView.width
property int pageIdCurrentAccountSettingsPage: 0
property int pageIdGeneralSettingsPage: 1
property int pageIdAvSettingPage: 2
property int pageIdPluginSettingsPage: 3
currentIndex: {
switch(selectedMenu){
case SettingsView.Account:
return pageIdCurrentAccountSettingsPage
case SettingsView.General:
return pageIdGeneralSettingsPage
case SettingsView.Media:
return pageIdAvSettingPage
case SettingsView.Plugin:
return pageIdPluginSettingsPage
}
}
onNavigateToNewWizardView: {
leaveSettingsSlot(false)
Component.onCompleted: {
// avoid binding loop
height = Qt.binding(function (){
return Math.max(
rightSettingsStackLayout.itemAt(currentIndex).preferredHeight,
settingsViewScrollView.height)
})
}
}
// general setting page, index 1
GeneralSettingsPage {
id: generalSettings
// current account setting scroll page, index 0
CurrentAccountSettings {
id: pageIdCurrentAccountSettings
Layout.fillHeight: true
Layout.fillWidth: true
}
Layout.alignment: Qt.AlignCenter
// av setting page, index 2
AvSettingPage {
id: avSettings
isSIP: settingsViewRect.isSIP
Layout.fillHeight: true
Layout.fillWidth: true
}
onNavigateToMainView: {
leaveSettingsSlot(true)
}
// plugin setting page, index 3
PluginSettingsPage {
id: pluginSettings
onNavigateToNewWizardView: {
leaveSettingsSlot(false)
}
Layout.fillHeight: true
Layout.fillWidth: true
onAdvancedSettingsToggled: {
if (settingsVisible)
settingsViewScrollView.vScrollBar.position =
getAdvancedSettingsScrollPosition()
else
settingsViewScrollView.vScrollBar.position = 0
}
}
// general setting page, index 1
GeneralSettingsPage {
id: generalSettings
Layout.alignment: Qt.AlignCenter
}
// av setting page, index 2
AvSettingPage {
id: avSettings
Layout.alignment: Qt.AlignCenter
}
// plugin setting page, index 3
PluginSettingsPage {
id: pluginSettings
Layout.alignment: Qt.AlignCenter
}
}
}
}
// Back button signal redirection
Component.onCompleted: {
pageIdCurrentAccountSettings.backArrowClicked.connect(settingsBackArrowClicked)
generalSettings.backArrowClicked.connect(settingsBackArrowClicked)
avSettings.backArrowClicked.connect(settingsBackArrowClicked)
pluginSettings.backArrowClicked.connect(settingsBackArrowClicked)
}
}

View file

@ -123,7 +123,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnRingtone
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.selectCustomRingtone
source: "qrc:/images/icons/round-folder-24px.svg"
@ -143,4 +143,4 @@ ColumnLayout {
}
}
}
}
}

View file

@ -136,7 +136,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnCACert
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.caCertificate
source: "qrc:/images/icons/round-folder-24px.svg"
@ -147,7 +147,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnUserCert
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.userCertificate
source: "qrc:/images/icons/round-folder-24px.svg"
@ -158,7 +158,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnPrivateKey
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.privateKey
source: "qrc:/images/icons/round-folder-24px.svg"
@ -175,4 +175,4 @@ ColumnLayout {
titleField: JamiStrings.privateKeyPassword
}
}
}
}

View file

@ -202,7 +202,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnSIPCACert
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.caCertificate
source: "qrc:/images/icons/round-folder-24px.svg"
@ -213,7 +213,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnSIPUserCert
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.userCertificate
source: "qrc:/images/icons/round-folder-24px.svg"
@ -224,7 +224,7 @@ ColumnLayout {
SettingMaterialButton {
id: btnSIPPrivateKey
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
titleField: JamiStrings.privateKey
source: "qrc:/images/icons/round-folder-24px.svg"
@ -282,7 +282,6 @@ ColumnLayout {
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.tlsProtocol
fontPointSize: JamiTheme.settingsFontSize
@ -326,4 +325,4 @@ ColumnLayout {
onNewValue: SettingsAdapter.negotiationTimeoutSpinBoxValueChanged(valueField)
}
}
}
}

View file

@ -34,8 +34,7 @@ ColumnLayout {
property bool isSIP
property int itemWidth
signal scrolled
property alias settingsVisible: advancedSettingsView.visible
function updateAdvancedAccountInfos() {
advancedCallSettings.updateCallSettingsInfos()
@ -90,77 +89,87 @@ ColumnLayout {
advancedSettingsView.visible = !advancedSettingsView.visible
if(advancedSettingsView.visible)
updateAdvancedAccountInfos()
scrolled()
}
}
}
ColumnLayout {
id: advancedSettingsView
Layout.fillWidth: true
visible: false
AdvancedCallSettings {
id: advancedCallSettings
isSIP: root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
isSIP: root.isSIP
itemWidth: root.itemWidth
}
AdvancedVoiceMailSettings {
id: advancedVoiceMailSettings
visible: root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: root.isSIP
itemWidth: root.itemWidth
}
AdvancedSIPSecuritySettings {
id: advancedSIPSecuritySettings
visible: root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: root.isSIP
itemWidth: root.itemWidth
}
AdvancedNameServerSettings {
id: advancedNameServerSettings
visible: !root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: !root.isSIP
itemWidth: root.itemWidth
}
AdvancedOpenDHTSettings {
id: advancedOpenDHTSettings
visible: !root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: !root.isSIP
itemWidth: root.itemWidth
}
AdvancedJamiSecuritySettings {
id: advancedJamiSecuritySettings
visible: !root.isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: !root.isSIP
itemWidth: root.itemWidth
}
AdvancedConnectivitySettings {
id: advancedConnectivitySettings
itemWidth: root.itemWidth
isSIP: root.isSIP
Layout.fillWidth: true
itemWidth: root.itemWidth
isSIP: root.isSIP
}
AdvancedPublicAddressSettings {
id: advancedPublicAddressSettings
visible: isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: isSIP
itemWidth: root.itemWidth
}
AdvancedMediaSettings {
@ -171,10 +180,11 @@ ColumnLayout {
AdvancedSDPSettings {
id: advancedSDPStettings
visible: isSIP
itemWidth: root.itemWidth
Layout.fillWidth: true
visible: isSIP
itemWidth: root.itemWidth
}
}
}
}

View file

@ -106,7 +106,7 @@ ColumnLayout {
id: inputComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.microphone
@ -118,7 +118,9 @@ ColumnLayout {
onIndexChanged: {
stopAudioMeter(false)
var selectedInputDeviceName = comboModel.data(comboModel.index( modelIndex, 0), AudioInputDeviceModel.Device_ID)
var selectedInputDeviceName = comboModel.data(
comboModel.index(modelIndex, 0),
AudioInputDeviceModel.Device_ID)
AVModel.setInputDevice(selectedInputDeviceName)
startAudioMeter(false)
}
@ -141,7 +143,7 @@ ColumnLayout {
id: outputComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.outputDevice
@ -153,7 +155,9 @@ ColumnLayout {
onIndexChanged: {
stopAudioMeter(false)
var selectedOutputDeviceName = audioOutputDeviceModel.data(audioOutputDeviceModel.index( modelIndex, 0), AudioOutputDeviceModel.Device_ID)
var selectedOutputDeviceName = audioOutputDeviceModel.data(
audioOutputDeviceModel.index(modelIndex, 0),
AudioOutputDeviceModel.Device_ID)
AVModel.setOutputDevice(selectedOutputDeviceName)
startAudioMeter(false)
}
@ -163,7 +167,7 @@ ColumnLayout {
id: ringtoneDeviceComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.ringtoneDevice
@ -175,7 +179,9 @@ ColumnLayout {
onIndexChanged: {
stopAudioMeter(false)
var selectedRingtoneDeviceName = audioOutputDeviceModel.data(audioOutputDeviceModel.index( modelIndex, 0), AudioOutputDeviceModel.Device_ID)
var selectedRingtoneDeviceName = audioOutputDeviceModel.data(
audioOutputDeviceModel.index(modelIndex, 0),
AudioOutputDeviceModel.Device_ID)
AVModel.setRingtoneDevice(selectedRingtoneDeviceName)
startAudioMeter(false)
}
@ -185,7 +191,7 @@ ColumnLayout {
id: audioManagerComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.audioManager
@ -196,7 +202,8 @@ ColumnLayout {
onIndexChanged: {
stopAudioMeter(false)
var selectedAudioManager = comboModel.data(comboModel.index( modelIndex, 0), AudioManagerListModel.AudioManagerID)
var selectedAudioManager = comboModel.data(
comboModel.index(modelIndex, 0), AudioManagerListModel.AudioManagerID)
AVModel.setAudioManager(selectedAudioManager)
startAudioMeter(false)
populateAudioSettings()

View file

@ -32,8 +32,8 @@ Rectangle {
id: root
property int preferredColumnWidth: Math.min(root.width / 2 - 50, 275)
signal backArrowClicked
property int contentWidth: avSettingsColumnLayout.width
property int preferredHeight: avSettingsColumnLayout.implicitHeight
onVisibleChanged: {
if (!visible) {
@ -48,60 +48,33 @@ Rectangle {
}
ColumnLayout {
id: avSettingsColumnLayout
anchors.centerIn: root
height: root.height
width: Math.min(JamiTheme.maximumWidthSettingsView, root.width)
SettingsHeader {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
// Audio
AudioSettings {
id: audioSettings
Layout.fillWidth: true
Layout.preferredHeight: 64
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
title: JamiStrings.avSettingsTitle
onBackArrowClicked: root.backArrowClicked()
itemWidth: preferredColumnWidth
}
ScrollView {
id: avSettingsScrollView
// Video
VideoSettings {
id: videoSettings
property ScrollBar vScrollBar: ScrollBar.vertical
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
Layout.fillHeight: true
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
focus: true
clip: true
ColumnLayout {
width: avSettingsScrollView.width
// Audio
AudioSettings {
id: audioSettings
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
itemWidth: preferredColumnWidth
}
// Video
VideoSettings {
id: videoSettings
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
itemWidth: preferredColumnWidth
}
}
itemWidth: preferredColumnWidth
}
}
}

View file

@ -36,11 +36,13 @@ Rectangle {
property bool isSIP
property int contentWidth: currentAccountSettingsColumnLayout.width
property int preferredHeight: currentAccountSettingsColumnLayout.implicitHeight
property int preferredColumnWidth : Math.min(root.width / 2 - 50, 350)
signal navigateToMainView
signal navigateToNewWizardView
signal backArrowClicked
signal advancedSettingsToggled(bool settingsVisible)
function isPhotoBoothOpened() {
return accountProfile.isPhotoBoothOpened()
@ -86,6 +88,9 @@ Rectangle {
bannedContacts.connectCurrentAccount(false)
}
function getAdvancedSettingsScrollPosition() {
return advancedSettings.y / currentAccountSettingsColumnLayout.height
}
function setPasswordButtonText() {
var hasPassword = AccountAdapter.hasPassword()
@ -175,176 +180,148 @@ Rectangle {
}
ColumnLayout {
id: currentAccountSettingsColumnLayout
anchors.centerIn: root
height: root.height
width: Math.min(JamiTheme.maximumWidthSettingsView, root.width)
SettingsHeader {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
ToggleSwitch {
id: accountEnableCheckBox
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.preferredHeight: 64
Layout.rightMargin: JamiTheme.preferredMarginSize
title: qsTr("Account Settings")
labelText: JamiStrings.enableAccount
fontPointSize: JamiTheme.headerFontSize
onBackArrowClicked: root.backArrowClicked()
onSwitchToggled: AccountAdapter.model.setAccountEnabled(
AccountAdapter.currentAccountId, checked)
}
ScrollView {
id: scrollView
AccountProfile {
id: accountProfile
property ScrollBar vScrollBar: ScrollBar.vertical
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
Layout.fillHeight: true
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
focus: true
clip: true
UserIdentity {
id: userIdentity
isSIP: root.isSIP
ColumnLayout {
id: accountLayout
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
width: scrollView.width
itemWidth: preferredColumnWidth
}
ToggleSwitch {
id: accountEnableCheckBox
MaterialButton {
id: passwdPushButton
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
labelText: JamiStrings.enableAccount
fontPointSize: JamiTheme.headerFontSize
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
onSwitchToggled: AccountAdapter.model.setAccountEnabled(
AccountAdapter.currentAccountId, checked)
}
toolTipText: AccountAdapter.hasPassword() ?
JamiStrings.changeCurrentPassword : JamiStrings.setAPassword
text: AccountAdapter.hasPassword() ? JamiStrings.changePassword : JamiStrings.setPassword
AccountProfile {
id: accountProfile
source: "qrc:/images/icons/round-edit-24px.svg"
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
UserIdentity {
id: userIdentity
isSIP: root.isSIP
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
itemWidth: preferredColumnWidth
}
MaterialButton {
id: passwdPushButton
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
toolTipText: AccountAdapter.hasPassword() ?
JamiStrings.changeCurrentPassword : JamiStrings.setAPassword
text: AccountAdapter.hasPassword() ? JamiStrings.changePassword : JamiStrings.setPassword
source: "qrc:/images/icons/round-edit-24px.svg"
onClicked: {
passwordClicked()
}
}
MaterialButton {
id: btnExportAccount
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
toolTipText: JamiStrings.tipBackupAccount
text: JamiStrings.backupAccountBtn
source: "qrc:/images/icons/round-save_alt-24px.svg"
onClicked: {
exportAccountSlot()
}
}
MaterialButton {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
color: JamiTheme.buttonTintedRed
hoveredColor: JamiTheme.buttonTintedRedHovered
pressedColor: JamiTheme.buttonTintedRedPressed
text: JamiStrings.deleteAccount
source: "qrc:/images/icons/delete_forever-24px.svg"
onClicked: {
delAccountSlot()
}
}
LinkedDevices {
id: linkedDevices
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
BannedContacts {
id: bannedContacts
isSIP: root.isSIP
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
AdvancedSettings {
id: advancedSettings
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: 8
itemWidth: preferredColumnWidth
isSIP: root.isSIP
onScrolled: scrollView.vScrollBar.position = advancedSettings.y / accountLayout.height
}
onClicked: {
passwordClicked()
}
}
MaterialButton {
id: btnExportAccount
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
toolTipText: JamiStrings.tipBackupAccount
text: JamiStrings.backupAccountBtn
source: "qrc:/images/icons/round-save_alt-24px.svg"
onClicked: {
exportAccountSlot()
}
}
MaterialButton {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.topMargin: isSIP ? JamiTheme.preferredMarginSize : 0
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
color: JamiTheme.buttonTintedRed
hoveredColor: JamiTheme.buttonTintedRedHovered
pressedColor: JamiTheme.buttonTintedRedPressed
text: JamiStrings.deleteAccount
source: "qrc:/images/icons/delete_forever-24px.svg"
onClicked: {
delAccountSlot()
}
}
LinkedDevices {
id: linkedDevices
visible: !isSIP && SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
BannedContacts {
id: bannedContacts
isSIP: root.isSIP
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
}
AdvancedSettings {
id: advancedSettings
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: 8
itemWidth: preferredColumnWidth
isSIP: root.isSIP
onHeightChanged: advancedSettingsToggled(settingsVisible)
}
}
}

View file

@ -32,66 +32,43 @@ Rectangle {
id: root
property int preferredColumnWidth : Math.min(root.width / 2 - 50, 350)
signal backArrowClicked
property int contentWidth: generalSettingsColumnLayout.width
property int preferredHeight: generalSettingsColumnLayout.implicitHeight
ColumnLayout {
id: generalSettingsColumnLayout
anchors.centerIn: root
height: root.height
width: Math.min(JamiTheme.maximumWidthSettingsView, root.width)
SettingsHeader {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
// system setting panel
SystemSettings {
Layout.fillWidth: true
Layout.preferredHeight: 64
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
title: qsTr("General")
onBackArrowClicked: root.backArrowClicked()
itemWidth: preferredColumnWidth
}
ScrollView {
id: generalSettingsScrollView
Layout.fillHeight: true
// call recording setting panel
RecordingSettings {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
focus: true
clip: true
itemWidth: preferredColumnWidth
}
ColumnLayout {
width: generalSettingsScrollView.width
// system setting panel
SystemSettings {
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
itemWidth: preferredColumnWidth
}
// call recording setting panel
RecordingSettings {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
itemWidth: preferredColumnWidth
}
// update setting panel
UpdateSettings {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
visible: Qt.platform.os == "windows"? true : false
}
}
// update setting panel
UpdateSettings {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
visible: Qt.platform.os == "windows"? true : false
}
}
}

View file

@ -29,6 +29,9 @@ import "../../commoncomponents"
Rectangle {
id: root
property int contentWidth: pluginSettingsColumnLayout.width
property int preferredHeight: pluginSettingsColumnLayout.implicitHeight
function populatePluginSettings() {
enabledplugin.checked = PluginModel.getPluginsEnabled()
pluginListSettingsView.visible = enabledplugin.checked
@ -38,82 +41,62 @@ Rectangle {
PluginModel.setPluginsEnabled(state)
}
signal backArrowClicked
ColumnLayout {
id: pluginSettingsColumnLayout
anchors.centerIn: root
height: root.height
width: Math.min(JamiTheme.maximumWidthSettingsView, root.width)
SettingsHeader {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
ToggleSwitch {
id: enabledplugin
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.preferredHeight: 64
Layout.rightMargin: JamiTheme.preferredMarginSize
title: qsTr("Plugin")
labelText: "Enable"
fontPointSize: JamiTheme.headerFontSize
onBackArrowClicked: root.backArrowClicked()
}
onSwitchToggled: {
slotSetPluginEnabled(checked)
ScrollView {
id: pluginScrollView
Layout.fillHeight: true
Layout.fillWidth: true
focus: true
clip: true
ColumnLayout {
width: pluginScrollView.width
ToggleSwitch {
id: enabledplugin
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
labelText: "Enable"
fontPointSize: JamiTheme.headerFontSize
onSwitchToggled: {
slotSetPluginEnabled(checked)
pluginListSettingsView.visible = checked
if (!pluginListSettingsView.visible) {
PluginModel.toggleCallMediaHandler("", true)
pluginListSettingsView.hidePreferences()
}
}
}
PluginListSettingsView {
id: pluginListSettingsView
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.alignment: Qt.AlignHCenter
pluginListPreferencesView: pluginListPreferencesView
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
}
PluginListPreferencesView {
id: pluginListPreferencesView
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
pluginListSettingsView.visible = checked
if (!pluginListSettingsView.visible) {
PluginModel.toggleCallMediaHandler("", true)
pluginListSettingsView.hidePreferences()
}
}
}
PluginListSettingsView {
id: pluginListSettingsView
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
pluginListPreferencesView: pluginListPreferencesView
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
}
PluginListPreferencesView {
id: pluginListPreferencesView
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
}
}
}

View file

@ -174,7 +174,7 @@ ColumnLayout {
id: recordPathButton
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: itemWidth
toolTipText: JamiStrings.tipRecordFolder

View file

@ -52,17 +52,19 @@ RowLayout {
ElidedTextLabel {
id: label
Layout.fillWidth: true
Layout.preferredHeight: heightOfLayout
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
eText: qsTr(labelText)
fontSize: JamiTheme.settingsFontSize
maxWidth: width
maxWidth: widthOfComboBox
}
SettingParaCombobox {
id: comboBoxOfLayout
Layout.preferredWidth: widthOfComboBox
Layout.preferredHeight: JamiTheme.preferredFieldHeight

View file

@ -127,7 +127,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: itemWidth
Layout.fillHeight: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
toolTipText: JamiStrings.tipChooseDownloadFolder
text: downloadPath

View file

@ -155,7 +155,7 @@ ColumnLayout {
id: deviceComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.device
@ -174,7 +174,7 @@ ColumnLayout {
id: resolutionComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.resolution
@ -193,7 +193,7 @@ ColumnLayout {
id: fpsComboBoxSetting
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: JamiStrings.fps
@ -227,22 +227,21 @@ ColumnLayout {
// video Preview
Rectangle {
id: rectBox
Layout.alignment: Qt.AlignHCenter
Layout.maximumHeight: width * aspectRatio
Layout.minimumHeight: width * aspectRatio
Layout.preferredHeight: width * aspectRatio
Layout.minimumWidth: 200
Layout.maximumWidth: 400
Layout.preferredWidth: itemWidth * 2
Layout.bottomMargin: JamiTheme.preferredMarginSize
color: "white"
radius: 5
PreviewRenderer {
id: previewWidget
anchors.fill: rectBox
anchors.centerIn: rectBox
layer.enabled: true
layer.effect: OpacityMask {