From 4b4243901ef772e660ab4a860f6221a8049d3871 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 28 Jun 2022 09:13:42 +0200 Subject: [PATCH] In chat : move view/edit contact button into menu. --- .../assets/images/contact_add_custom.svg | 8 +-- .../assets/images/contact_view_custom.svg | 12 ++--- linphone-app/assets/languages/da.ts | 10 ++++ linphone-app/assets/languages/de.ts | 10 ++++ linphone-app/assets/languages/en.ts | 10 ++++ linphone-app/assets/languages/es.ts | 10 ++++ linphone-app/assets/languages/fr_FR.ts | 10 ++++ linphone-app/assets/languages/hu.ts | 10 ++++ linphone-app/assets/languages/it.ts | 10 ++++ linphone-app/assets/languages/ja.ts | 10 ++++ linphone-app/assets/languages/lt.ts | 10 ++++ linphone-app/assets/languages/pt_BR.ts | 10 ++++ linphone-app/assets/languages/ru.ts | 10 ++++ linphone-app/assets/languages/sv.ts | 10 ++++ linphone-app/assets/languages/tr.ts | 10 ++++ linphone-app/assets/languages/uk.ts | 10 ++++ linphone-app/assets/languages/zh_CN.ts | 10 ++++ .../Common/Styles/Menus/MenuItemStyle.qml | 4 ++ .../ui/views/App/Main/Conversation.qml | 49 ++++++++++++------- 19 files changed, 195 insertions(+), 28 deletions(-) diff --git a/linphone-app/assets/images/contact_add_custom.svg b/linphone-app/assets/images/contact_add_custom.svg index de24c41a0..58a9d35f7 100644 --- a/linphone-app/assets/images/contact_add_custom.svg +++ b/linphone-app/assets/images/contact_add_custom.svg @@ -5,7 +5,7 @@ version="1.1" id="svg8" sodipodi:docname="contact_add_custom.svg" - inkscape:version="1.1 (c68e22c387, 2021-05-23)" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -25,9 +25,9 @@ inkscape:cx="-7.7892325" inkscape:cy="14.112257" inkscape:window-width="1920" - inkscape:window-height="1131" + inkscape:window-height="1011" inkscape:window-x="0" - inkscape:window-y="0" + inkscape:window-y="32" inkscape:window-maximized="1" inkscape:current-layer="svg8" /> + transform="matrix(2.2903613,0,0,2.3259625,18.848977,14.837019)"> + transform="matrix(2.2644438,0,0,2.3157843,18.861995,12.526324)"> 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index d9a1d0c61..f9fdf9048 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -1007,6 +1007,16 @@ Server URL ist nicht konfiguriert. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 277fc1dda..b32d8de6e 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -1007,6 +1007,16 @@ Server URL not configured. 'Delete' : Item menu to delete the chat Delete + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + View contact + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + Add contact + CreateAppSipAccount diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index 3b6e37899..15ca47368 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -1007,6 +1007,16 @@ URL del servidor no configurada. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index 0cd16ef64..4d70dc7e3 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -1007,6 +1007,16 @@ URL du serveur non configurée. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index e8b4c76fe..632b3b738 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -1001,6 +1001,16 @@ A kiszolgáló URL-je nincs konfigurálva. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 255f3d604..45f5535a5 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -1007,6 +1007,16 @@ URL del server non configurato. 'Delete' : Item menu to delete the chat Elimina + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index a23119b7b..844ef72e7 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -1001,6 +1001,16 @@ 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index 4b6f90273..205021258 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -1013,6 +1013,16 @@ Nesukonfigūruotas serverio url. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index 856ae5aec..38642024b 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -1007,6 +1007,16 @@ URL do servidor não configurado. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index 4034d822a..f66c0c24a 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -1013,6 +1013,16 @@ 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 1911d1dd0..d5a8bcd56 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -1007,6 +1007,16 @@ Serverwebbadressen är inte konfigurerad. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 585c30e16..fb8d5df67 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -1001,6 +1001,16 @@ Sunucu url'si yapılandırılmadı. 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 27537c83e..70233ff69 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -1013,6 +1013,16 @@ 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index 4bc256c3e..2cca117c0 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -1001,6 +1001,16 @@ 'Delete' : Item menu to delete the chat + + conversationMenuViewContact + 'View contact' : Item menu to view the contact in address book + + + + conversationMenuAddContact + 'Add contact' : Item menu to add the contact to address book + + CreateAppSipAccount diff --git a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml index f6d4481b2..8a7f3d1a3 100644 --- a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml @@ -43,6 +43,10 @@ QtObject { property QtObject ephemeral: QtObject { property string icon : 'menu_ephemeral_custom' } + property QtObject contact: QtObject { + property string add : 'contact_add_custom' + property string view : 'contact_view_custom' + } property QtObject normal : QtObject{ diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 2b1e90f4e..8cdd6d539 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -319,18 +319,6 @@ ColumnLayout { id:actionsBar anchors.verticalCenter: parent.verticalCenter - ActionButton { - isCustom: true - backgroundRadius: 4 - colorSet: conversation._sipAddressObserver && conversation._sipAddressObserver.contact ? ConversationStyle.bar.actions.edit.viewContact : ConversationStyle.bar.actions.edit.addContact - visible: SettingsModel.contactsEnabled && !conversation.chatRoomModel.groupEnabled - - onClicked: window.setView('ContactEdit', { - sipAddress: conversation.getFullPeerAddress() - }) - tooltipText: Logic.getEditTooltipText() - } - ActionButton { id:dotButton isCustom: true @@ -374,6 +362,34 @@ ColumnLayout { property bool showDevices : conversation.securityLevel != 1 property bool showEphemerals: conversation.securityLevel != 1 // && chatRoomModel.isMeAdmin // Uncomment when session mode will be implemented + + MenuItem{ + id:contactMenu + property bool editMode: conversation._sipAddressObserver && conversation._sipAddressObserver.contact + text: editMode ? + //: 'View contact' : Item menu to view the contact in address book + qsTr('conversationMenuViewContact') + //: 'Add contact' : Item menu to add the contact to address book + : qsTr('conversationMenuAddContact') + iconMenu: editMode ? MenuItemStyle.contact.view : MenuItemStyle.contact.add + iconSizeMenu: 40 + menuItemStyle : MenuItemStyle.aux2 + visible: SettingsModel.contactsEnabled && !conversation.chatRoomModel.groupEnabled + onTriggered: { + window.setView('ContactEdit', { + sipAddress: conversation.getFullPeerAddress() + }) + } + TooltipArea { + text: Logic.getEditTooltipText() + } + } + Rectangle{ + height:1 + width:parent.width + color: ConversationStyle.menu.separatorColor + visible: groupInfoMenu.visible && contactMenu.visible + } MenuItem{ id:groupInfoMenu //: 'Group information' : Item menu to get information about the chat room @@ -389,11 +405,10 @@ ColumnLayout { } } Rectangle{ - id: separator1 height:1 width:parent.width color: ConversationStyle.menu.separatorColor - visible: groupInfoMenu.visible && devicesMenuItem.visible + visible: groupInfoMenu.visible && (contactMenu.visible || devicesMenuItem.visible) } MenuItem{ id: devicesMenuItem @@ -410,11 +425,10 @@ ColumnLayout { } } Rectangle{ - id: separator2 height:1 width:parent.width color: ConversationStyle.menu.separatorColor - visible: ephemeralMenuItem.visible && (groupInfoMenu.visible || devicesMenuItem.visible) + visible: ephemeralMenuItem.visible && (contactMenu.visible || groupInfoMenu.visible || devicesMenuItem.visible) } MenuItem{ id: ephemeralMenuItem @@ -431,11 +445,10 @@ ColumnLayout { } } Rectangle{ - id: separator3 height:1 width:parent.width color: ConversationStyle.menu.separatorColor - visible: deleteMenuItem.visible && (groupInfoMenu.visible || devicesMenuItem.visible || ephemeralMenuItem.visible) + visible: deleteMenuItem.visible && (contactMenu.visible || groupInfoMenu.visible || devicesMenuItem.visible || ephemeralMenuItem.visible) } MenuItem{ id: deleteMenuItem