fix flickable direction
fix ui left panel call history/contact/meeting
This commit is contained in:
parent
8c5ebd8b5e
commit
c8b65fb5b2
8 changed files with 137 additions and 124 deletions
|
|
@ -122,6 +122,10 @@ std::shared_ptr<linphone::Friend> ToolModel::findFriendByAddress(const QString &
|
||||||
return CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
return CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<linphone::Friend> ToolModel::findFriendByAddress(std::shared_ptr<linphone::Address> linphoneAddr) {
|
||||||
|
return CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||||
|
}
|
||||||
|
|
||||||
bool ToolModel::createCall(const QString &sipAddress,
|
bool ToolModel::createCall(const QString &sipAddress,
|
||||||
const QVariantMap &options,
|
const QVariantMap &options,
|
||||||
const QString &prepareTransfertAddress,
|
const QString &prepareTransfertAddress,
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ public:
|
||||||
static QString getDisplayName(QString address);
|
static QString getDisplayName(QString address);
|
||||||
|
|
||||||
static std::shared_ptr<linphone::Friend> findFriendByAddress(const QString &address);
|
static std::shared_ptr<linphone::Friend> findFriendByAddress(const QString &address);
|
||||||
|
static std::shared_ptr<linphone::Friend> findFriendByAddress(std::shared_ptr<linphone::Address> linphoneAddr);
|
||||||
|
|
||||||
|
|
||||||
static bool createCall(const QString &sipAddress,
|
static bool createCall(const QString &sipAddress,
|
||||||
const QVariantMap &options = {},
|
const QVariantMap &options = {},
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ ListView {
|
||||||
property SearchBar searchBar
|
property SearchBar searchBar
|
||||||
property bool loading: false
|
property bool loading: false
|
||||||
property string searchText: searchBar?.text
|
property string searchText: searchBar?.text
|
||||||
|
property double busyIndicatorSize: 60 * DefaultStyle.dp
|
||||||
|
|
||||||
signal resultsReceived()
|
signal resultsReceived()
|
||||||
|
|
||||||
|
|
@ -98,6 +99,7 @@ ListView {
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible) currentIndex = -1
|
if (!visible) currentIndex = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
// Qt bug: sometimes, containsMouse may not be send and update on each MouseArea.
|
// Qt bug: sometimes, containsMouse may not be send and update on each MouseArea.
|
||||||
// So we need to use this variable to switch off all hovered items.
|
// So we need to use this variable to switch off all hovered items.
|
||||||
property int lastMouseContainsIndex: -1
|
property int lastMouseContainsIndex: -1
|
||||||
|
|
@ -221,6 +223,4 @@ ListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Control.ScrollBar.vertical: scrollbar
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,5 @@ Flickable {
|
||||||
contentWidth: contentItem.childrenRect.width
|
contentWidth: contentItem.childrenRect.width
|
||||||
contentHeight: contentItem.childrenRect.height
|
contentHeight: contentItem.childrenRect.height
|
||||||
clip: true
|
clip: true
|
||||||
|
flickableDirection: Flickable.VerticalFlick
|
||||||
}
|
}
|
||||||
|
|
@ -38,7 +38,6 @@ FocusScope {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: callList.height
|
Layout.preferredHeight: callList.height
|
||||||
Layout.maximumHeight: mainItem.height/2
|
Layout.maximumHeight: mainItem.height/2
|
||||||
// Layout.fillHeight: true
|
|
||||||
contentHeight: callList.height
|
contentHeight: callList.height
|
||||||
contentWidth: width
|
contentWidth: width
|
||||||
RoundedPane {
|
RoundedPane {
|
||||||
|
|
|
||||||
|
|
@ -195,39 +195,43 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
Layout.topMargin: 38 * DefaultStyle.dp
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Control.Control {
|
Control.Control {
|
||||||
id: listLayout
|
id: listLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.rightMargin: 39 * DefaultStyle.dp
|
anchors.rightMargin: 39 * DefaultStyle.dp
|
||||||
|
padding: 0
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Text {
|
Text {
|
||||||
visible: historyListView.count === 0
|
visible: historyListView.count === 0
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.topMargin: 137 * DefaultStyle.dp
|
||||||
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
|
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
|
||||||
font {
|
font {
|
||||||
pixelSize: 16 * DefaultStyle.dp
|
pixelSize: 16 * DefaultStyle.dp
|
||||||
weight: 800 * DefaultStyle.dp
|
weight: 800 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BusyIndicator {
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
Layout.preferredHeight: visible ? 60 * DefaultStyle.dp : 0
|
|
||||||
Layout.preferredWidth: 60 * DefaultStyle.dp
|
|
||||||
indicatorHeight: 60 * DefaultStyle.dp
|
|
||||||
indicatorWidth: 60 * DefaultStyle.dp
|
|
||||||
visible: historyListView.loading
|
|
||||||
indicatorColor: DefaultStyle.main1_500_main
|
|
||||||
}
|
|
||||||
CallHistoryListView {
|
CallHistoryListView {
|
||||||
id: historyListView
|
id: historyListView
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
Layout.topMargin: 38 * DefaultStyle.dp
|
||||||
searchBar: searchBar
|
searchBar: searchBar
|
||||||
|
Control.ScrollBar.vertical: scrollbar
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
anchors.horizontalCenter: historyListView.horizontalCenter
|
||||||
|
visible: historyListView.loading && historyListView.count === 0 && searchBar.text.length === 0
|
||||||
|
height: visible ? historyListView.busyIndicatorSize : 0
|
||||||
|
width: historyListView.busyIndicatorSize
|
||||||
|
indicatorHeight: historyListView.busyIndicatorSize
|
||||||
|
indicatorWidth: historyListView.busyIndicatorSize
|
||||||
|
indicatorColor: DefaultStyle.main1_500_main
|
||||||
|
}
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target: mainItem
|
target: mainItem
|
||||||
function onListViewUpdated(){
|
function onListViewUpdated(){
|
||||||
|
|
@ -245,11 +249,12 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
ScrollBar {
|
ScrollBar {
|
||||||
id: scrollbar
|
id: scrollbar
|
||||||
|
visible: historyListView.contentHeight > parent.height
|
||||||
|
active: visible
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 8 * DefaultStyle.dp
|
anchors.rightMargin: 8 * DefaultStyle.dp
|
||||||
active: true
|
|
||||||
policy: Control.ScrollBar.AsNeeded
|
policy: Control.ScrollBar.AsNeeded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -544,6 +549,8 @@ AbstractMainPage {
|
||||||
detailContent: RoundedPane {
|
detailContent: RoundedPane {
|
||||||
id: detailControl
|
id: detailControl
|
||||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
|
Layout.fillHeight: true
|
||||||
|
// height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight) + topPadding + bottomPadding
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: detailListBackground
|
id: detailListBackground
|
||||||
|
|
@ -552,104 +559,103 @@ AbstractMainPage {
|
||||||
radius: 15 * DefaultStyle.dp
|
radius: 15 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: StackLayout {
|
contentItem: CallHistoryListView {
|
||||||
currentIndex: detailListView.loading ? 0 : 1
|
id: detailListView
|
||||||
height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight)
|
Layout.fillWidth: true
|
||||||
BusyIndicator {
|
Layout.fillHeight: true
|
||||||
Layout.alignment: Qt.AlignCenter
|
spacing: 14 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: visible ? 60 * DefaultStyle.dp : 0
|
clip: true
|
||||||
Layout.preferredWidth: 60 * DefaultStyle.dp
|
searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : ""
|
||||||
indicatorHeight: 60 * DefaultStyle.dp
|
busyIndicatorSize: 40 * DefaultStyle.dp
|
||||||
indicatorWidth: 60 * DefaultStyle.dp
|
|
||||||
indicatorColor: DefaultStyle.main1_500_main
|
|
||||||
}
|
|
||||||
CallHistoryListView {
|
|
||||||
id: detailListView
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: Math.min(detailControl.implicitHeight, contentHeight)
|
|
||||||
spacing: 14 * DefaultStyle.dp
|
|
||||||
clip: true
|
|
||||||
searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : ""
|
|
||||||
|
|
||||||
delegate: Item {
|
BusyIndicator {
|
||||||
width:detailListView.width
|
anchors.horizontalCenter: detailListView.horizontalCenter
|
||||||
height: 56 * DefaultStyle.dp
|
visible: detailListView.loading && detailListView.count === 0
|
||||||
RowLayout {
|
height: visible ? detailListView.busyIndicatorSize : 0
|
||||||
anchors.fill: parent
|
width: detailListView.busyIndicatorSize
|
||||||
anchors.leftMargin: 20 * DefaultStyle.dp
|
indicatorHeight: detailListView.busyIndicatorSize
|
||||||
anchors.rightMargin: 20 * DefaultStyle.dp
|
indicatorWidth: detailListView.busyIndicatorSize
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
indicatorColor: DefaultStyle.main1_500_main
|
||||||
ColumnLayout {
|
}
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
RowLayout {
|
delegate: Item {
|
||||||
EffectImage {
|
width:detailListView.width
|
||||||
id: statusIcon
|
height: 56 * DefaultStyle.dp
|
||||||
imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
RowLayout {
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
anchors.fill: parent
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
anchors.leftMargin: 20 * DefaultStyle.dp
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
anchors.rightMargin: 20 * DefaultStyle.dp
|
||||||
? AppIcons.arrowElbow
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
: modelData.core.isOutgoing
|
ColumnLayout {
|
||||||
? AppIcons.arrowUpRight
|
Layout.alignment: Qt.AlignVCenter
|
||||||
: AppIcons.arrowDownLeft
|
RowLayout {
|
||||||
colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
EffectImage {
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
id: statusIcon
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.Missed
|
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||||
? DefaultStyle.danger_500main
|
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
||||||
: modelData.core.isOutgoing
|
? AppIcons.arrowElbow
|
||||||
? DefaultStyle.info_500_main
|
: modelData.core.isOutgoing
|
||||||
: DefaultStyle.success_500main
|
? AppIcons.arrowUpRight
|
||||||
Layout.preferredWidth: 16 * DefaultStyle.dp
|
: AppIcons.arrowDownLeft
|
||||||
Layout.preferredHeight: 16 * DefaultStyle.dp
|
colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||||
transform: Rotation {
|
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||||
angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined
|
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
|| modelData.core.status === LinphoneEnums.CallStatus.Missed
|
||||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0
|
? DefaultStyle.danger_500main
|
||||||
origin {
|
: modelData.core.isOutgoing
|
||||||
x: statusIcon.width/2
|
? DefaultStyle.info_500_main
|
||||||
y: statusIcon.height/2
|
: DefaultStyle.success_500main
|
||||||
}
|
Layout.preferredWidth: 16 * DefaultStyle.dp
|
||||||
}
|
Layout.preferredHeight: 16 * DefaultStyle.dp
|
||||||
}
|
transform: Rotation {
|
||||||
Text {
|
angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||||
text: modelData.core.status === LinphoneEnums.CallStatus.Missed
|
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||||
? qsTr("Appel manqué")
|
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||||
: modelData.core.isOutgoing
|
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0
|
||||||
? qsTr("Appel sortant")
|
origin {
|
||||||
: qsTr("Appel entrant")
|
x: statusIcon.width/2
|
||||||
font {
|
y: statusIcon.height/2
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
}
|
||||||
weight: 400 * DefaultStyle.dp
|
}
|
||||||
}
|
}
|
||||||
}
|
Text {
|
||||||
}
|
text: modelData.core.status === LinphoneEnums.CallStatus.Missed
|
||||||
Text {
|
? qsTr("Appel manqué")
|
||||||
text: UtilsCpp.formatDate(modelData.core.date)
|
: modelData.core.isOutgoing
|
||||||
color: modelData.core.status === LinphoneEnums.CallStatus.Missed? DefaultStyle.danger_500main : DefaultStyle.main2_500main
|
? qsTr("Appel sortant")
|
||||||
font {
|
: qsTr("Appel entrant")
|
||||||
pixelSize: 12 * DefaultStyle.dp
|
font {
|
||||||
weight: 300 * DefaultStyle.dp
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
}
|
weight: 400 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
}
|
||||||
Layout.fillHeight: true
|
Text {
|
||||||
Layout.fillWidth: true
|
text: UtilsCpp.formatDate(modelData.core.date)
|
||||||
}
|
color: modelData.core.status === LinphoneEnums.CallStatus.Missed? DefaultStyle.danger_500main : DefaultStyle.main2_500main
|
||||||
Text {
|
font {
|
||||||
text: UtilsCpp.formatElapsedTime(modelData.core.duration, false)
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
font {
|
weight: 300 * DefaultStyle.dp
|
||||||
pixelSize: 12 * DefaultStyle.dp
|
}
|
||||||
weight: 300 * DefaultStyle.dp
|
}
|
||||||
}
|
}
|
||||||
}
|
Item {
|
||||||
}
|
Layout.fillHeight: true
|
||||||
}
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
}
|
Text {
|
||||||
|
text: UtilsCpp.formatElapsedTime(modelData.core.duration, false)
|
||||||
|
font {
|
||||||
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
|
weight: 300 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Item{
|
Item{
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
|
||||||
|
|
@ -210,14 +210,15 @@ AbstractMainPage {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.top: title.bottom
|
anchors.top: title.bottom
|
||||||
anchors.right: leftPanel.right
|
anchors.right: leftPanel.right
|
||||||
anchors.left: leftPanel.left
|
anchors.left: leftPanel.left
|
||||||
|
anchors.leftMargin: leftPanel.leftMargin
|
||||||
anchors.bottom: leftPanel.bottom
|
anchors.bottom: leftPanel.bottom
|
||||||
enabled: mainItem.leftPanelEnabled
|
enabled: mainItem.leftPanelEnabled
|
||||||
spacing: 38 * DefaultStyle.dp
|
spacing: 38 * DefaultStyle.dp
|
||||||
SearchBar {
|
SearchBar {
|
||||||
id: searchBar
|
id: searchBar
|
||||||
Layout.leftMargin: leftPanel.leftMargin
|
visible: contactList.haveContacts || text.length !== 0
|
||||||
Layout.rightMargin: leftPanel.rightMargin
|
Layout.rightMargin: leftPanel.rightMargin
|
||||||
Layout.topMargin: 18 * DefaultStyle.dp
|
Layout.topMargin: 18 * DefaultStyle.dp
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: qsTr("Rechercher un contact")
|
placeholderText: qsTr("Rechercher un contact")
|
||||||
|
|
@ -226,11 +227,10 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: content
|
id: content
|
||||||
spacing: 15 * DefaultStyle.dp
|
spacing: 15 * DefaultStyle.dp
|
||||||
Layout.leftMargin: 45 * DefaultStyle.dp
|
|
||||||
Text {
|
Text {
|
||||||
visible: !contactList.loading && !contactList.haveContacts
|
visible: !contactList.loading && !contactList.haveContacts
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: 137 * DefaultStyle.dp
|
Layout.topMargin: 137 * DefaultStyle.dp
|
||||||
text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "")
|
text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "")
|
||||||
font {
|
font {
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@ AbstractMainPage {
|
||||||
placeholderText: qsTr("Rechercher une réunion")
|
placeholderText: qsTr("Rechercher une réunion")
|
||||||
KeyNavigation.up: conferenceList
|
KeyNavigation.up: conferenceList
|
||||||
KeyNavigation.down: conferenceList
|
KeyNavigation.down: conferenceList
|
||||||
|
visible: conferenceList.count !== 0 || text.length !== 0
|
||||||
Binding {
|
Binding {
|
||||||
target: mainItem
|
target: mainItem
|
||||||
property: "showDefaultItem"
|
property: "showDefaultItem"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue