CallControls.qml 1.51 KB
Newer Older
Ronan Abhamon's avatar
Ronan Abhamon committed
1 2 3 4 5 6 7
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.0

import Linphone 1.0
import Common 1.0

Ronan Abhamon's avatar
Ronan Abhamon committed
8 9
// ===================================================================

Ronan Abhamon's avatar
Ronan Abhamon committed
10
RowLayout {
Ronan Abhamon's avatar
Ronan Abhamon committed
11 12 13 14 15 16 17
  property string sipAddress

  // TODO.
  property var contact: ContactsListModel.mapSipAddressToContact(
    sipAddress
  )

Ronan Abhamon's avatar
Ronan Abhamon committed
18 19 20 21 22 23
  implicitHeight: contact.height
  spacing: 1

  Rectangle {
    Layout.fillWidth: true
    color: '#434343'
Ronan Abhamon's avatar
Ronan Abhamon committed
24
    implicitHeight: _contact.height
Ronan Abhamon's avatar
Ronan Abhamon committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

    Contact {
      id: contact

      anchors.fill: parent
      sipAddressColor: '#FFFFFF'
      usernameColor: '#FFFFFF'
    }
  }

  Rectangle {
    id: button

    Layout.preferredHeight: contact.height
    Layout.preferredWidth: 42
40
    color: menu.isOpen() ? '#FE5E00' : '#434343'
Ronan Abhamon's avatar
Ronan Abhamon committed
41 42 43 44 45 46 47 48 49 50 51 52

    Text {
      anchors.centerIn: parent
      color: '#FFFFFF'
      text: '...'
    }

    MouseArea {
      anchors.fill: parent
      hoverEnabled: true

      onClicked: {
Ronan Abhamon's avatar
Ronan Abhamon committed
53
        menu.showMenu()
Ronan Abhamon's avatar
Ronan Abhamon committed
54 55 56 57 58 59
      }
    }
  }

  DropDownMenu {
    id: menu
60

61
    implicitWidth: actionMenu.width
62
    launcher: button
Ronan Abhamon's avatar
Ronan Abhamon committed
63
    relativeTo: button
64
    relativeX: button.width + 1
Ronan Abhamon's avatar
Ronan Abhamon committed
65

66 67
    ActionMenu {
      id: actionMenu
Ronan Abhamon's avatar
Ronan Abhamon committed
68

69 70
      entryHeight: 22
      entryWidth: 120
Ronan Abhamon's avatar
Ronan Abhamon committed
71

72
      ActionMenuEntry {
73
        entryName: qsTr('acceptAudioCall')
74 75 76 77 78

        onClicked: menu.hideMenu()
      }

      ActionMenuEntry {
79
        entryName: qsTr('acceptVideoCall')
80 81 82 83 84

        onClicked: menu.hideMenu()
      }

      ActionMenuEntry {
85
        entryName: qsTr('hangup')
86 87

        onClicked: menu.hideMenu()
88
      }
Ronan Abhamon's avatar
Ronan Abhamon committed
89 90 91
    }
  }
}