Fix menu size in details call logs and add focus for escaping.

This commit is contained in:
Julien Wadel 2024-10-16 17:04:00 +02:00
parent 6f2e1af53a
commit bdca325aaf
2 changed files with 83 additions and 56 deletions

View file

@ -119,7 +119,6 @@ Item {
Binding on currentIndex {
when: mainItem.contextualMenuOpenedComponent != undefined
value: -1
restoreMode: Binding.RestoreBindingOrValue
}
model: [
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},

View file

@ -664,13 +664,29 @@ AbstractMainPage {
popup.x: width
property var friendGuiObj: UtilsCpp.findFriendByAddress(contactDetail.contactAddress)
property var friendGui: friendGuiObj ? friendGuiObj.value : null
popup.contentItem: ColumnLayout {
Button {
background: Item {}
contentItem: IconLabel {
text: detailOptions.friendGui ? qsTr("Voir le contact") : qsTr("Ajouter aux contacts")
iconSource: AppIcons.plusCircle
popup.contentItem: FocusScope {
implicitHeight: detailsButtons.implicitHeight
implicitWidth: detailsButtons.implicitWidth
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")
icon.source: AppIcons.plusCircle
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()
if (detailOptions.friendGui) mainWindow.displayContactPage(contactDetail.contactAddress)
@ -678,11 +694,17 @@ AbstractMainPage {
}
}
Button {
background: Item {}
contentItem: IconLabel {
text: qsTr("Copier l'adresse SIP")
iconSource: AppIcons.copy
}
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)
@ -706,12 +728,17 @@ AbstractMainPage {
}
Button {
background: Item {}
contentItem: IconLabel {
text: qsTr("Supprimer l'historique")
iconSource: AppIcons.trashCan
colorizationColor: DefaultStyle.danger_500main
}
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() {
@ -726,6 +753,7 @@ AbstractMainPage {
}
}
}
}
detailContent: RoundedPane {
id: detailControl
Layout.preferredWidth: 360 * DefaultStyle.dp