From 83bf254d39720a035df2c4815d02af9c6dc30b3f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 Mar 2017 11:50:31 +0100 Subject: [PATCH] feat(ui/views/App/ManageAccounts): refactoring, use now a vertical form --- .../modules/Common/Form/Placements/Form.qml | 1 + .../ui/views/App/ManageAccounts.qml | 43 ++++++++----------- .../views/App/Styles/ManageAccountsStyle.qml | 9 ---- 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/linphone-desktop/ui/modules/Common/Form/Placements/Form.qml b/linphone-desktop/ui/modules/Common/Form/Placements/Form.qml index 5276eda04..e09b45520 100644 --- a/linphone-desktop/ui/modules/Common/Form/Placements/Form.qml +++ b/linphone-desktop/ui/modules/Common/Form/Placements/Form.qml @@ -17,6 +17,7 @@ Column { ColumnLayout { spacing: FormStyle.header.spacing + visible: parent.title.length > 0 width: parent.width Text { diff --git a/linphone-desktop/ui/views/App/ManageAccounts.qml b/linphone-desktop/ui/views/App/ManageAccounts.qml index 0117e38a1..506659bb5 100644 --- a/linphone-desktop/ui/views/App/ManageAccounts.qml +++ b/linphone-desktop/ui/views/App/ManageAccounts.qml @@ -1,5 +1,4 @@ import QtQuick 2.7 -import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 @@ -31,39 +30,31 @@ DialogPlus { // --------------------------------------------------------------------------- - Column { + Form { + orientation: Qt.Vertical + anchors { - fill: parent + left: parent.left leftMargin: ManageAccountsStyle.leftMargin + right: parent.right rightMargin: ManageAccountsStyle.rightMargin } - spacing: ManageAccountsStyle.input.spacing + FormLine { + FormGroup { + label: qsTr('selectAccountLabel') - Text { - color: ManageAccountsStyle.input.legend.color - elide: Text.ElideRight + ComboBox { + currentIndex: Utils.findIndex(AccountSettingsModel.accounts, function (account) { + return account.sipAddress === AccountSettingsModel.sipAddress + }) - font { - bold: true - pointSize: ManageAccountsStyle.input.legend.fontSize + model: AccountSettingsModel.accounts + textRole: 'sipAddress' + + onActivated: AccountSettingsModel.setDefaultProxyConfig(model[index].proxyConfig) + } } - - text: qsTr('selectAccountLabel') - } - - ComboBox { - id: email - - currentIndex: Utils.findIndex(AccountSettingsModel.accounts, function (account) { - return account.sipAddress === AccountSettingsModel.sipAddress - }) - - model: AccountSettingsModel.accounts - textRole: 'sipAddress' - width: parent.width - - onActivated: AccountSettingsModel.setDefaultProxyConfig(model[index].proxyConfig) } } } diff --git a/linphone-desktop/ui/views/App/Styles/ManageAccountsStyle.qml b/linphone-desktop/ui/views/App/Styles/ManageAccountsStyle.qml index ec174ff4e..f86364966 100644 --- a/linphone-desktop/ui/views/App/Styles/ManageAccountsStyle.qml +++ b/linphone-desktop/ui/views/App/Styles/ManageAccountsStyle.qml @@ -10,13 +10,4 @@ QtObject { property int leftMargin: 35 property int rightMargin: 35 property int width: 480 - - property QtObject input: QtObject { - property int spacing: 6 - - property QtObject legend: QtObject { - property color color: Colors.j - property int fontSize: 10 - } - } }