Fix menu size in details call logs and add focus for escaping.
This commit is contained in:
parent
6f2e1af53a
commit
bdca325aaf
2 changed files with 83 additions and 56 deletions
|
|
@ -119,7 +119,6 @@ Item {
|
||||||
Binding on currentIndex {
|
Binding on currentIndex {
|
||||||
when: mainItem.contextualMenuOpenedComponent != undefined
|
when: mainItem.contextualMenuOpenedComponent != undefined
|
||||||
value: -1
|
value: -1
|
||||||
restoreMode: Binding.RestoreBindingOrValue
|
|
||||||
}
|
}
|
||||||
model: [
|
model: [
|
||||||
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},
|
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},
|
||||||
|
|
|
||||||
|
|
@ -664,64 +664,92 @@ AbstractMainPage {
|
||||||
popup.x: width
|
popup.x: width
|
||||||
property var friendGuiObj: UtilsCpp.findFriendByAddress(contactDetail.contactAddress)
|
property var friendGuiObj: UtilsCpp.findFriendByAddress(contactDetail.contactAddress)
|
||||||
property var friendGui: friendGuiObj ? friendGuiObj.value : null
|
property var friendGui: friendGuiObj ? friendGuiObj.value : null
|
||||||
popup.contentItem: ColumnLayout {
|
popup.contentItem: FocusScope {
|
||||||
Button {
|
implicitHeight: detailsButtons.implicitHeight
|
||||||
background: Item {}
|
implicitWidth: detailsButtons.implicitWidth
|
||||||
contentItem: IconLabel {
|
Keys.onPressed: (event)=> {
|
||||||
|
if (event.key == Qt.Key_Left || event.key == Qt.Key_Escape) {
|
||||||
|
detailOptions.popup.close()
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
id: detailsButtons
|
||||||
|
anchors.fill: parent
|
||||||
|
Button {
|
||||||
text: detailOptions.friendGui ? qsTr("Voir le contact") : qsTr("Ajouter aux contacts")
|
text: detailOptions.friendGui ? qsTr("Voir le contact") : qsTr("Ajouter aux contacts")
|
||||||
iconSource: AppIcons.plusCircle
|
icon.source: AppIcons.plusCircle
|
||||||
}
|
icon.width: 24 * DefaultStyle.dp
|
||||||
onClicked: {
|
icon.height: 24 * DefaultStyle.dp
|
||||||
detailOptions.close()
|
spacing: 10 * DefaultStyle.dp
|
||||||
if (detailOptions.friendGui) mainWindow.displayContactPage(contactDetail.contactAddress)
|
textSize: 14 * DefaultStyle.dp
|
||||||
else mainItem.createContactRequested(contactDetail.contactName, contactDetail.contactAddress)
|
textWeight: 400 * DefaultStyle.dp
|
||||||
}
|
textColor: DefaultStyle.main2_500main
|
||||||
}
|
contentImageColor: DefaultStyle.main2_600
|
||||||
Button {
|
background: Item {}
|
||||||
background: Item {}
|
onClicked: {
|
||||||
contentItem: IconLabel {
|
detailOptions.close()
|
||||||
text: qsTr("Copier l'adresse SIP")
|
if (detailOptions.friendGui) mainWindow.displayContactPage(contactDetail.contactAddress)
|
||||||
iconSource: AppIcons.copy
|
else mainItem.createContactRequested(contactDetail.contactName, contactDetail.contactAddress)
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
detailOptions.close()
|
|
||||||
var success = UtilsCpp.copyToClipboard(mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress)
|
|
||||||
if (success) UtilsCpp.showInformationPopup(qsTr("Copié"), qsTr("L'adresse a été copiée dans le presse-papier"), true)
|
|
||||||
else UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Erreur lors de la copie de l'adresse"), false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Button {
|
|
||||||
// background: Item {}
|
|
||||||
// enabled: false
|
|
||||||
// contentItem: IconLabel {
|
|
||||||
// text: qsTr("Bloquer")
|
|
||||||
// iconSource: AppIcons.empty
|
|
||||||
// }
|
|
||||||
// onClicked: console.debug("[CallPage.qml] TODO : block user")
|
|
||||||
// }
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 2 * DefaultStyle.dp
|
|
||||||
color: DefaultStyle.main2_400
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
background: Item {}
|
|
||||||
contentItem: IconLabel {
|
|
||||||
text: qsTr("Supprimer l'historique")
|
|
||||||
iconSource: AppIcons.trashCan
|
|
||||||
colorizationColor: DefaultStyle.danger_500main
|
|
||||||
}
|
|
||||||
Connections {
|
|
||||||
target: deleteForUserPopup
|
|
||||||
function onAccepted() {
|
|
||||||
detailListView.model.removeEntriesWithFilter()
|
|
||||||
mainItem.listViewUpdated()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClicked: {
|
Button {
|
||||||
detailOptions.close()
|
text: qsTr("Copier l'adresse SIP")
|
||||||
deleteForUserPopup.open()
|
icon.source: AppIcons.copy
|
||||||
|
icon.width: 24 * DefaultStyle.dp
|
||||||
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
textSize: 14 * DefaultStyle.dp
|
||||||
|
textWeight: 400 * DefaultStyle.dp
|
||||||
|
textColor: DefaultStyle.main2_500main
|
||||||
|
contentImageColor: DefaultStyle.main2_600
|
||||||
|
background: Item {}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
detailOptions.close()
|
||||||
|
var success = UtilsCpp.copyToClipboard(mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress)
|
||||||
|
if (success) UtilsCpp.showInformationPopup(qsTr("Copié"), qsTr("L'adresse a été copiée dans le presse-papier"), true)
|
||||||
|
else UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Erreur lors de la copie de l'adresse"), false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Button {
|
||||||
|
// background: Item {}
|
||||||
|
// enabled: false
|
||||||
|
// contentItem: IconLabel {
|
||||||
|
// text: qsTr("Bloquer")
|
||||||
|
// iconSource: AppIcons.empty
|
||||||
|
// }
|
||||||
|
// onClicked: console.debug("[CallPage.qml] TODO : block user")
|
||||||
|
// }
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 2 * DefaultStyle.dp
|
||||||
|
color: DefaultStyle.main2_400
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: qsTr("Supprimer l'historique")
|
||||||
|
icon.source: AppIcons.trashCan
|
||||||
|
icon.width: 24 * DefaultStyle.dp
|
||||||
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
textSize: 14 * DefaultStyle.dp
|
||||||
|
textWeight: 400 * DefaultStyle.dp
|
||||||
|
textColor: DefaultStyle.danger_500main
|
||||||
|
contentImageColor: DefaultStyle.danger_500main
|
||||||
|
background: Item {}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: deleteForUserPopup
|
||||||
|
function onAccepted() {
|
||||||
|
detailListView.model.removeEntriesWithFilter()
|
||||||
|
mainItem.listViewUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
detailOptions.close()
|
||||||
|
deleteForUserPopup.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue