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