Commit 178eb0f2 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Linphone): refactoring & coding style

parent 4248a6a7
...@@ -13,7 +13,8 @@ class AccountSettingsModel : public QObject { ...@@ -13,7 +13,8 @@ class AccountSettingsModel : public QObject {
Q_PROPERTY( Q_PROPERTY(
QString username QString username
READ getUsername READ getUsername
WRITE setUsername // WRITE setUsername
CONSTANT // TODO: TMP
); );
Q_PROPERTY( Q_PROPERTY(
......
...@@ -4,13 +4,17 @@ import QtQuick.Layouts 1.3 ...@@ -4,13 +4,17 @@ import QtQuick.Layouts 1.3
import Linphone 1.0 import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
// =================================================================== // =============================================================================
Item { Item {
id: accountStatus id: accountStatus
// ---------------------------------------------------------------------------
signal clicked signal clicked
// ---------------------------------------------------------------------------
Column { Column {
anchors.fill: parent anchors.fill: parent
......
...@@ -6,7 +6,7 @@ import Common 1.0 ...@@ -6,7 +6,7 @@ import Common 1.0
import Linphone 1.0 import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
// =================================================================== // =============================================================================
ColumnLayout { ColumnLayout {
property alias proxyModel: chat.model property alias proxyModel: chat.model
...@@ -15,7 +15,7 @@ ColumnLayout { ...@@ -15,7 +15,7 @@ ColumnLayout {
proxyModel.sipAddress proxyModel.sipAddress
) || proxyModel.sipAddress ) || proxyModel.sipAddress
// ----------------------------------------------------------------- // ---------------------------------------------------------------------------
spacing: 0 spacing: 0
...@@ -41,9 +41,9 @@ ColumnLayout { ...@@ -41,9 +41,9 @@ ColumnLayout {
property: '$sectionDate' property: '$sectionDate'
} }
// --------------------------------------------------------------- // -------------------------------------------------------------------------
// Heading. // Heading.
// --------------------------------------------------------------- // -------------------------------------------------------------------------
Component { Component {
id: sectionHeading id: sectionHeading
...@@ -85,9 +85,9 @@ ColumnLayout { ...@@ -85,9 +85,9 @@ ColumnLayout {
} }
} }
// --------------------------------------------------------------- // -------------------------------------------------------------------------
// Message/Event renderer. // Message/Event renderer.
// --------------------------------------------------------------- // -------------------------------------------------------------------------
delegate: Rectangle { delegate: Rectangle {
id: entry id: entry
...@@ -118,7 +118,7 @@ ColumnLayout { ...@@ -118,7 +118,7 @@ ColumnLayout {
} }
implicitHeight: layout.height + ChatStyle.entry.bottomMargin implicitHeight: layout.height + ChatStyle.entry.bottomMargin
// ------------------------------------------------------------- // -----------------------------------------------------------------------
// Avoid the use of explicit qrc paths. // Avoid the use of explicit qrc paths.
Component { Component {
...@@ -136,7 +136,7 @@ ColumnLayout { ...@@ -136,7 +136,7 @@ ColumnLayout {
OutgoingMessage {} OutgoingMessage {}
} }
// ------------------------------------------------------------- // -----------------------------------------------------------------------
MouseArea { MouseArea {
id: mouseArea id: mouseArea
...@@ -200,9 +200,9 @@ ColumnLayout { ...@@ -200,9 +200,9 @@ ColumnLayout {
onContentYChanged: _loadMoreEntries() onContentYChanged: _loadMoreEntries()
} }
// ----------------------------------------------------------------- // ---------------------------------------------------------------------------
// Send area. // Send area.
// ----------------------------------------------------------------- // ---------------------------------------------------------------------------
Borders { Borders {
Layout.fillWidth: true Layout.fillWidth: true
......
...@@ -5,7 +5,7 @@ import Linphone 1.0 ...@@ -5,7 +5,7 @@ import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
import Utils 1.0 import Utils 1.0
// =================================================================== // =============================================================================
Row { Row {
property string _type: { property string _type: {
......
...@@ -6,7 +6,7 @@ import Linphone 1.0 ...@@ -6,7 +6,7 @@ import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
import LinphoneUtils 1.0 import LinphoneUtils 1.0
// =================================================================== // =============================================================================
RowLayout { RowLayout {
implicitHeight: message.height implicitHeight: message.height
......
...@@ -4,18 +4,20 @@ import Common 1.0 ...@@ -4,18 +4,20 @@ import Common 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
import Utils 1.0 import Utils 1.0
// =================================================================== // =============================================================================
Item { Item {
id: container id: container
// ---------------------------------------------------------------------------
property alias backgroundColor: rectangle.color property alias backgroundColor: rectangle.color
property alias color: text.color property alias color: text.color
property alias fontSize: text.font.pointSize property alias fontSize: text.font.pointSize
default property alias _content: content.data default property alias _content: content.data
// ----------------------------------------------------------------- // ---------------------------------------------------------------------------
function _handleHoveredLink (hoveredLink) { function _handleHoveredLink (hoveredLink) {
// Can be the `invertedMouseArea` of other message. // Can be the `invertedMouseArea` of other message.
...@@ -34,7 +36,7 @@ Item { ...@@ -34,7 +36,7 @@ Item {
} }
} }
// ----------------------------------------------------------------- // ---------------------------------------------------------------------------
implicitHeight: text.contentHeight + text.padding * 2 implicitHeight: text.contentHeight + text.padding * 2
......
...@@ -5,7 +5,7 @@ import Common 1.0 ...@@ -5,7 +5,7 @@ import Common 1.0
import Linphone 1.0 import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
// =================================================================== // =============================================================================
Item { Item {
implicitHeight: message.height implicitHeight: message.height
......
...@@ -9,6 +9,8 @@ import Linphone.Styles 1.0 ...@@ -9,6 +9,8 @@ import Linphone.Styles 1.0
Item { Item {
id: avatar id: avatar
// ---------------------------------------------------------------------------
property alias presenceLevel: presenceLevel.level property alias presenceLevel: presenceLevel.level
property color backgroundColor: AvatarStyle.backgroundColor property color backgroundColor: AvatarStyle.backgroundColor
property string username property string username
......
...@@ -11,12 +11,16 @@ import Linphone.Styles 1.0 ...@@ -11,12 +11,16 @@ import Linphone.Styles 1.0
Rectangle { Rectangle {
id: item id: item
// ---------------------------------------------------------------------------
property alias actions: actionBar.data property alias actions: actionBar.data
property alias sipAddressColor: description.sipAddressColor property alias sipAddressColor: description.sipAddressColor
property alias usernameColor: description.usernameColor property alias usernameColor: description.usernameColor
property string sipAddress property string sipAddress
property var _contact: SipAddressesModel.mapSipAddressToContact(sipAddress) property var _contact: SipAddressesModel.mapSipAddressToContact(sipAddress)
// ---------------------------------------------------------------------------
color: 'transparent' // No color by default. color: 'transparent' // No color by default.
height: ContactStyle.height height: ContactStyle.height
......
...@@ -11,6 +11,8 @@ Column { ...@@ -11,6 +11,8 @@ Column {
property color usernameColor: ContactDescriptionStyle.username.color property color usernameColor: ContactDescriptionStyle.username.color
property int horizontalTextAlignment property int horizontalTextAlignment
// ---------------------------------------------------------------------------
Text { Text {
id: username id: username
......
...@@ -8,14 +8,18 @@ import Common 1.0 ...@@ -8,14 +8,18 @@ import Common 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
import Utils 1.0 import Utils 1.0
// =================================================================== // =============================================================================
DesktopPopup { DesktopPopup {
id: notification id: notification
// ---------------------------------------------------------------------------
property int notificationOffset: 0 property int notificationOffset: 0
property alias notificationHeight: notification.popupHeight property alias notificationHeight: notification.popupHeight
// ---------------------------------------------------------------------------
flags: Qt.Popup flags: Qt.Popup
Component.onCompleted: { Component.onCompleted: {
......
...@@ -3,7 +3,7 @@ import QtTest 1.1 ...@@ -3,7 +3,7 @@ import QtTest 1.1
import Linphone 1.0 import Linphone 1.0
import Utils 1.0 import Utils 1.0
// =================================================================== // =============================================================================
// Check defined properties/methods used in `Notifier.cpp`. // Check defined properties/methods used in `Notifier.cpp`.
TestCase { TestCase {
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
import Linphone 1.0 import Linphone 1.0
// =================================================================== // =============================================================================
// Wrapper to use `icon` property. // Wrapper to use `icon` property.
Item { Item {
......
...@@ -3,11 +3,13 @@ import QtQuick 2.7 ...@@ -3,11 +3,13 @@ import QtQuick 2.7
import Linphone 1.0 import Linphone 1.0
import Linphone.Styles 1.0 import Linphone.Styles 1.0
// =================================================================== // =============================================================================
Text { Text {
property int status: -1 property int status: -1
// ---------------------------------------------------------------------------
function _getStatusString () { function _getStatusString () {
switch (status) { switch (status) {
case Presence.Online: case Presence.Online:
...@@ -33,6 +35,8 @@ Text { ...@@ -33,6 +35,8 @@ Text {
} }
} }
// ---------------------------------------------------------------------------
color: PresenceStringStyle.color color: PresenceStringStyle.color
elide: Text.ElideRight elide: Text.ElideRight
font.pointSize: PresenceStringStyle.fontSize font.pointSize: PresenceStringStyle.fontSize
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property int horizontalSpacing: 6 property int horizontalSpacing: 6
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property QtObject sectionHeading: QtObject { property QtObject sectionHeading: QtObject {
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property color backgroundColor: Colors.r property color backgroundColor: Colors.r
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property QtObject sipAddress: QtObject { property QtObject sipAddress: QtObject {
......
pragma Singleton pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
// =================================================================== // =============================================================================
QtObject { QtObject {
property int contentHeight: 32 property int contentHeight: 32
......
pragma Singleton pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
// =================================================================== // =============================================================================
QtObject { QtObject {
property int margin: 10 property int margin: 10
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property color color: Colors.w property color color: Colors.w
......
...@@ -3,7 +3,7 @@ import QtQuick 2.7 ...@@ -3,7 +3,7 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// =================================================================== // =============================================================================
QtObject { QtObject {
property QtObject contact: QtObject { property QtObject contact: QtObject {
......
...@@ -11,8 +11,12 @@ import Utils 1.0 ...@@ -11,8 +11,12 @@ import Utils 1.0
ColumnLayout { ColumnLayout {
id: timeline id: timeline
// ---------------------------------------------------------------------------
property alias model: view.model property alias model: view.model
// ---------------------------------------------------------------------------
signal entrySelected (var entry) signal entrySelected (var entry)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
// =================================================================== // =============================================================================
// Contains linphone helpers. // Contains linphone helpers.
// =================================================================== // =============================================================================
.pragma library .pragma library
......
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