In chat : move view/edit contact button into menu.

This commit is contained in:
Julien Wadel 2022-06-28 09:13:42 +02:00
parent 773c70923f
commit 4b4243901e
19 changed files with 195 additions and 28 deletions

View file

@ -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" />
<g
@ -36,7 +36,7 @@
fill-rule="evenodd"
stroke-linecap="round"
id="g6"
transform="matrix(2.0613449,0,0,2.1144789,16.464069,18.942761)">
transform="matrix(2.2903613,0,0,2.3259625,18.848977,14.837019)">
<path
d="m 9.04,2.917 c 2.31,0 4.183,1.89 4.183,4.223 a 4.232,4.232 0 0 1 -1.13,2.887 c -0.098,0.106 -0.059,0.088 -0.168,0.183 l 0.175,0.119 c 6.339,2.786 4.713,7.47 4.713,7.47 -4.082,1.308 -7.766,1.107 -7.766,1.107 H 8.953 c 0,0 -3.684,0.2 -7.766,-1.107 0,0 -1.626,-4.684 4.713,-7.47 L 6.075,10.21 C 5.966,10.115 6.005,10.133 5.907,10.027 A 4.233,4.233 0 0 1 4.777,7.14 C 4.777,4.808 6.65,2.917 8.96,2.917 Z"
stroke-linejoin="round"

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -4,8 +4,8 @@
height="80"
version="1.1"
id="svg8"
sodipodi:docname="contact_edit_custom.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
sodipodi:docname="contact_view_custom.svg"
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"
@ -22,12 +22,12 @@
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.1964285"
inkscape:cx="-18.570447"
inkscape:cx="23.766323"
inkscape:cy="17.704468"
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" />
<g
@ -36,7 +36,7 @@
fill-rule="evenodd"
stroke-linecap="round"
id="g6"
transform="matrix(2.038009,0,0,2.1052464,16.475791,16.84213)">
transform="matrix(2.2644438,0,0,2.3157843,18.861995,12.526324)">
<path
d="m 9.04,4 c 2.31,0 4.183,1.891 4.183,4.224 a 4.232,4.232 0 0 1 -1.13,2.886 c -0.098,0.107 -0.059,0.088 -0.168,0.183 l 0.175,0.12 c 6.339,2.786 4.713,7.47 4.713,7.47 -4.082,1.307 -7.766,1.106 -7.766,1.106 H 8.953 c 0,0 -3.684,0.201 -7.766,-1.107 0,0 -1.626,-4.683 4.713,-7.47 L 6.075,11.293 C 5.966,11.198 6.005,11.217 5.907,11.11 A 4.233,4.233 0 0 1 4.777,8.224 C 4.778,5.89 6.65,4 8.96,4 Z"
stroke-linejoin="round"

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -1007,6 +1007,16 @@ Server url ikke konfigureret.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ Server URL ist nicht konfiguriert.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ Server URL not configured.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation>Delete</translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation>View contact</translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation>Add contact</translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ URL del servidor no configurada.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ URL du serveur non configurée.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1001,6 +1001,16 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ URL del server non configurato.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation>Elimina</translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1001,6 +1001,16 @@
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1013,6 +1013,16 @@ Nesukonfigūruotas serverio url.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ URL do servidor não configurado.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1013,6 +1013,16 @@
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1007,6 +1007,16 @@ Serverwebbadressen är inte konfigurerad.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1001,6 +1001,16 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1013,6 +1013,16 @@
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -1001,6 +1001,16 @@
<extracomment>&apos;Delete&apos; : Item menu to delete the chat</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuViewContact</source>
<extracomment>&apos;View contact&apos; : Item menu to view the contact in address book</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>conversationMenuAddContact</source>
<extracomment>&apos;Add contact&apos; : Item menu to add the contact to address book</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CreateAppSipAccount</name>

View file

@ -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{

View file

@ -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