Commit d35ca30b authored by Ronan Abhamon's avatar Ronan Abhamon

test

parent b81f52dd
...@@ -303,6 +303,7 @@ ...@@ -303,6 +303,7 @@
<file>ui/views/App/Main/Contacts.qml</file> <file>ui/views/App/Main/Contacts.qml</file>
<file>ui/views/App/Main/Conversation.qml</file> <file>ui/views/App/Main/Conversation.qml</file>
<file>ui/views/App/Main/Home.qml</file> <file>ui/views/App/Main/Home.qml</file>
<file>ui/views/App/Main/MainWindowMenuBar.qml</file>
<file>ui/views/App/Main/MainWindow.qml</file> <file>ui/views/App/Main/MainWindow.qml</file>
<file>ui/views/App/ManageAccounts.qml</file> <file>ui/views/App/ManageAccounts.qml</file>
<file>ui/views/App/qmldir</file> <file>ui/views/App/qmldir</file>
......
...@@ -2,6 +2,8 @@ import QtQuick 2.7 ...@@ -2,6 +2,8 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4 as Controls1
import Common 1.0 import Common 1.0
import Linphone 1.0 import Linphone 1.0
import Utils 1.0 import Utils 1.0
...@@ -10,7 +12,7 @@ import App.Styles 1.0 ...@@ -10,7 +12,7 @@ import App.Styles 1.0
// ============================================================================= // =============================================================================
ApplicationWindow { Controls1.ApplicationWindow {
id: window id: window
property string _currentView: '' property string _currentView: ''
...@@ -62,7 +64,7 @@ ApplicationWindow { ...@@ -62,7 +64,7 @@ ApplicationWindow {
} }
function _setView (view, props) { function _setView (view, props) {
window.show() window.setVisible(true)
window.requestActivate() window.requestActivate()
collapse.setCollapsed(true) collapse.setCollapsed(true)
...@@ -84,145 +86,160 @@ ApplicationWindow { ...@@ -84,145 +86,160 @@ ApplicationWindow {
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu() onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Toolbar properties. // Menu bar.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
header: ToolBar { menuBar: MainWindowMenuBar {}
background: MainWindowStyle.toolBar.background
height: MainWindowStyle.toolBar.height
RowLayout {
anchors {
fill: parent
leftMargin: MainWindowStyle.toolBar.leftMargin
rightMargin: MainWindowStyle.toolBar.rightMargin
}
spacing: MainWindowStyle.toolBar.spacing
Collapse { ColumnLayout {
id: collapse anchors.fill: parent
spacing: 0
Layout.fillHeight: parent.height // -------------------------------------------------------------------------
target: window // Toolbar properties.
targetHeight: MainWindowStyle.minimumHeight // -------------------------------------------------------------------------
}
AccountStatus { ToolBar {
id: accountStatus background: MainWindowStyle.toolBar.background
Layout.preferredHeight: MainWindowStyle.toolBar.height
Layout.fillWidth: true
Layout.fillHeight: parent.height RowLayout {
Layout.preferredWidth: MainWindowStyle.accountStatus.width anchors {
fill: parent
leftMargin: MainWindowStyle.toolBar.leftMargin
rightMargin: MainWindowStyle.toolBar.rightMargin
}
spacing: MainWindowStyle.toolBar.spacing
account: AccountSettingsModel Collapse {
id: collapse
TooltipArea { Layout.fillHeight: parent.height
text: AccountSettingsModel.sipAddress target: window
targetHeight: MainWindowStyle.minimumHeight
} }
onClicked: Utils.openWindow('ManageAccounts', window) AccountStatus {
} id: accountStatus
Layout.fillHeight: parent.height
Layout.preferredWidth: MainWindowStyle.accountStatus.width
Column { account: AccountSettingsModel
width: MainWindowStyle.autoAnswerStatus.width
Icon { TooltipArea {
icon: SettingsModel.autoAnswerStatus text: AccountSettingsModel.sipAddress
? 'auto_answer' }
: ''
iconSize: MainWindowStyle.autoAnswerStatus.iconSize onClicked: Utils.openWindow('ManageAccounts', window)
} }
Text { Column {
clip: true width: MainWindowStyle.autoAnswerStatus.width
font {
pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize Icon {
icon: SettingsModel.autoAnswerStatus
? 'auto_answer'
: ''
iconSize: MainWindowStyle.autoAnswerStatus.iconSize
}
Text {
clip: true
font {
pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize
}
text: qsTr('autoAnswerStatus')
width: parent.width
color: MainWindowStyle.autoAnswerStatus.text.color
} }
text: qsTr('autoAnswerStatus')
width: parent.width
color: MainWindowStyle.autoAnswerStatus.text.color
} }
}
SmartSearchBar { SmartSearchBar {
id: smartSearchBar id: smartSearchBar
Layout.fillWidth: true Layout.fillWidth: true
entryHeight: MainWindowStyle.searchBox.entryHeight entryHeight: MainWindowStyle.searchBox.entryHeight
maxMenuHeight: MainWindowStyle.searchBox.maxHeight maxMenuHeight: MainWindowStyle.searchBox.maxHeight
placeholderText: qsTr('mainSearchBarPlaceholder') placeholderText: qsTr('mainSearchBarPlaceholder')
model: SmartSearchBarModel {} model: SmartSearchBarModel {}
onAddContact: window.setView('ContactEdit', { onAddContact: window.setView('ContactEdit', {
sipAddress: sipAddress sipAddress: sipAddress
}) })
onLaunchCall: CallsListModel.launchAudioCall(sipAddress) onLaunchCall: CallsListModel.launchAudioCall(sipAddress)
onLaunchChat: window.setView('Conversation', { onLaunchChat: window.setView('Conversation', {
sipAddress: sipAddress sipAddress: sipAddress
}) })
onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress) onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress)
onEntryClicked: window.setView(entry.contact ? 'ContactEdit' : 'Conversation', { onEntryClicked: window.setView(entry.contact ? 'ContactEdit' : 'Conversation', {
sipAddress: entry.sipAddress sipAddress: entry.sipAddress
}) })
}
} }
} }
}
// ---------------------------------------------------------------------------
// Content.
// ---------------------------------------------------------------------------
RowLayout { // -------------------------------------------------------------------------
anchors.fill: parent // Content.
spacing: 0 // -------------------------------------------------------------------------
// Main menu. RowLayout {
ColumnLayout {
Layout.fillHeight: true Layout.fillHeight: true
Layout.maximumWidth: MainWindowStyle.menu.width Layout.fillWidth: true
Layout.preferredWidth: MainWindowStyle.menu.width
spacing: 0 spacing: 0
Menu { // Main menu.
id: menu ColumnLayout {
Layout.fillHeight: true
Layout.maximumWidth: MainWindowStyle.menu.width
Layout.preferredWidth: MainWindowStyle.menu.width
spacing: 0
entryHeight: MainWindowStyle.menu.entryHeight Menu {
entryWidth: MainWindowStyle.menu.width id: menu
entries: [{ entryHeight: MainWindowStyle.menu.entryHeight
entryName: qsTr('homeEntry'), entryWidth: MainWindowStyle.menu.width
icon: 'home'
}, {
entryName: qsTr('contactsEntry'),
icon: 'contact'
}]
onEntrySelected: !entry ? setView('Home') : setView('Contacts') entries: [{
} entryName: qsTr('homeEntry'),
icon: 'home'
}, {
entryName: qsTr('contactsEntry'),
icon: 'contact'
}]
onEntrySelected: !entry ? setView('Home') : setView('Contacts')
}
// History. // History.
Timeline { Timeline {
id: timeline id: timeline
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
model: TimelineModel model: TimelineModel
onEntrySelected: setView('Conversation', { sipAddress: entry }) onEntrySelected: setView('Conversation', { sipAddress: entry })
}
} }
}
// Main content. // Main content.
Loader { Loader {
id: contentLoader id: contentLoader
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Component.onCompleted: setView('Home') Component.onCompleted: setView('Home')
}
} }
} }
} }
import QtQuick.Controls 1.4
MenuBar {
Menu {
title: "File"
MenuItem { text: "Open..." }
MenuItem { text: "Close" }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment