Commit 22449228 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(MainWindow/Conversation): use the final style

parent 623a8bad
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="19px" viewBox="0 0 22 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>contact_edit_over</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g id="contact_edit_over" stroke="#4B5964">
<path d="M8.54029156,2.5 C10.850165,2.5 12.7226588,4.39098325 12.7226588,6.72356259 C12.7226588,7.83995271 12.2940348,8.85494372 11.5935908,9.61033703 C11.4952898,9.71653609 11.5340928,9.69793625 11.4252454,9.79333541 L11.5997595,9.91213435 C17.938579,12.6985097 16.3132304,17.3824682 16.3132304,17.3824682 C12.2309551,18.6900566 8.54685822,18.4888584 8.54685822,18.4888584 L8.45333302,18.4888584 C8.45333302,18.4886584 4.7688382,18.6900566 0.686761802,17.3824682 C0.686761802,17.3824682 -0.938586743,12.6985097 5.40043177,9.91213435 L5.57494581,9.79333541 C5.4660984,9.69793625 5.50490141,9.71653609 5.40660046,9.61033703 C4.70635541,8.85494372 4.27753243,7.83995271 4.27753243,6.72356259 C4.27753243,4.39098325 6.15002629,2.5 8.45989968,2.5 L8.54029156,2.5 L8.54029156,2.5 Z" stroke-linejoin="round"></path>
<path d="M15.75,3.5 L21.5833333,3.5"></path>
<path d="M15.75,6.5 L21.5833333,6.5"></path>
<path d="M15.75,0.5 L21.5833333,0.5"></path>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="19px" viewBox="0 0 22 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>contact_edit_default</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g id="contact_edit_default">
<path d="M8.54029156,2.5 C10.850165,2.5 12.7226588,4.39098325 12.7226588,6.72356259 C12.7226588,7.83995271 12.2940348,8.85494372 11.5935908,9.61033703 C11.4952898,9.71653609 11.5340928,9.69793625 11.4252454,9.79333541 L11.5997595,9.91213435 C17.938579,12.6985097 16.3132304,17.3824682 16.3132304,17.3824682 C12.2309551,18.6900566 8.54685822,18.4888584 8.54685822,18.4888584 L8.45333302,18.4888584 C8.45333302,18.4886584 4.7688382,18.6900566 0.686761802,17.3824682 C0.686761802,17.3824682 -0.938586743,12.6985097 5.40043177,9.91213435 L5.57494581,9.79333541 C5.4660984,9.69793625 5.50490141,9.71653609 5.40660046,9.61033703 C4.70635541,8.85494372 4.27753243,7.83995271 4.27753243,6.72356259 C4.27753243,4.39098325 6.15002629,2.5 8.45989968,2.5 L8.54029156,2.5 L8.54029156,2.5 Z" stroke="#96A5B1" stroke-linejoin="round"></path>
<path d="M15.75,3.5 L21.5833333,3.5" stroke="#96A6B1"></path>
<path d="M15.75,6.5 L21.5833333,6.5" stroke="#96A6B1"></path>
<path d="M15.75,0.5 L21.5833333,0.5" stroke="#96A6B1"></path>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="19px" viewBox="0 0 22 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>contact_edit_clic</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g id="contact_edit_clic" stroke="#FF5E00">
<path d="M8.54029156,2.5 C10.850165,2.5 12.7226588,4.39098325 12.7226588,6.72356259 C12.7226588,7.83995271 12.2940348,8.85494372 11.5935908,9.61033703 C11.4952898,9.71653609 11.5340928,9.69793625 11.4252454,9.79333541 L11.5997595,9.91213435 C17.938579,12.6985097 16.3132304,17.3824682 16.3132304,17.3824682 C12.2309551,18.6900566 8.54685822,18.4888584 8.54685822,18.4888584 L8.45333302,18.4888584 C8.45333302,18.4886584 4.7688382,18.6900566 0.686761802,17.3824682 C0.686761802,17.3824682 -0.938586743,12.6985097 5.40043177,9.91213435 L5.57494581,9.79333541 C5.4660984,9.69793625 5.50490141,9.71653609 5.40660046,9.61033703 C4.70635541,8.85494372 4.27753243,7.83995271 4.27753243,6.72356259 C4.27753243,4.39098325 6.15002629,2.5 8.45989968,2.5 L8.54029156,2.5 L8.54029156,2.5 Z" stroke-linejoin="round"></path>
<path d="M15.75,3.5 L21.5833333,3.5"></path>
<path d="M15.75,6.5 L21.5833333,6.5"></path>
<path d="M15.75,0.5 L21.5833333,0.5"></path>
</g>
</g>
</svg>
\ No newline at end of file
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
<file>assets/images/chevron_red.svg</file> <file>assets/images/chevron_red.svg</file>
<file>assets/images/chevron_white.svg</file> <file>assets/images/chevron_white.svg</file>
<file>assets/images/collapse.svg</file> <file>assets/images/collapse.svg</file>
<file>assets/images/contact_edit_hovered.svg</file>
<file>assets/images/contact_edit_normal.svg</file>
<file>assets/images/contact_edit_pressed.svg</file>
<file>assets/images/contact_normal.svg</file> <file>assets/images/contact_normal.svg</file>
<file>assets/images/contact_selected.svg</file> <file>assets/images/contact_selected.svg</file>
<file>assets/images/delete_hovered.svg</file> <file>assets/images/delete_hovered.svg</file>
...@@ -143,6 +146,7 @@ ...@@ -143,6 +146,7 @@
<file>ui/views/App/NewCall.qml</file> <file>ui/views/App/NewCall.qml</file>
<file>ui/views/App/qmldir</file> <file>ui/views/App/qmldir</file>
<file>ui/views/App/Styles/MainWindow/ContactsStyle.qml</file> <file>ui/views/App/Styles/MainWindow/ContactsStyle.qml</file>
<file>ui/views/App/Styles/MainWindow/ConversationStyle.qml</file>
<file>ui/views/App/Styles/MainWindow/MainWindowStyle.qml</file> <file>ui/views/App/Styles/MainWindow/MainWindowStyle.qml</file>
<file>ui/views/App/Styles/qmldir</file> <file>ui/views/App/Styles/qmldir</file>
</qresource> </qresource>
......
...@@ -6,7 +6,7 @@ import QtQuick 2.7 ...@@ -6,7 +6,7 @@ import QtQuick 2.7
// rectangle side. // rectangle side.
// =================================================================== // ===================================================================
Item { Rectangle {
property var borderColor property var borderColor
property var borderWidth property var borderWidth
...@@ -22,6 +22,8 @@ Item { ...@@ -22,6 +22,8 @@ Item {
default property alias _content: content.data default property alias _content: content.data
color: 'transparent'
Rectangle { Rectangle {
id: bottomBorder id: bottomBorder
......
...@@ -9,6 +9,7 @@ QtObject { ...@@ -9,6 +9,7 @@ QtObject {
property color o: '#232323' // TextButtonA Hovered. property color o: '#232323' // TextButtonA Hovered.
property color q: '#E6E6E6' property color q: '#E6E6E6'
property color d: '#5A585B'
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// OK. // OK.
...@@ -16,7 +17,6 @@ QtObject { ...@@ -16,7 +17,6 @@ QtObject {
property color b: '#5E5E5F' property color b: '#5E5E5F'
property color c: '#CBCBCB' property color c: '#CBCBCB'
property color d: '#5A585B'
property color e: '#F3F3F3' property color e: '#F3F3F3'
property color f: '#E8E8E8' property color f: '#E8E8E8'
property color g: '#6B7A86' property color g: '#6B7A86'
......
...@@ -12,7 +12,7 @@ QtObject { ...@@ -12,7 +12,7 @@ QtObject {
} }
property QtObject username: QtObject { property QtObject username: QtObject {
property color color: Colors.d property color color: Colors.j
property int fontSize: 11 property int fontSize: 11
} }
} }
...@@ -33,7 +33,7 @@ QtObject { ...@@ -33,7 +33,7 @@ QtObject {
property QtObject legend: QtObject { property QtObject legend: QtObject {
property color backgroundColor: Colors.u property color backgroundColor: Colors.u
property color color: Colors.k property color color: Colors.k
property int fontSize: 12 property int fontSize: 11
property int height: 30 property int height: 30
property int iconSize: 10 property int iconSize: 10
property int leftMargin: 17 property int leftMargin: 17
......
...@@ -11,7 +11,7 @@ ColumnLayout { ...@@ -11,7 +11,7 @@ ColumnLayout {
property alias model: view.model property alias model: view.model
signal clicked (var contact) signal contactSelected (var contact)
// ----------------------------------------------------------------- // -----------------------------------------------------------------
...@@ -92,7 +92,7 @@ ColumnLayout { ...@@ -92,7 +92,7 @@ ColumnLayout {
onClicked: { onClicked: {
view.currentIndex = index view.currentIndex = index
timeline.clicked($contact) timeline.contactSelected($contact)
} }
} }
} }
......
...@@ -106,6 +106,19 @@ function clearTimeout (timer) { ...@@ -106,6 +106,19 @@ function clearTimeout (timer) {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Connect a signal to a function only for one call.
function connectOnce (signal, cb) {
var func = function () {
signal.disconnect(func)
cb.apply(this, arguments)
}
signal.connect(func)
return func
}
// -------------------------------------------------------------------
// Basic assert function. // Basic assert function.
function assert (condition, message) { function assert (condition, message) {
if (!condition) { if (!condition) {
......
...@@ -29,6 +29,7 @@ ColumnLayout { ...@@ -29,6 +29,7 @@ ColumnLayout {
Utils.openConfirmDialog(window, { Utils.openConfirmDialog(window, {
descriptionText: qsTr('removeContactDescription'), descriptionText: qsTr('removeContactDescription'),
exitHandler: function (status) { exitHandler: function (status) {
// TODO
console.log('remove contact', status) console.log('remove contact', status)
}, },
title: qsTr('removeContactTitle') title: qsTr('removeContactTitle')
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
import Linphone 1.0 import Linphone 1.0
import App.Styles 1.0
// ===================================================================
ColumnLayout { ColumnLayout {
property var contact
spacing: 0 spacing: 0
// -----------------------------------------------------------------
// Contact bar. // Contact bar.
// -----------------------------------------------------------------
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 102 Layout.preferredHeight: ConversationStyle.bar.height
color: '#D1D1D1' color: ConversationStyle.bar.backgroundColor
RowLayout { RowLayout {
anchors.left: parent.left anchors {
anchors.leftMargin: 40 fill: parent
anchors.right: parent.right leftMargin: ConversationStyle.bar.leftMargin
anchors.rightMargin: 40 rightMargin: ConversationStyle.bar.rightMargin
anchors.verticalCenter: parent.verticalCenter }
height: 80 spacing: ConversationStyle.bar.spacing
spacing: 50
width: parent.width
Avatar { Avatar {
Layout.fillHeight: true Layout.preferredHeight: ConversationStyle.bar.avatarSize
Layout.preferredWidth: 80 Layout.preferredWidth: ConversationStyle.bar.avatarSize
presenceLevel: Presence.Green // TODO: Use C++. presenceLevel: contact.presenceLevel
username: 'Cameron Andrews' // TODO: Use C++. username: contact.username
} }
Column { ContactDescription {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
sipAddress: contact.sipAddresses[0]
sipAddressColor: ConversationStyle.bar.description.sipAddressColor
username: contact.username
usernameColor: ConversationStyle.bar.description.usernameColor
}
// Contact description. Row {
ContactDescription { Layout.fillHeight: true
height: parent.height * 0.60 spacing: ConversationStyle.bar.actions.spacing
sipAddress: 'cam.andrews@sip.linphone.org' // TODO: Use C++.
username: 'Cameron Andrews' // TODO: Use C++.
width: parent.width
}
// Contact actions.
Row {
height: parent.height * 0.40
width: parent.width
ActionBar { ActionBar {
iconSize: 32 anchors.verticalCenter: parent.verticalCenter
width: parent.width / 2 iconSize: ConversationStyle.bar.actions.call.iconSize
ActionButton { ActionButton {
icon: 'cam' icon: 'video_call'
onClicked: console.log('clicked!!!') onClicked: CallsWindow.show()
} }
ActionButton { ActionButton {
icon: 'call' icon: 'call'
onClicked: console.log('clicked!!!') onClicked: CallsWindow.show()
}
} }
}
ActionBar { ActionBar {
iconSize: 32 anchors.verticalCenter: parent.verticalCenter
layoutDirection: Qt.RightToLeft
width: parent.width / 2
ActionButton { ActionButton {
icon: 'delete' icon: 'contact_edit'
onClicked: console.log('clicked!!!') iconSize: ConversationStyle.bar.actions.edit.contactIconSize
}
ActionButton { onClicked: console.log('clicked!!!') // TODO.
icon: 'contact' }
onClicked: window.setView('Contact')
} ActionButton {
icon: 'delete'
iconSize: ConversationStyle.bar.actions.edit.deleteIconSize
onClicked: window.setView('Contact') // TODO.
} }
} }
} }
} }
} }
// Messages/Calls filter. // -----------------------------------------------------------------
Rectangle { // Messages/Calls filters.
// -----------------------------------------------------------------
Borders {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 40 Layout.preferredHeight: ConversationStyle.filters.height
color: '#C7C7C7' borderColor: ConversationStyle.filters.border.color
bottomWidth: ConversationStyle.filters.border.bottomWidth
Rectangle { color: ConversationStyle.filters.backgroundColor
anchors.fill: parent topWidth: ConversationStyle.filters.border.topWidth
anchors.leftMargin: 1
ExclusiveButtons {
ExclusiveButtons { anchors {
anchors.left: parent.left left: parent.left
anchors.leftMargin: 40 leftMargin: ConversationStyle.filters.leftMargin
anchors.verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
texts: [
qsTr('displayCallsAndMessages'),
qsTr('displayCalls'),
qsTr('displayMessages')
]
} }
texts: [
qsTr('displayCallsAndMessages'),
qsTr('displayCalls'),
qsTr('displayMessages')
]
} }
} }
Borders { // -----------------------------------------------------------------
Layout.fillHeight: true // Chat.
Layout.fillWidth: true // -----------------------------------------------------------------
borderColor: '#C7C7C7'
leftWidth: 1
topWidth: 1
Chat { Chat {
anchors.fill: parent Layout.fillWidth: true
} Layout.fillHeight: true
} }
} }
...@@ -13,8 +13,8 @@ import App.Styles 1.0 ...@@ -13,8 +13,8 @@ import App.Styles 1.0
ApplicationWindow { ApplicationWindow {
id: window id: window
function setView (view) { function setView (view, props) {
contentLoader.source = view + '.qml' contentLoader.setSource(view + '.qml', props || {})
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
...@@ -158,9 +158,9 @@ ApplicationWindow { ...@@ -158,9 +158,9 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
model: ContactsListModel {} // Use History list. model: ContactsListModel {} // Use History list.
onClicked: { onContactSelected: {
menu.resetSelectedEntry() menu.resetSelectedEntry()
setView('Conversation') setView('Conversation', { contact: contact })
} }
} }
} }
......
pragma Singleton
import QtQuick 2.7
import Common 1.0
// ===================================================================
QtObject {
property QtObject bar: QtObject {
property color backgroundColor: Colors.e
property int avatarSize: 60
property int height: 80
property int leftMargin: 40
property int rightMargin: 30
property int spacing: 20
property QtObject actions: QtObject {
property int spacing: 40
property QtObject call: QtObject {
property int iconSize: 40
}
property QtObject edit: QtObject {
property int contactIconSize: 22
property int deleteIconSize: 17
}
}
property QtObject description: QtObject {
property color sipAddressColor: Colors.g
property color usernameColor: Colors.j
}
}
property QtObject filters: QtObject {
property color backgroundColor: Colors.k
property int height: 51
property int leftMargin: 40
property QtObject border: QtObject {
property color color: Colors.p
property int bottomWidth: 1
property int topWidth: 0
}
}
}
...@@ -4,5 +4,6 @@ module App.Styles ...@@ -4,5 +4,6 @@ module App.Styles
# Views styles ------------------------------------------------------- # Views styles -------------------------------------------------------
singleton ContactsStyle 1.0 MainWindow/ContactsStyle.qml singleton ContactsStyle 1.0 MainWindow/ContactsStyle.qml
singleton MainWindowStyle 1.0 MainWindow/MainWindowStyle.qml singleton ConversationStyle 1.0 MainWindow/ConversationStyle.qml
singleton MainWindowStyle 1.0 MainWindow/MainWindowStyle.qml
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