From ece8e32fa48b1f5d6f16c7e5baa7142be16a26fd Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Feb 2017 17:04:21 +0100 Subject: [PATCH] feat(app): settings in progress (ui) --- linphone-desktop/assets/languages/en.ts | 81 ++++++++++++++++ linphone-desktop/assets/languages/fr.ts | 81 ++++++++++++++++ linphone-desktop/resources.qrc | 35 +++++-- linphone-desktop/src/app/App.cpp | 46 ++++++--- linphone-desktop/src/app/App.hpp | 6 +- .../ui/modules/Common/Form/Form.qml | 41 ++++++++ .../ui/modules/Common/Form/FormGroup.qml | 42 ++++++++ .../ui/modules/Common/Form/Tab/TabBar.qml | 6 ++ .../ui/modules/Common/Form/Tab/TabButton.qml | 67 +++++++++++++ .../modules/Common/Form/Tab/TabContainer.qml | 25 +++++ .../ui/modules/Common/Form/TextField.qml | 1 + .../ui/modules/Common/Image/RoundedImage.qml | 4 +- .../Common/Styles/Form/FormGroupStyle.qml | 22 +++++ .../modules/Common/Styles/Form/FormStyle.qml | 25 +++++ .../Common/Styles/Form/Tab/TabButtonStyle.qml | 29 ++++++ .../Styles/Form/Tab/TabContainerStyle.qml | 14 +++ .../Common/Styles/Form/TextFieldStyle.qml | 2 + .../ui/modules/Common/Styles/qmldir | 5 + linphone-desktop/ui/modules/Common/qmldir | 6 ++ .../NotificationReceivedCallStyle.qml | 10 +- .../NotificationReceivedFileMessageStyle.qml | 32 +++--- .../ui/views/App/Calls/CallsWindow.qml | 2 +- .../ui/views/App/Calls/Incall.qml | 6 +- .../ui/views/App/IncallFullscreen.qml | 12 +-- .../App/{MainWindow => Main}/ContactEdit.qml | 0 .../App/{MainWindow => Main}/Contacts.qml | 0 .../App/{MainWindow => Main}/Conversation.qml | 0 .../views/App/{MainWindow => Main}/Home.qml | 0 .../App/{MainWindow => Main}/MainWindow.qml | 0 .../ui/views/App/Settings/SettingsAudio.qml | 9 ++ .../views/App/Settings/SettingsCallsChat.qml | 53 ++++++++++ .../ui/views/App/Settings/SettingsNetwork.qml | 9 ++ .../App/Settings/SettingsSipAccounts.qml | 9 ++ .../ui/views/App/Settings/SettingsUi.qml | 9 ++ .../ui/views/App/Settings/SettingsVideo.qml | 9 ++ .../ui/views/App/Settings/SettingsWindow.qml | 97 +++++++++++++++++++ .../App/Styles/Calls/CallsWindowStyle.qml | 1 - .../{MainWindow => Main}/ContactEditStyle.qml | 0 .../{MainWindow => Main}/ContactsStyle.qml | 0 .../ConversationStyle.qml | 0 .../{MainWindow => Main}/MainWindowStyle.qml | 0 .../Styles/Settings/SettingsWindowStyle.qml | 14 +++ linphone-desktop/ui/views/App/Styles/qmldir | 14 +-- 43 files changed, 758 insertions(+), 66 deletions(-) create mode 100644 linphone-desktop/ui/modules/Common/Form/Form.qml create mode 100644 linphone-desktop/ui/modules/Common/Form/FormGroup.qml create mode 100644 linphone-desktop/ui/modules/Common/Form/Tab/TabBar.qml create mode 100644 linphone-desktop/ui/modules/Common/Form/Tab/TabButton.qml create mode 100644 linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml create mode 100644 linphone-desktop/ui/modules/Common/Styles/Form/FormGroupStyle.qml create mode 100644 linphone-desktop/ui/modules/Common/Styles/Form/FormStyle.qml create mode 100644 linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml create mode 100644 linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml rename linphone-desktop/ui/views/App/{MainWindow => Main}/ContactEdit.qml (100%) rename linphone-desktop/ui/views/App/{MainWindow => Main}/Contacts.qml (100%) rename linphone-desktop/ui/views/App/{MainWindow => Main}/Conversation.qml (100%) rename linphone-desktop/ui/views/App/{MainWindow => Main}/Home.qml (100%) rename linphone-desktop/ui/views/App/{MainWindow => Main}/MainWindow.qml (100%) create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsAudio.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsUi.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsVideo.qml create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsWindow.qml rename linphone-desktop/ui/views/App/Styles/{MainWindow => Main}/ContactEditStyle.qml (100%) rename linphone-desktop/ui/views/App/Styles/{MainWindow => Main}/ContactsStyle.qml (100%) rename linphone-desktop/ui/views/App/Styles/{MainWindow => Main}/ConversationStyle.qml (100%) rename linphone-desktop/ui/views/App/Styles/{MainWindow => Main}/MainWindowStyle.qml (100%) create mode 100644 linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index c2bbcbd13..fb0deede5 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -51,6 +51,13 @@ PAUSE CALL + + CallsWindow + + callsTitle + Calls + + Chat @@ -503,6 +510,80 @@ Server url not configured. Search contact or enter SIP address + + SettingsCallsChat + + fileServerLabel + File server + + + encryptWithLimeLabel + Encrypt with LIME + + + limeDisabled + Disabled + + + limeRequired + Requis + + + limePreferred + Preferred + + + chatTitle + Chat + + + callsTitle + Calls + + + encryptionLabel + Encryption + + + noEncryption + None + + + + SettingsWindow + + settingsTitle + Linphone - Settings + + + sipAccountsTab + SIP accounts + + + audioTab + Audio + + + videoTab + Video + + + callsAndChatTab + Calls and Chat + + + networkTab + Network + + + uiTab + User Interface + + + validButton + OK + + SmartSearchBar diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index feb66dabf..493d9e14a 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -43,6 +43,13 @@ PAUSE + + CallsWindow + + callsTitle + Appels + + Chat @@ -513,6 +520,80 @@ Url du serveur non configurée. Rechercher un contact ou entrer une adresse SIP + + SettingsCallsChat + + fileServerLabel + Serveur de partage + + + encryptWithLimeLabel + Chiffrer avec LIME + + + limeDisabled + Désactivé + + + limeRequired + Obligatoire + + + limePreferred + Préféré + + + chatTitle + Chat + + + callsTitle + Appels + + + encryptionLabel + Chiffrement + + + noEncryption + Aucune + + + + SettingsWindow + + settingsTitle + Linphone - Paramètres + + + sipAccountsTab + Comptes SIP + + + audioTab + Audio + + + videoTab + Vidéo + + + callsAndChatTab + Appels et Chat + + + networkTab + Réseau + + + uiTab + Interface Utilisateur + + + validButton + OK + + SmartSearchBar diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index f7423c29f..4678865b8 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -167,9 +167,14 @@ ui/modules/Common/Form/ActionSwitch.qml ui/modules/Common/Form/CheckBoxText.qml ui/modules/Common/Form/ExclusiveButtons.qml + ui/modules/Common/Form/FormGroup.qml + ui/modules/Common/Form/Form.qml ui/modules/Common/Form/ListForm.qml ui/modules/Common/Form/SmallButton.qml ui/modules/Common/Form/StaticListForm.qml + ui/modules/Common/Form/Tab/TabBar.qml + ui/modules/Common/Form/Tab/TabButton.qml + ui/modules/Common/Form/Tab/TabContainer.qml ui/modules/Common/Form/TextButtonA.qml ui/modules/Common/Form/TextButtonB.qml ui/modules/Common/Form/TextField.qml @@ -200,8 +205,12 @@ ui/modules/Common/Styles/Form/ActionBarStyle.qml ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml ui/modules/Common/Styles/Form/ExclusiveButtonsStyle.qml + ui/modules/Common/Styles/Form/FormGroupStyle.qml + ui/modules/Common/Styles/Form/FormStyle.qml ui/modules/Common/Styles/Form/ListFormStyle.qml ui/modules/Common/Styles/Form/SmallButtonStyle.qml + ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml + ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml ui/modules/Common/Styles/Form/TextButtonAStyle.qml ui/modules/Common/Styles/Form/TextButtonBStyle.qml ui/modules/Common/Styles/Form/TextFieldStyle.qml @@ -266,19 +275,27 @@ ui/views/App/Calls/IncomingCall.qml ui/views/App/Calls/OutgoingCall.qml ui/views/App/IncallFullscreen.qml - ui/views/App/MainWindow/ContactEdit.qml - ui/views/App/MainWindow/Contacts.qml - ui/views/App/MainWindow/Conversation.qml - ui/views/App/MainWindow/Home.qml - ui/views/App/MainWindow/MainWindow.qml + ui/views/App/Main/ContactEdit.qml + ui/views/App/Main/Contacts.qml + ui/views/App/Main/Conversation.qml + ui/views/App/Main/Home.qml + ui/views/App/Main/MainWindow.qml ui/views/App/ManageAccounts.qml ui/views/App/qmldir + ui/views/App/Settings/SettingsAudio.qml + ui/views/App/Settings/SettingsCallsChat.qml + ui/views/App/Settings/SettingsNetwork.qml + ui/views/App/Settings/SettingsSipAccounts.qml + ui/views/App/Settings/SettingsUi.qml + ui/views/App/Settings/SettingsVideo.qml + ui/views/App/Settings/SettingsWindow.qml ui/views/App/Styles/Calls/CallStyle.qml ui/views/App/Styles/Calls/CallsWindowStyle.qml - ui/views/App/Styles/MainWindow/ContactEditStyle.qml - ui/views/App/Styles/MainWindow/ContactsStyle.qml - ui/views/App/Styles/MainWindow/ConversationStyle.qml - ui/views/App/Styles/MainWindow/MainWindowStyle.qml + ui/views/App/Styles/Main/ContactEditStyle.qml + ui/views/App/Styles/Main/ContactsStyle.qml + ui/views/App/Styles/Main/ConversationStyle.qml + ui/views/App/Styles/Main/MainWindowStyle.qml ui/views/App/Styles/qmldir + ui/views/App/Styles/Settings/SettingsWindowStyle.qml diff --git a/linphone-desktop/src/app/App.cpp b/linphone-desktop/src/app/App.cpp index f042a69a7..42e270a8c 100644 --- a/linphone-desktop/src/app/App.cpp +++ b/linphone-desktop/src/app/App.cpp @@ -41,9 +41,10 @@ #define LANGUAGES_PATH ":/languages/" #define WINDOW_ICON_PATH ":/assets/images/linphone.png" -// The two main windows of Linphone desktop. -#define QML_VIEW_MAIN_WINDOW "qrc:/ui/views/App/MainWindow/MainWindow.qml" -#define QML_VIEW_CALL_WINDOW "qrc:/ui/views/App/Calls/CallsWindow.qml" +// The main windows of Linphone desktop. +#define QML_VIEW_MAIN_WINDOW "qrc:/ui/views/App/Main/MainWindow.qml" +#define QML_VIEW_CALLS_WINDOW "qrc:/ui/views/App/Calls/CallsWindow.qml" +#define QML_VIEW_SETTINGS_WINDOW "qrc:/ui/views/App/Settings/SettingsWindow.qml" // ============================================================================= @@ -85,11 +86,7 @@ App::App (int &argc, char **argv) : QApplication(argc, argv) { // ----------------------------------------------------------------------------- QQuickWindow *App::getCallsWindow () const { - QQuickWindow *window = m_engine.rootContext()->contextProperty("CallsWindow").value(); - if (!window) - qFatal("Unable to get calls window."); - - return window; + return m_calls_window; } QQuickWindow *App::getMainWindow () const { @@ -97,8 +94,14 @@ QQuickWindow *App::getMainWindow () const { return qobject_cast(engine.rootObjects().at(0)); } +QQuickWindow *App::getSettingsWindow () const { + return m_settings_window; +} + +// ----------------------------------------------------------------------------- + bool App::hasFocus () const { - return getMainWindow()->isActive() || getCallsWindow()->isActive(); + return getMainWindow()->isActive() || m_calls_window->isActive(); } // ----------------------------------------------------------------------------- @@ -108,9 +111,9 @@ void App::initContentApp () { CoreManager::init(); qInfo() << "Core manager initialized."; - // Register types and load context properties. + // Register types ans make sub windows. registerTypes(); - addContextProperties(); + createSubWindows(); // Enable notifications. m_notifier = new Notifier(); @@ -130,6 +133,8 @@ void App::initContentApp () { setTrayIcon(); } +// ----------------------------------------------------------------------------- + void App::registerTypes () { qInfo() << "Registering types..."; @@ -214,19 +219,28 @@ void App::registerTypes () { qRegisterMetaType("ChatModel::EntryType"); } -void App::addContextProperties () { - qInfo() << "Adding context properties..."; - QQmlContext *context = m_engine.rootContext(); +// ----------------------------------------------------------------------------- - QQmlComponent component(&m_engine, QUrl(QML_VIEW_CALL_WINDOW)); +inline QQuickWindow *createSubWindow (QQmlApplicationEngine &engine, const char *path) { + QQmlComponent component(&engine, QUrl(path)); if (component.isError()) { qWarning() << component.errors(); abort(); } - context->setContextProperty("CallsWindow", component.create()); + // Default Ownership is Cpp: http://doc.qt.io/qt-5/qqmlengine.html#ObjectOwnership-enum + return qobject_cast(component.create()); } +void App::createSubWindows () { + qInfo() << "Create sub windows..."; + + m_calls_window = createSubWindow(m_engine, QML_VIEW_CALLS_WINDOW); + m_settings_window = createSubWindow(m_engine, QML_VIEW_SETTINGS_WINDOW); +} + +// ----------------------------------------------------------------------------- + void App::setTrayIcon () { QQuickWindow *root = getMainWindow(); QMenu *menu = new QMenu(); diff --git a/linphone-desktop/src/app/App.hpp b/linphone-desktop/src/app/App.hpp index c79549520..62e5b4d22 100644 --- a/linphone-desktop/src/app/App.hpp +++ b/linphone-desktop/src/app/App.hpp @@ -50,6 +50,7 @@ public: QQuickWindow *getCallsWindow () const; QQuickWindow *getMainWindow () const; + QQuickWindow *getSettingsWindow () const; bool hasFocus () const; @@ -76,7 +77,7 @@ private: void initContentApp (); void registerTypes (); - void addContextProperties (); + void createSubWindows (); void setTrayIcon (); QQmlApplicationEngine m_engine; @@ -91,6 +92,9 @@ private: Notifier *m_notifier = nullptr; QString m_locale = "en"; + QQuickWindow *m_calls_window = nullptr; + QQuickWindow *m_settings_window = nullptr; + static App *m_instance; }; diff --git a/linphone-desktop/ui/modules/Common/Form/Form.qml b/linphone-desktop/ui/modules/Common/Form/Form.qml new file mode 100644 index 000000000..4980c3641 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/Form.qml @@ -0,0 +1,41 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Common.Styles 1.0 + +// ============================================================================= + +Column { + property alias title: title.text + + // --------------------------------------------------------------------------- + + spacing: FormStyle.spacing + + ColumnLayout { + width: parent.width + + spacing: FormStyle.header.spacing + + Text { + id: title + + color: FormStyle.header.title.color + font { + bold: true + pointSize: FormStyle.header.title.fontSize + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: FormStyle.header.separator.height + + color: FormStyle.header.separator.color + } + + Item { + height: FormStyle.header.bottomMargin + } + } +} diff --git a/linphone-desktop/ui/modules/Common/Form/FormGroup.qml b/linphone-desktop/ui/modules/Common/Form/FormGroup.qml new file mode 100644 index 000000000..52e0f087b --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/FormGroup.qml @@ -0,0 +1,42 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Common.Styles 1.0 + +// ============================================================================= + +RowLayout { + property alias label: label.text + + default property alias _content: content.data + + // --------------------------------------------------------------------------- + + spacing: FormGroupStyle.spacing + + Text { + id: label + + Layout.preferredHeight: FormGroupStyle.legend.height + Layout.preferredWidth: FormGroupStyle.legend.width + + color: FormGroupStyle.legend.color + font.pointSize: FormGroupStyle.legend.fontSize + + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + + Item { + id: content + + Layout.alignment: { + var height = _content[0].height + return height < label.height ? Qt.AlignVCenter : Qt.AlignTop + } + + Layout.maximumWidth: FormGroupStyle.content.width + Layout.preferredHeight: _content[0].height + Layout.preferredWidth: FormGroupStyle.content.width + } +} diff --git a/linphone-desktop/ui/modules/Common/Form/Tab/TabBar.qml b/linphone-desktop/ui/modules/Common/Form/Tab/TabBar.qml new file mode 100644 index 000000000..257da8878 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/Tab/TabBar.qml @@ -0,0 +1,6 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.1 + +// ============================================================================= + +TabBar {} diff --git a/linphone-desktop/ui/modules/Common/Form/Tab/TabButton.qml b/linphone-desktop/ui/modules/Common/Form/Tab/TabButton.qml new file mode 100644 index 000000000..2f0a22e95 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/Tab/TabButton.qml @@ -0,0 +1,67 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.1 + +import Common.Styles 1.0 + +// ============================================================================= + +TabButton { + id: button + + // --------------------------------------------------------------------------- + + function _getBackgroundColor () { + if (button.parent.parent.currentItem === button) { + return TabButtonStyle.backgroundColor.selected + } + + return button.down + ? TabButtonStyle.backgroundColor.pressed + : ( + button.hovered + ? TabButtonStyle.backgroundColor.hovered + : TabButtonStyle.backgroundColor.normal + ) + } + + function _getTextColor () { + if (button.parent.parent.currentItem === button) { + return TabButtonStyle.text.color.selected + } + + return button.down + ? TabButtonStyle.text.color.pressed + : ( + button.hovered + ? TabButtonStyle.text.color.hovered + : TabButtonStyle.text.color.normal + ) + } + + // --------------------------------------------------------------------------- + + background: Rectangle { + color: _getBackgroundColor() + implicitHeight: TabButtonStyle.text.height + } + + contentItem: Text { + color: _getTextColor() + + font { + bold: true + pointSize: TabButtonStyle.text.fontSize + } + + elide: Text.ElideRight + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + leftPadding: TabButtonStyle.text.leftPadding + rightPadding: TabButtonStyle.text.rightPadding + text: button.text + } + + hoverEnabled: true +} diff --git a/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml b/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml new file mode 100644 index 000000000..9bdce5f07 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml @@ -0,0 +1,25 @@ +import QtQuick 2.7 + +import Common.Styles 1.0 + +// ============================================================================= + +Rectangle { + default property alias _content: content.data + + anchors.fill: parent + color: TabContainerStyle.color + + Item { + id: content + + anchors { + fill: parent + + bottomMargin: TabContainerStyle.bottomMargin + leftMargin: TabContainerStyle.leftMargin + rightMargin: TabContainerStyle.rightMargin + topMargin: TabContainerStyle.topMargin + } + } +} diff --git a/linphone-desktop/ui/modules/Common/Form/TextField.qml b/linphone-desktop/ui/modules/Common/Form/TextField.qml index 939474eba..6604961e0 100644 --- a/linphone-desktop/ui/modules/Common/Form/TextField.qml +++ b/linphone-desktop/ui/modules/Common/Form/TextField.qml @@ -18,6 +18,7 @@ Controls.TextField { } color: TextFieldStyle.background.color implicitHeight: TextFieldStyle.background.height + implicitWidth: TextFieldStyle.background.width radius: TextFieldStyle.background.radius } diff --git a/linphone-desktop/ui/modules/Common/Image/RoundedImage.qml b/linphone-desktop/ui/modules/Common/Image/RoundedImage.qml index d736cc98b..75444ad26 100644 --- a/linphone-desktop/ui/modules/Common/Image/RoundedImage.qml +++ b/linphone-desktop/ui/modules/Common/Image/RoundedImage.qml @@ -37,8 +37,8 @@ Item { // See: https://www.opengl.org/sdk/docs/man/html/mix.xhtml fragmentShader: ' #ifdef GL_ES - precision lowp float; - #endif + precision lowp float; + #endif uniform sampler2D image; uniform sampler2D mask; uniform vec4 backgroundColor; diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/FormGroupStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/FormGroupStyle.qml new file mode 100644 index 000000000..62ec85e53 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Styles/Form/FormGroupStyle.qml @@ -0,0 +1,22 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property int spacing: 20 + + property QtObject content: QtObject { + property int height: 300 + property int width: 300 + } + + property QtObject legend: QtObject { + property color color: Colors.j + property int fontSize: 10 + property int height: 36 + property int width: 150 + } +} diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/FormStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/FormStyle.qml new file mode 100644 index 000000000..f489e1592 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Styles/Form/FormStyle.qml @@ -0,0 +1,25 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property int spacing: 10 + + property QtObject header: QtObject { + property int bottomMargin: 5 + property int spacing: 5 + + property QtObject separator: QtObject { + property color color: Colors.i + property int height: 2 + } + + property QtObject title: QtObject { + property color color: Colors.i + property int fontSize: 12 + } + } +} diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml new file mode 100644 index 000000000..25991fe90 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml @@ -0,0 +1,29 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property QtObject backgroundColor: QtObject { + property color hovered: Colors.s + property color normal: Colors.i + property color pressed: Colors.t + property color selected: Colors.k + } + + property QtObject text: QtObject { + property int fontSize: 9 + property int height: 40 + property int leftPadding: 10 + property int rightPadding: 10 + + property QtObject color: QtObject { + property color hovered: Colors.k + property color normal: Colors.k + property color pressed: Colors.k + property color selected: Colors.i + } + } +} diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml new file mode 100644 index 000000000..4f198fae5 --- /dev/null +++ b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml @@ -0,0 +1,14 @@ +pragma Singleton +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +QtObject { + property color color: Colors.k + property int bottomMargin: 15 + property int leftMargin: 30 + property int rightMargin: 30 + property int topMargin: 30 +} diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/TextFieldStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/TextFieldStyle.qml index 3eb3134db..505bcf433 100644 --- a/linphone-desktop/ui/modules/Common/Styles/Form/TextFieldStyle.qml +++ b/linphone-desktop/ui/modules/Common/Styles/Form/TextFieldStyle.qml @@ -9,6 +9,8 @@ QtObject { property QtObject background: QtObject { property color color: Colors.k property int height: 36 + property int width: 300 + property int radius: 4 property QtObject border: QtObject { diff --git a/linphone-desktop/ui/modules/Common/Styles/qmldir b/linphone-desktop/ui/modules/Common/Styles/qmldir index c46e94dff..a52ecdc05 100644 --- a/linphone-desktop/ui/modules/Common/Styles/qmldir +++ b/linphone-desktop/ui/modules/Common/Styles/qmldir @@ -16,10 +16,15 @@ singleton DroppableTextAreaStyle 1.0 DroppableTextAreaStyle.qml singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml +singleton TabButtonStyle 1.0 Form/Tab/TabButtonStyle.qml +singleton TabContainerStyle 1.0 Form/Tab/TabContainerStyle.qml + singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml singleton CheckBoxTextStyle 1.0 Form/CheckBoxTextStyle.qml singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml +singleton FormStyle 1.0 Form/FormStyle.qml +singleton FormGroupStyle 1.0 Form/FormGroupStyle.qml singleton ListFormStyle 1.0 Form/ListFormStyle.qml singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml diff --git a/linphone-desktop/ui/modules/Common/qmldir b/linphone-desktop/ui/modules/Common/qmldir index 0830b2ed8..7631bbf95 100644 --- a/linphone-desktop/ui/modules/Common/qmldir +++ b/linphone-desktop/ui/modules/Common/qmldir @@ -31,11 +31,17 @@ DroppableTextArea 1.0 DroppableTextArea.qml ForceScrollBar 1.0 ForceScrollBar.qml # Form +TabBar 1.0 Form/Tab/TabBar.qml +TabButton 1.0 Form/Tab/TabButton.qml +TabContainer 1.0 Form/Tab/TabContainer.qml + ActionBar 1.0 Form/ActionBar.qml ActionButton 1.0 Form/ActionButton.qml ActionSwitch 1.0 Form/ActionSwitch.qml CheckBoxText 1.0 Form/CheckBoxText.qml ExclusiveButtons 1.0 Form/ExclusiveButtons.qml +Form 1.0 Form/Form.qml +FormGroup 1.0 Form/FormGroup.qml LightButton 1.0 Form/LightButton.qml ListForm 1.0 Form/ListForm.qml StaticListForm 1.0 Form/StaticListForm.qml diff --git a/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml b/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml index 041149984..ca71bc9bd 100644 --- a/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml +++ b/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml @@ -6,11 +6,11 @@ import Common 1.0 // ============================================================================= QtObject { - property color color: Colors.k - property int height: 120 - property int iconSize: 40 - property int spacing: 0 - property int width: 300 + property color color: Colors.k + property int height: 120 + property int iconSize: 40 + property int spacing: 0 + property int width: 300 property int bottomMargin: 15 property int leftMargin: 15 property int rightMargin: 15 diff --git a/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml b/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml index 4f63c33fd..f092c5595 100644 --- a/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml +++ b/linphone-desktop/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml @@ -6,22 +6,22 @@ import Common 1.0 // ============================================================================= QtObject { - property color color: Colors.k - property int height: 55 - property int iconSize: 40 - property int leftMargin: 25 - property int rightMargin: 15 - property int spacing: 10 - property int width: 300 + property color color: Colors.k + property int height: 55 + property int iconSize: 40 + property int leftMargin: 25 + property int rightMargin: 15 + property int spacing: 10 + property int width: 300 - property QtObject fileName: QtObject { - property color color: Colors.h - property int fontSize: 10 - } + property QtObject fileName: QtObject { + property color color: Colors.h + property int fontSize: 10 + } - property QtObject fileSize: QtObject { - property color color: Colors.h - property int fontSize: 9 - property int width: 100 - } + property QtObject fileSize: QtObject { + property color color: Colors.h + property int fontSize: 9 + property int width: 100 + } } diff --git a/linphone-desktop/ui/views/App/Calls/CallsWindow.qml b/linphone-desktop/ui/views/App/Calls/CallsWindow.qml index 1037ce9a1..b08e01a4c 100644 --- a/linphone-desktop/ui/views/App/Calls/CallsWindow.qml +++ b/linphone-desktop/ui/views/App/Calls/CallsWindow.qml @@ -34,7 +34,7 @@ Window { minimumHeight: CallsWindowStyle.minimumHeight minimumWidth: CallsWindowStyle.minimumWidth - title: CallsWindowStyle.title + title: qsTr('callsTitle') Paned { anchors.fill: parent diff --git a/linphone-desktop/ui/views/App/Calls/Incall.qml b/linphone-desktop/ui/views/App/Calls/Incall.qml index e5b713ece..15f3800d0 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.qml +++ b/linphone-desktop/ui/views/App/Calls/Incall.qml @@ -359,14 +359,14 @@ Rectangle { } ActionSwitch { - enabled: CallsWindow.chatIsOpened + enabled: window.chatIsOpened icon: 'chat' onClicked: { if (enabled) { - CallsWindow.closeChat() + window.closeChat() } else { - CallsWindow.openChat() + window.openChat() } } } diff --git a/linphone-desktop/ui/views/App/IncallFullscreen.qml b/linphone-desktop/ui/views/App/IncallFullscreen.qml index 1ecae5ae0..050a0c8a2 100644 --- a/linphone-desktop/ui/views/App/IncallFullscreen.qml +++ b/linphone-desktop/ui/views/App/IncallFullscreen.qml @@ -21,13 +21,13 @@ Window { // --------------------------------------------------------------------------- - function _exit (cb) { - incall.close() + function _exit (cb) { + incall.close() - if (cb) { - cb() - } - } + if (cb) { + cb() + } + } // --------------------------------------------------------------------------- diff --git a/linphone-desktop/ui/views/App/MainWindow/ContactEdit.qml b/linphone-desktop/ui/views/App/Main/ContactEdit.qml similarity index 100% rename from linphone-desktop/ui/views/App/MainWindow/ContactEdit.qml rename to linphone-desktop/ui/views/App/Main/ContactEdit.qml diff --git a/linphone-desktop/ui/views/App/MainWindow/Contacts.qml b/linphone-desktop/ui/views/App/Main/Contacts.qml similarity index 100% rename from linphone-desktop/ui/views/App/MainWindow/Contacts.qml rename to linphone-desktop/ui/views/App/Main/Contacts.qml diff --git a/linphone-desktop/ui/views/App/MainWindow/Conversation.qml b/linphone-desktop/ui/views/App/Main/Conversation.qml similarity index 100% rename from linphone-desktop/ui/views/App/MainWindow/Conversation.qml rename to linphone-desktop/ui/views/App/Main/Conversation.qml diff --git a/linphone-desktop/ui/views/App/MainWindow/Home.qml b/linphone-desktop/ui/views/App/Main/Home.qml similarity index 100% rename from linphone-desktop/ui/views/App/MainWindow/Home.qml rename to linphone-desktop/ui/views/App/Main/Home.qml diff --git a/linphone-desktop/ui/views/App/MainWindow/MainWindow.qml b/linphone-desktop/ui/views/App/Main/MainWindow.qml similarity index 100% rename from linphone-desktop/ui/views/App/MainWindow/MainWindow.qml rename to linphone-desktop/ui/views/App/Main/MainWindow.qml diff --git a/linphone-desktop/ui/views/App/Settings/SettingsAudio.qml b/linphone-desktop/ui/views/App/Settings/SettingsAudio.qml new file mode 100644 index 000000000..f5c0de773 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsAudio.qml @@ -0,0 +1,9 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml b/linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml new file mode 100644 index 000000000..3ba05db70 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml @@ -0,0 +1,53 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + Column { + anchors.fill: parent + spacing: 10 + + Form { + title: qsTr('callsTitle') + width: parent.width + + FormGroup { + label: qsTr('encryptionLabel') + + ExclusiveButtons { + texts: [ + qsTr('noEncryption'), + 'SRTP', + 'ZRTP', + 'DTLS' + ] + } + } + } + + Form { + title: qsTr('chatTitle') + width: parent.width + + FormGroup { + label: qsTr('fileServerLabel') + + TextField {} + } + + FormGroup { + label: qsTr('encryptWithLimeLabel') + + ExclusiveButtons { + texts: [ + qsTr('limeDisabled'), + qsTr('limeRequired'), + qsTr('limePreferred') + ] + } + } + } + } +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml b/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml new file mode 100644 index 000000000..f5c0de773 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml @@ -0,0 +1,9 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml new file mode 100644 index 000000000..f5c0de773 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml @@ -0,0 +1,9 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsUi.qml b/linphone-desktop/ui/views/App/Settings/SettingsUi.qml new file mode 100644 index 000000000..f5c0de773 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsUi.qml @@ -0,0 +1,9 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml b/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml new file mode 100644 index 000000000..f5c0de773 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml @@ -0,0 +1,9 @@ +import QtQuick 2.7 + +import Common 1.0 + +// ============================================================================= + +TabContainer { + +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml b/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml new file mode 100644 index 000000000..270e132a3 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml @@ -0,0 +1,97 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.3 + +import Common 1.0 + +import App.Styles 1.0 + +// ============================================================================= + +ApplicationWindow { + height: SettingsWindowStyle.height + width: SettingsWindowStyle.width + + maximumHeight: height + maximumWidth: width + + minimumHeight: height + minimumWidth: width + + title: qsTr('settingsTitle') + visible: true + + ColumnLayout { + anchors.fill: parent + spacing: 0 + + // ------------------------------------------------------------------------- + // Navigation bar. + // ------------------------------------------------------------------------- + + TabBar { + id: navigationBar + + Layout.fillWidth: true + + TabButton { + text: qsTr('sipAccountsTab') + width: implicitWidth + } + + TabButton { + text: qsTr('audioTab') + width: implicitWidth + } + + TabButton { + text: qsTr('videoTab') + width: implicitWidth + } + + TabButton { + text: qsTr('callsAndChatTab') + width: implicitWidth + } + + TabButton { + text: qsTr('networkTab') + width: implicitWidth + } + + TabButton { + text: qsTr('uiTab') + width: implicitWidth + } + } + + // ------------------------------------------------------------------------- + // Content. + // ------------------------------------------------------------------------- + + StackLayout { + Layout.fillHeight: true + Layout.fillWidth: true + currentIndex: navigationBar.currentIndex + + SettingsSipAccounts {} + SettingsAudio {} + SettingsVideo {} + SettingsCallsChat {} + SettingsNetwork {} + SettingsUi {} + } + + // ------------------------------------------------------------------------- + // Buttons. + // ------------------------------------------------------------------------- + + TextButtonB { + Layout.alignment: Qt.AlignRight + Layout.bottomMargin: SettingsWindowStyle.validButton.bottomMargin + Layout.rightMargin: SettingsWindowStyle.validButton.rightMargin + + text: qsTr('validButton') + } + } +} diff --git a/linphone-desktop/ui/views/App/Styles/Calls/CallsWindowStyle.qml b/linphone-desktop/ui/views/App/Styles/Calls/CallsWindowStyle.qml index 21563a8f2..6dfe9c3a2 100644 --- a/linphone-desktop/ui/views/App/Styles/Calls/CallsWindowStyle.qml +++ b/linphone-desktop/ui/views/App/Styles/Calls/CallsWindowStyle.qml @@ -8,7 +8,6 @@ import Common 1.0 QtObject { property int minimumHeight: 480 property int minimumWidth: 960 - property string title: 'Linphone' property QtObject call: QtObject { property int minimumWidth: 395 diff --git a/linphone-desktop/ui/views/App/Styles/MainWindow/ContactEditStyle.qml b/linphone-desktop/ui/views/App/Styles/Main/ContactEditStyle.qml similarity index 100% rename from linphone-desktop/ui/views/App/Styles/MainWindow/ContactEditStyle.qml rename to linphone-desktop/ui/views/App/Styles/Main/ContactEditStyle.qml diff --git a/linphone-desktop/ui/views/App/Styles/MainWindow/ContactsStyle.qml b/linphone-desktop/ui/views/App/Styles/Main/ContactsStyle.qml similarity index 100% rename from linphone-desktop/ui/views/App/Styles/MainWindow/ContactsStyle.qml rename to linphone-desktop/ui/views/App/Styles/Main/ContactsStyle.qml diff --git a/linphone-desktop/ui/views/App/Styles/MainWindow/ConversationStyle.qml b/linphone-desktop/ui/views/App/Styles/Main/ConversationStyle.qml similarity index 100% rename from linphone-desktop/ui/views/App/Styles/MainWindow/ConversationStyle.qml rename to linphone-desktop/ui/views/App/Styles/Main/ConversationStyle.qml diff --git a/linphone-desktop/ui/views/App/Styles/MainWindow/MainWindowStyle.qml b/linphone-desktop/ui/views/App/Styles/Main/MainWindowStyle.qml similarity index 100% rename from linphone-desktop/ui/views/App/Styles/MainWindow/MainWindowStyle.qml rename to linphone-desktop/ui/views/App/Styles/Main/MainWindowStyle.qml diff --git a/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml new file mode 100644 index 000000000..f258ee565 --- /dev/null +++ b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml @@ -0,0 +1,14 @@ +pragma Singleton +import QtQuick 2.7 + +// ============================================================================= + +QtObject { + property int height: 480 + property int width: 800 + + property QtObject validButton: QtObject { + property int bottomMargin: 30 + property int rightMargin: 30 + } +} diff --git a/linphone-desktop/ui/views/App/Styles/qmldir b/linphone-desktop/ui/views/App/Styles/qmldir index da4ddc7f1..620fd346b 100644 --- a/linphone-desktop/ui/views/App/Styles/qmldir +++ b/linphone-desktop/ui/views/App/Styles/qmldir @@ -4,10 +4,12 @@ module App.Styles # Views styles ----------------------------------------------------------------- -singleton CallStyle 1.0 Calls/CallStyle.qml -singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml +singleton CallStyle 1.0 Calls/CallStyle.qml +singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml -singleton ContactEditStyle 1.0 MainWindow/ContactEditStyle.qml -singleton ContactsStyle 1.0 MainWindow/ContactsStyle.qml -singleton ConversationStyle 1.0 MainWindow/ConversationStyle.qml -singleton MainWindowStyle 1.0 MainWindow/MainWindowStyle.qml +singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml +singleton ContactsStyle 1.0 Main/ContactsStyle.qml +singleton ConversationStyle 1.0 Main/ConversationStyle.qml +singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml + +singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.qml