Commit a9f2a407 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(home): splitted in tow areas

parent e015ac75
...@@ -9,11 +9,19 @@ ...@@ -9,11 +9,19 @@
</message> </message>
</context> </context>
<context> <context>
<name>mainWindow</name> <name>home</name>
<message> <message>
<source>mainSearchBarPlaceholder</source> <source>mainSearchBarPlaceholder</source>
<translation>Search contact, start call, start chat...</translation> <translation>Search contact, start call, start chat...</translation>
</message> </message>
<message>
<source>homeEntry</source>
<translation>Home</translation>
</message>
<message>
<source>contactsEntry</source>
<translation>Contacts</translation>
</message>
</context> </context>
<context> <context>
<name>manageAccounts</name> <name>manageAccounts</name>
......
...@@ -9,11 +9,19 @@ ...@@ -9,11 +9,19 @@
</message> </message>
</context> </context>
<context> <context>
<name>mainWindow</name> <name>home</name>
<message> <message>
<source>mainSearchBarPlaceholder</source> <source>mainSearchBarPlaceholder</source>
<translation>Chercher contact, commencer appel ou chat...</translation> <translation>Chercher contact, commencer appel ou chat...</translation>
</message> </message>
<message>
<source>homeEntry</source>
<translation>Accueil</translation>
</message>
<message>
<source>contactsEntry</source>
<translation>Contacts</translation>
</message>
</context> </context>
<context> <context>
<name>manageAccounts</name> <name>manageAccounts</name>
......
...@@ -25,7 +25,8 @@ lupdate_only{ ...@@ -25,7 +25,8 @@ lupdate_only{
ui/components/form/*.qml \ ui/components/form/*.qml \
ui/components/misc/*.qml \ ui/components/misc/*.qml \
ui/components/select/*.qml \ ui/components/select/*.qml \
ui/views/*.qml ui/views/*.qml \
ui/views/home/*.qml
} }
RESOURCES += \ RESOURCES += \
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
<file>ui/components/dialog/DialogPlus.qml</file> <file>ui/components/dialog/DialogPlus.qml</file>
<file>ui/components/form/Collapse.qml</file> <file>ui/components/form/Collapse.qml</file>
<file>ui/components/form/DialogButton.qml</file> <file>ui/components/form/DialogButton.qml</file>
<file>ui/components/form/RoundButton.qml</file>
<file>ui/components/form/ToolBarButton.qml</file> <file>ui/components/form/ToolBarButton.qml</file>
<file>ui/components/form/TransparentComboBox.qml</file> <file>ui/components/form/TransparentComboBox.qml</file>
<file>ui/components/misc/Contact.qml</file> <file>ui/components/misc/Contact.qml</file>
<file>ui/components/misc/MenuEntry.qml</file>
<file>ui/components/select/SelectContact.qml</file> <file>ui/components/select/SelectContact.qml</file>
<!-- UI: Views. --> <!-- UI: Views. -->
<file>ui/views/mainWindow.qml</file> <file>ui/views/home/home.qml</file>
<file>ui/views/manageAccounts.qml</file> <file>ui/views/manageAccounts.qml</file>
<file>ui/views/newCall.qml</file> <file>ui/views/newCall.qml</file>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
App app(argc, argv); App app(argc, argv);
QQmlApplicationEngine engine(QUrl("qrc:/ui/views/mainWindow.qml")); QQmlApplicationEngine engine(QUrl("qrc:/ui/views/home/home.qml"));
if (engine.rootObjects().isEmpty()) if (engine.rootObjects().isEmpty())
return EXIT_FAILURE; return EXIT_FAILURE;
......
...@@ -3,8 +3,8 @@ import QtQuick 2.7 ...@@ -3,8 +3,8 @@ import QtQuick 2.7
// =================================================================== // ===================================================================
Item { Item {
property alias text: description.text
property alias fontSize: description.font.pointSize property alias fontSize: description.font.pointSize
property alias text: description.text
height: text ? 90 : 25 height: text ? 90 : 25
......
...@@ -6,8 +6,8 @@ import QtQuick.Window 2.2 ...@@ -6,8 +6,8 @@ import QtQuick.Window 2.2
Window { Window {
default property alias contents: content.data // Required. default property alias contents: content.data // Required.
property alias descriptionText: description.text // Optionnal.
property alias buttons: buttons.data // Required. property alias buttons: buttons.data // Required.
property alias descriptionText: description.text // Optionnal.
property bool centeredButtons // Optionnal. property bool centeredButtons // Optionnal.
modality: Qt.WindowModal modality: Qt.WindowModal
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
// ===================================================================
Item { Item {
property bool enabled: false property bool enabled: false
property alias image: backgroundImage.source property alias image: backgroundImage.source
signal collapsed (bool collapsed) signal collapsed (bool collapsed)
id: collapse
// Default.
height: 50
width: 50
function updateCollapse () { function updateCollapse () {
enabled = !enabled enabled = !enabled
collapsed(enabled) collapsed(enabled)
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
// ===================================================================
Button { Button {
background: Rectangle { background: Rectangle {
color: button.down ? '#FE5E00' : '#434343' color: button.down ? '#FE5E00' : '#434343'
......
import QtQuick 2.7
import QtQuick.Controls 2.0
Button {
property alias image: backgroundImage.source
Image {
anchors.fill: parent
id: backgroundImage
fillMode: Image.PreserveAspectFit
}
}
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
// ===================================================================
ToolButton { ToolButton {
property alias image: backgroundImage.source property alias image: backgroundImage.source
Image { Image {
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit
id: backgroundImage id: backgroundImage
} }
} }
import QtQuick 2.7
Rectangle {
property alias entryName: text.text
property bool isSelected
color: isSelected ? '#434343' : '#8E8E8E'
Row {
anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10
spacing: 10
Image {
height: parent.height
width: 30
}
Text {
color: '#FFFFFF'
font.pointSize: 13
height: parent.height
id: text
verticalAlignment: Text.AlignVCenter
}
Image {
height: parent.height
}
}
MouseArea {
anchors.fill: parent
onClicked: { } // TODO.
}
}
...@@ -50,50 +50,50 @@ Item { ...@@ -50,50 +50,50 @@ Item {
// TODO: Remove, use C++ model instead. // TODO: Remove, use C++ model instead.
model: ListModel { model: ListModel {
ListElement { ListElement {
_presence: 'connected' $presence: 'connected'
_sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org' $sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'connected' $presence: 'connected'
_sipAddress: 'toto.lala.sip.linphone.org' $sipAddress: 'toto.lala.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'disconnected' $presence: 'disconnected'
_sipAddress: 'machin.truc.sip.linphone.org' $sipAddress: 'machin.truc.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'absent' $presence: 'absent'
_sipAddress: 'hey.listen.sip.linphone.org' $sipAddress: 'hey.listen.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'do_not_disturb' $presence: 'do$not$disturb'
_sipAddress: 'valentin.cognito.sip.linphone.org' $sipAddress: 'valentin.cognito.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'do_not_disturb' $presence: 'do$not$disturb'
_sipAddress: 'charles.henri.sip.linphone.org' $sipAddress: 'charles.henri.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'disconnected' $presence: 'disconnected'
_sipAddress: 'yesyes.nono.sip.linphone.org' $sipAddress: 'yesyes.nono.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
ListElement { ListElement {
_presence: 'connected' $presence: 'connected'
_sipAddress: 'nsa.sip.linphone.org' $sipAddress: 'nsa.sip.linphone.org'
_username: 'Toto' $username: 'Toto'
} }
} }
delegate: Contact { delegate: Contact {
sipAddress: _sipAddress sipAddress: $sipAddress
username: _username username: $username
width: parent.width width: parent.width
} }
} }
......
...@@ -3,6 +3,7 @@ import QtQuick.Controls 2.0 ...@@ -3,6 +3,7 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import 'qrc:/ui/components/form' import 'qrc:/ui/components/form'
import 'qrc:/ui/components/misc'
ApplicationWindow { ApplicationWindow {
header: ToolBar { header: ToolBar {
...@@ -13,10 +14,14 @@ ApplicationWindow { ...@@ -13,10 +14,14 @@ ApplicationWindow {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 10 anchors.leftMargin: 20
anchors.rightMargin: 20
spacing: 20
// Collapse. // Collapse.
Collapse { Collapse {
Layout.preferredWidth: 25
Layout.fillHeight: parent.height
image: 'qrc:/imgs/collapse.svg' image: 'qrc:/imgs/collapse.svg'
onCollapsed: { onCollapsed: {
mainWindow.height = collapsed ? 480 : 70 mainWindow.height = collapsed ? 480 : 70
...@@ -24,7 +29,32 @@ ApplicationWindow { ...@@ -24,7 +29,32 @@ ApplicationWindow {
} }
// User info. // User info.
// TODO Column {
Layout.preferredWidth: 200
Layout.fillHeight: parent.height
// Username.
Text {
clip: true
color: '#5A585B'
font.weight: Font.DemiBold
height: parent.height / 2
font.pointSize: 11
text: 'Edward Miller'
verticalAlignment: Text.AlignBottom
width: parent.width
}
// Sip address.
Text {
clip: true
color: '#5A585B'
height: parent.height / 2
text: 'e.miller@sip-linphone.org'
verticalAlignment: Text.AlignTop
width: parent.width
}
}
// User actions. // User actions.
ToolBarButton { ToolBarButton {
...@@ -57,6 +87,8 @@ ApplicationWindow { ...@@ -57,6 +87,8 @@ ApplicationWindow {
// Start conference. // Start conference.
ToolBarButton { ToolBarButton {
Layout.fillHeight: parent.height
Layout.preferredWidth: 32
image: 'qrc:/imgs/start_conference.svg' image: 'qrc:/imgs/start_conference.svg'
} }
} }
...@@ -66,4 +98,48 @@ ApplicationWindow { ...@@ -66,4 +98,48 @@ ApplicationWindow {
minimumWidth: 640 minimumWidth: 640
title: 'Linphone' title: 'Linphone'
visible: true visible: true
RowLayout {
anchors.fill: parent
spacing: 0
// Main menu.
ColumnLayout {
Layout.fillHeight: true
Layout.preferredWidth: 250
spacing: 0
MenuEntry {
Layout.preferredHeight: 50
Layout.preferredWidth: parent.width
entryName: qsTr('homeEntry')
}
Item { Layout.preferredHeight: 2 }
MenuEntry {
Layout.preferredHeight: 50
Layout.preferredWidth: parent.width
entryName: qsTr('contactsEntry')
}
Rectangle {
Layout.fillHeight: true
Layout.preferredWidth: parent.width
}
Rectangle {
Layout.preferredWidth: 250
Layout.preferredHeight: 70
color: '#EAEAEA'
}
}
// Main content.
Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
color: 'blue'
}
}
} }
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