Conversation.qml 3.26 KB
Newer Older
1 2 3
import QtQuick 2.7
import QtQuick.Layouts 1.3

4
import Common 1.0
5
import Linphone 1.0
6

7 8 9 10
import App.Styles 1.0

// ===================================================================

11
ColumnLayout  {
12 13
  property var contact

14 15
  spacing: 0

16
  // -----------------------------------------------------------------
17
  // Contact bar.
18 19
  // -----------------------------------------------------------------

20 21
  Rectangle {
    Layout.fillWidth: true
22 23
    Layout.preferredHeight: ConversationStyle.bar.height
    color: ConversationStyle.bar.backgroundColor
24 25

    RowLayout {
26 27 28 29 30 31
      anchors {
        fill: parent
        leftMargin: ConversationStyle.bar.leftMargin
        rightMargin: ConversationStyle.bar.rightMargin
      }
      spacing: ConversationStyle.bar.spacing
32 33

      Avatar {
34 35 36 37
        Layout.preferredHeight: ConversationStyle.bar.avatarSize
        Layout.preferredWidth: ConversationStyle.bar.avatarSize
        presenceLevel: contact.presenceLevel
        username: contact.username
38
      }
39

40
      ContactDescription {
41
        Layout.fillHeight: true
42
        Layout.fillWidth: true
43 44 45 46 47
        sipAddress: contact.sipAddresses[0]
        sipAddressColor: ConversationStyle.bar.description.sipAddressColor
        username: contact.username
        usernameColor: ConversationStyle.bar.description.usernameColor
      }
48

49 50 51
      Row {
        Layout.fillHeight: true
        spacing: ConversationStyle.bar.actions.spacing
52

53 54 55
        ActionBar {
          anchors.verticalCenter: parent.verticalCenter
          iconSize: ConversationStyle.bar.actions.call.iconSize
56

57 58 59 60
          ActionButton {
            icon: 'video_call'
            onClicked: CallsWindow.show()
          }
61

62 63 64
          ActionButton {
            icon: 'call'
            onClicked: CallsWindow.show()
65
          }
66
        }
67

68 69
        ActionBar {
          anchors.verticalCenter: parent.verticalCenter
70

71 72
          ActionButton {
            icon: 'contact_edit'
73
            iconSize: ConversationStyle.bar.actions.edit.iconSize
74

75 76 77 78 79
            onClicked: console.log('clicked!!!') // TODO.
          }

          ActionButton {
            icon: 'delete'
80
            iconSize: ConversationStyle.bar.actions.edit.iconSize
81 82

            onClicked: window.setView('Contact') // TODO.
83
          }
84
        }
85
      }
86
    }
87 88
  }

89 90 91 92 93
  // -----------------------------------------------------------------
  // Messages/Calls filters.
  // -----------------------------------------------------------------

  Borders {
94
    Layout.fillWidth: true
95 96 97 98 99 100 101 102 103 104 105
    Layout.preferredHeight: ConversationStyle.filters.height
    borderColor: ConversationStyle.filters.border.color
    bottomWidth: ConversationStyle.filters.border.bottomWidth
    color: ConversationStyle.filters.backgroundColor
    topWidth: ConversationStyle.filters.border.topWidth

    ExclusiveButtons {
      anchors {
        left: parent.left
        leftMargin: ConversationStyle.filters.leftMargin
        verticalCenter: parent.verticalCenter
106
      }
107 108 109 110 111
      texts: [
        qsTr('displayCallsAndMessages'),
        qsTr('displayCalls'),
        qsTr('displayMessages')
      ]
112 113 114
    }
  }

115 116 117
  // -----------------------------------------------------------------
  // Chat.
  // -----------------------------------------------------------------
118

119 120
  Chat {
    Layout.fillHeight: true
121 122
    Layout.fillWidth: true
    contact: parent.contact
123
  }
124
}