diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index 988be2252..d91c720a7 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -411,6 +411,25 @@ Server url not configured. + + InviteFriends + + enterEmailLabel + Enter your friend's email address + + + messageLabel + You can modify the invitation that will be sent + + + cancel + CANCEL + + + confirm + CONFIRM + + MainWindow diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index ab1557963..44845bf19 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -410,6 +410,25 @@ Url du serveur non configurée. APPEL AUDIO ENTRANT + + InviteFriends + + enterEmailLabel + Entrer l'adresse email de votre ami + + + messageLabel + Modifier l'invitation qui sera envoyée + + + cancel + ANNULER + + + confirm + CONFIRMER + + MainWindow diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index e2d77cabf..f3e5705cb 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -183,6 +183,7 @@ ui/modules/Common/Form/CheckBoxText.qml ui/modules/Common/Form/ExclusiveButtons.qml ui/modules/Common/Form/Fields/NumericField.qml + ui/modules/Common/Form/Fields/TextAreaField.qml ui/modules/Common/Form/Fields/TextField.qml ui/modules/Common/Form/ListForm.qml ui/modules/Common/Form/Placements/FormEmptyLine.qml @@ -228,6 +229,7 @@ ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml ui/modules/Common/Styles/Form/ExclusiveButtonsStyle.qml ui/modules/Common/Styles/Form/Fields/NumericFieldStyle.qml + ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml ui/modules/Common/Styles/Form/ListFormStyle.qml ui/modules/Common/Styles/Form/Placements/FormGroupStyle.qml @@ -304,6 +306,7 @@ ui/views/App/Calls/IncomingCall.qml ui/views/App/Calls/OutgoingCall.qml ui/views/App/IncallFullscreen.qml + ui/views/App/InviteFriends.qml ui/views/App/Main/ContactEdit.qml ui/views/App/Main/Contacts.qml ui/views/App/Main/Conversation.qml @@ -321,6 +324,7 @@ ui/views/App/Settings/SettingsWindow.qml ui/views/App/Styles/Calls/CallStyle.qml ui/views/App/Styles/Calls/CallsWindowStyle.qml + ui/views/App/Styles/InviteFriendsStyle.qml ui/views/App/Styles/Main/ContactEditStyle.qml ui/views/App/Styles/Main/ContactsStyle.qml ui/views/App/Styles/Main/ConversationStyle.qml diff --git a/linphone-desktop/ui/modules/Common/Form/Fields/TextAreaField.qml b/linphone-desktop/ui/modules/Common/Form/Fields/TextAreaField.qml new file mode 100644 index 000000000..aeb58918f --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/Fields/TextAreaField.qml @@ -0,0 +1,46 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 + +import Common 1.0 +import Common.Styles 1.0 + +// ============================================================================= + +Flickable { + property alias text: textArea.text + readonly property alias length: textArea.length + + height: TextAreaFieldStyle.background.height + width: TextAreaFieldStyle.background.width + + TextArea.flickable: TextArea { + id: textArea + + background: Rectangle { + border { + color: TextAreaFieldStyle.background.border.color + width: TextAreaFieldStyle.background.border.width + } + + color: textArea.readOnly + ? TextAreaFieldStyle.background.color.readOnly + : TextAreaFieldStyle.background.color.normal + + radius: TextAreaFieldStyle.background.radius + } + + color: TextAreaFieldStyle.text.color + font.pointSize: TextAreaFieldStyle.text.fontSize + selectByMouse: true + wrapMode: TextArea.Wrap + + bottomPadding: TextAreaFieldStyle.text.padding + leftPadding: TextAreaFieldStyle.text.padding + rightPadding: TextAreaFieldStyle.text.padding + Number(scrollBar.visible) * scrollBar.width + topPadding: TextAreaFieldStyle.text.padding + } + + ScrollBar.vertical: ForceScrollBar { + id: scrollBar + } +} diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml new file mode 100644 index 000000000..e7c0f632d --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml @@ -0,0 +1,31 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property QtObject background: QtObject { + property int height: 36 + property int width: 200 + + property int radius: 4 + + property QtObject border: QtObject { + property color color: Colors.c + property int width: 1 + } + + property QtObject color: QtObject { + property color normal: Colors.k + property color readOnly: Colors.e + } + } + + property QtObject text: QtObject { + property color color: Colors.d + property int fontSize: 10 + property int padding: 8 + } +} diff --git a/linphone-desktop/ui/modules/Common/Styles/qmldir b/linphone-desktop/ui/modules/Common/Styles/qmldir index b4fae47fc..918c41046 100644 --- a/linphone-desktop/ui/modules/Common/Styles/qmldir +++ b/linphone-desktop/ui/modules/Common/Styles/qmldir @@ -15,6 +15,7 @@ singleton DroppableTextAreaStyle 1.0 DroppableTextAreaStyle.qml singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml singleton NumericFieldStyle 1.0 Form/Fields/NumericFieldStyle.qml +singleton TextAreaFieldStyle 1.0 Form/Fields/TextAreaFieldStyle.qml singleton TextFieldStyle 1.0 Form/Fields/TextFieldStyle.qml singleton FormGroupStyle 1.0 Form/Placements/FormGroupStyle.qml diff --git a/linphone-desktop/ui/modules/Common/View/ScrollableListView.qml b/linphone-desktop/ui/modules/Common/View/ScrollableListView.qml index c9d018808..56ed40721 100644 --- a/linphone-desktop/ui/modules/Common/View/ScrollableListView.qml +++ b/linphone-desktop/ui/modules/Common/View/ScrollableListView.qml @@ -22,8 +22,7 @@ ListView { boundsBehavior: Flickable.StopAtBounds clip: true - contentWidth: vScrollBar.visible ? width - vScrollBar.width : width contentHeight: hScrollBar.visible ? height - hScrollBar.height : height - + contentWidth: vScrollBar.visible ? width - vScrollBar.width : width spacing: 0 } diff --git a/linphone-desktop/ui/modules/Common/qmldir b/linphone-desktop/ui/modules/Common/qmldir index 11b3d4498..f7ac3b2d4 100644 --- a/linphone-desktop/ui/modules/Common/qmldir +++ b/linphone-desktop/ui/modules/Common/qmldir @@ -32,6 +32,7 @@ ForceScrollBar 1.0 ForceScrollBar.qml # Form NumericField 1.0 Form/Fields/NumericField.qml +TextAreaField 1.0 Form/Fields/TextAreaField.qml TextField 1.0 Form/Fields/TextField.qml Form 1.0 Form/Placements/Form.qml diff --git a/linphone-desktop/ui/modules/Linphone/CardBlock.qml b/linphone-desktop/ui/modules/Linphone/CardBlock.qml index 3b2a0d78e..bc95fa8de 100644 --- a/linphone-desktop/ui/modules/Linphone/CardBlock.qml +++ b/linphone-desktop/ui/modules/Linphone/CardBlock.qml @@ -25,8 +25,8 @@ Column { } Column { - width: parent.width spacing: CardBlockStyle.title.bottomMargin + width: parent.width Text { id: title diff --git a/linphone-desktop/ui/views/App/InviteFriends.qml b/linphone-desktop/ui/views/App/InviteFriends.qml new file mode 100644 index 000000000..a628f331d --- /dev/null +++ b/linphone-desktop/ui/views/App/InviteFriends.qml @@ -0,0 +1,92 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Common 1.0 + +import App.Styles 1.0 + +// ============================================================================= + +DialogPlus { + buttons: [ + TextButtonA { + text: qsTr('cancel') + + onClicked: exit(0) + }, + TextButtonB { + enabled: email.length && message.length + text: qsTr('confirm') + + onClicked: exit(-1) + } + ] + + centeredButtons: true + + height: InviteFriendsStyle.height + width: InviteFriendsStyle.width + + minimumHeight: InviteFriendsStyle.height + minimumWidth: InviteFriendsStyle.width + + // --------------------------------------------------------------------------- + + ColumnLayout { + anchors { + fill: parent + leftMargin: InviteFriendsStyle.leftMargin + rightMargin: InviteFriendsStyle.rightMargin + } + + spacing: InviteFriendsStyle.spacing + + Column { + Layout.fillWidth: true + spacing: InviteFriendsStyle.input.spacing + + Text { + color: InviteFriendsStyle.input.legend.color + elide: Text.ElideRight + + font { + bold: true + pointSize: InviteFriendsStyle.input.legend.fontSize + } + + text: qsTr('enterEmailLabel') + } + + TextField { + id: email + + width: parent.width + } + } + + ColumnLayout { + Layout.fillHeight: true + Layout.fillWidth: true + spacing: InviteFriendsStyle.input.spacing + + Text { + color: InviteFriendsStyle.input.legend.color + elide: Text.ElideRight + + font { + bold: true + pointSize: InviteFriendsStyle.input.legend.fontSize + } + + text: qsTr('messageLabel') + } + + TextAreaField { + id: message + + Layout.fillHeight: true + Layout.fillWidth: true + } + } + } +} diff --git a/linphone-desktop/ui/views/App/Main/Home.qml b/linphone-desktop/ui/views/App/Main/Home.qml index 3661a91df..44e8996dd 100644 --- a/linphone-desktop/ui/views/App/Main/Home.qml +++ b/linphone-desktop/ui/views/App/Main/Home.qml @@ -3,6 +3,7 @@ import QtQuick 2.7 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import Utils 1.0 import App.Styles 1.0 @@ -35,6 +36,7 @@ Rectangle { $component: 'button' $componentText: qsTr('inviteButton') $description: qsTr('inviteDescription') + $window: 'InviteFriends' $icon: 'home_invite_friends' $title: qsTr('inviteTitle') } @@ -45,6 +47,7 @@ Rectangle { $description: qsTr('accountAssistantDescription') $icon: 'home_account_assistant' $title: qsTr('accountAssistantTitle') + $window: 'Assistant' } } @@ -61,6 +64,7 @@ Rectangle { TextButtonB { text: $componentText + onClicked: Utils.openWindow($window, window) } } diff --git a/linphone-desktop/ui/views/App/Styles/InviteFriendsStyle.qml b/linphone-desktop/ui/views/App/Styles/InviteFriendsStyle.qml new file mode 100644 index 000000000..588ad362c --- /dev/null +++ b/linphone-desktop/ui/views/App/Styles/InviteFriendsStyle.qml @@ -0,0 +1,23 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property int height: 316 + property int leftMargin: 35 + property int rightMargin: 35 + property int spacing: 15 + 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 + } + } +} diff --git a/linphone-desktop/ui/views/App/Styles/qmldir b/linphone-desktop/ui/views/App/Styles/qmldir index a4c178390..b63a99ee5 100644 --- a/linphone-desktop/ui/views/App/Styles/qmldir +++ b/linphone-desktop/ui/views/App/Styles/qmldir @@ -4,8 +4,10 @@ module App.Styles # Views styles ----------------------------------------------------------------- -singleton CallStyle 1.0 Calls/CallStyle.qml -singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml +singleton InviteFriendsStyle 1.0 InviteFriendsStyle.qml + +singleton CallStyle 1.0 Calls/CallStyle.qml +singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml singleton ContactsStyle 1.0 Main/ContactsStyle.qml @@ -14,4 +16,4 @@ singleton HomeStyle 1.0 Main/HomeStyle.qml singleton MainWindowMenuBarStyle 1.0 Main/MainWindowMenuBarStyle.qml singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml -singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.qml +singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.qml diff --git a/linphone-desktop/ui/views/App/qmldir b/linphone-desktop/ui/views/App/qmldir index 11184ec73..497e9cf06 100644 --- a/linphone-desktop/ui/views/App/qmldir +++ b/linphone-desktop/ui/views/App/qmldir @@ -7,4 +7,5 @@ module App # Views ------------------------------------------------------------------------ IncallFullscreen 1.0 IncallFullscreen.qml -ManageAccounts 1.0 ManageAccounts.qml +InviteFriends 1.0 InviteFriends.qml +ManageAccounts 1.0 ManageAccounts.qml