From d84144c74cc8eb5b8093f91eed30e8397347111c Mon Sep 17 00:00:00 2001 From: Ming Rui Zhang Date: Mon, 14 Sep 2020 16:48:07 -0400 Subject: [PATCH] settings: make settings page align in center when the window grows Change-Id: I87b731f754762b78fc13257a0a9aede0bd8c034c --- src/constant/JamiTheme.qml | 2 +- src/mainview/MainView.qml | 6 +++--- src/settingsview/SettingsView.qml | 13 +++++-------- src/settingsview/components/AudioSettings.qml | 2 +- src/settingsview/components/AvSettingPage.qml | 9 ++++++--- .../components/CurrentAccountSettings.qml | 11 +++++++---- src/settingsview/components/GeneralSettingsPage.qml | 9 ++++++--- src/settingsview/components/PluginSettingsPage.qml | 9 ++++++--- 8 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index 62bb7a56..526bf900 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -89,7 +89,7 @@ Item { property int titleFontSize: 16 property int menuFontSize: 12 - property int maximumWidthSettingsView: 800 + property int maximumWidthSettingsView: 600 property int preferredFieldWidth: 256 property int preferredFieldHeight: 32 property int preferredMarginSize: 16 diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index 6d9e8d4c..09ac2421 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -353,8 +353,9 @@ Window { initialItem: welcomePage - SplitView.maximumWidth: sidePanelOnly ? splitView.width : - splitView.width - sidePanelViewStackPreferredWidth + SplitView.maximumWidth: sidePanelOnly ? + splitView.width : + splitView.width - sidePanelViewStackPreferredWidth SplitView.minimumWidth: sidePanelViewStackPreferredWidth SplitView.fillHeight: true @@ -540,7 +541,6 @@ Window { SettingsView { id: settingsView - anchors.fill: parent visible: false diff --git a/src/settingsview/SettingsView.qml b/src/settingsview/SettingsView.qml index 9914c370..80520511 100644 --- a/src/settingsview/SettingsView.qml +++ b/src/settingsview/SettingsView.qml @@ -179,8 +179,7 @@ Rectangle { id: pageIdCurrentAccountSettings Layout.fillHeight: true - Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true isSIP: settingsViewRect.isSIP @@ -198,8 +197,7 @@ Rectangle { id: generalSettings Layout.fillHeight: true - Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true } // av setting page, index 2 @@ -207,16 +205,15 @@ Rectangle { id: avSettings Layout.fillHeight: true - Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true } // plugin setting page, index 3 PluginSettingsPage { id: pluginSettings + Layout.fillHeight: true - Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true } } } diff --git a/src/settingsview/components/AudioSettings.qml b/src/settingsview/components/AudioSettings.qml index 3a41a617..4e57bf14 100644 --- a/src/settingsview/components/AudioSettings.qml +++ b/src/settingsview/components/AudioSettings.qml @@ -129,7 +129,7 @@ ColumnLayout { id: audioInputMeter Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: itemWidth * 2 + Layout.preferredWidth: itemWidth * 1.5 Layout.preferredHeight: JamiTheme.preferredFieldHeight indeterminate: false diff --git a/src/settingsview/components/AvSettingPage.qml b/src/settingsview/components/AvSettingPage.qml index 9c9147ca..4ba74194 100644 --- a/src/settingsview/components/AvSettingPage.qml +++ b/src/settingsview/components/AvSettingPage.qml @@ -31,7 +31,7 @@ import "../../commoncomponents" Rectangle { id: root - property int preferredColumnWidth: root.width / 2 - 50 + property int preferredColumnWidth: Math.min(root.width / 2 - 50, 275) signal backArrowClicked @@ -48,7 +48,10 @@ Rectangle { } ColumnLayout { - anchors.fill: root + anchors.centerIn: root + + height: root.height + width: Math.min(JamiTheme.maximumWidthSettingsView, root.width) SettingsHeader { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter @@ -75,7 +78,7 @@ Rectangle { clip: true ColumnLayout { - width: root.width + width: avSettingsScrollView.width // Audio AudioSettings { diff --git a/src/settingsview/components/CurrentAccountSettings.qml b/src/settingsview/components/CurrentAccountSettings.qml index 6b8051f4..56eb29e8 100644 --- a/src/settingsview/components/CurrentAccountSettings.qml +++ b/src/settingsview/components/CurrentAccountSettings.qml @@ -36,7 +36,7 @@ Rectangle { property bool isSIP - property int preferredColumnWidth : root.width / 2 - 50 + property int preferredColumnWidth : Math.min(root.width / 2 - 50, 350) signal navigateToMainView signal navigateToNewWizardView @@ -159,7 +159,10 @@ Rectangle { } ColumnLayout { - anchors.fill: root + anchors.centerIn: root + + height: root.height + width: Math.min(JamiTheme.maximumWidthSettingsView, root.width) SettingsHeader { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter @@ -188,7 +191,7 @@ Rectangle { ColumnLayout { id: accountLayout - width: root.width + width: scrollView.width ToggleSwitch { id: accountEnableCheckBox @@ -327,4 +330,4 @@ Rectangle { } } } -} \ No newline at end of file +} diff --git a/src/settingsview/components/GeneralSettingsPage.qml b/src/settingsview/components/GeneralSettingsPage.qml index ce8ec4cd..1dc91db2 100644 --- a/src/settingsview/components/GeneralSettingsPage.qml +++ b/src/settingsview/components/GeneralSettingsPage.qml @@ -31,12 +31,15 @@ import "../../commoncomponents" Rectangle { id: root - property int preferredColumnWidth : root.width / 2 - 50 + property int preferredColumnWidth : Math.min(root.width / 2 - 50, 350) signal backArrowClicked ColumnLayout { - anchors.fill: root + anchors.centerIn: root + + height: root.height + width: Math.min(JamiTheme.maximumWidthSettingsView, root.width) SettingsHeader { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter @@ -59,7 +62,7 @@ Rectangle { clip: true ColumnLayout { - width: root.width + width: generalSettingsScrollView.width // system setting panel SystemSettings { diff --git a/src/settingsview/components/PluginSettingsPage.qml b/src/settingsview/components/PluginSettingsPage.qml index cd32e65e..e8f94e78 100644 --- a/src/settingsview/components/PluginSettingsPage.qml +++ b/src/settingsview/components/PluginSettingsPage.qml @@ -41,7 +41,10 @@ Rectangle { signal backArrowClicked ColumnLayout { - anchors.fill: root + anchors.centerIn: root + + height: root.height + width: Math.min(JamiTheme.maximumWidthSettingsView, root.width) SettingsHeader { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter @@ -56,15 +59,15 @@ Rectangle { ScrollView { id: pluginScrollView + Layout.fillHeight: true Layout.fillWidth: true focus: true - clip: true ColumnLayout { - width: root.width + width: pluginScrollView.width ToggleSwitch { id: enabledplugin