Add copy room/user ID context menus

This commit is contained in:
miruka 2019-12-12 08:32:50 -04:00
parent 6813a2c9b4
commit 2769d60fdc
5 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,3 @@
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="m19.391 17.097c.351.113.526.498.385.833-.135.319-.495.482-.827.374-2.617-.855-4.357-2.074-5.285-3.693-.177-.308-.068-.7.243-.875s.707-.067.883.241c.77 1.341 2.285 2.372 4.601 3.12zm-8.59-.611c-.849.491-2.271 1.315-5.227 2.186-.41.121-.597.591-.382.956.124.229.422.372.717.285 2.703-.793 4.203-1.557 5.142-2.087.933-.526 1.02-.535 1.904.11.856.626 2.31 1.537 4.894 2.477.296.107.611-.025.747-.249.229-.35.071-.821-.324-.965-3.083-1.124-4.426-2.186-5.094-2.715-.866-.685-1.156-.705-2.377.002zm-.263 3.068c-.638.328-1.6.822-3.251 1.393-.215.074-.375.252-.425.472-.108.475.343.915.79.762 1.772-.607 2.803-1.138 3.482-1.487.518-.267.835-.321 1.429-.001.752.404 1.938 1.042 3.593 1.705.468.188.945-.226.856-.714-.04-.221-.191-.405-.401-.49-1.578-.635-2.711-1.244-3.431-1.631-1.133-.609-1.265-.717-2.642-.009zm-.694 3.25c-.228.106-.369.337-.358.586.017.387.368.61.693.61.091 0 .181-.018.26-.055 1.7-.792 1.11-.84 3.027.005.076.034.161.05.25.05.32 0 .677-.212.698-.603.014-.256-.134-.493-.37-.597-2.496-1.095-1.827-1.096-4.2.004zm2.354-14.206c.139-.327-.017-.704-.346-.841-.33-.137-.709.016-.848.343-1.058 2.498-3.731 4.424-7.253 5.273-.335.081-.551.404-.495.741.06.361.417.598.78.511 3.469-.833 6.784-2.773 8.162-6.027zm.647 4.136c.822-.932 1.476-1.965 1.944-3.071.47-1.111.389-2.231-.228-3.153-.646-.964-1.815-1.563-3.051-1.563-.698 0-1.37.192-1.944.555-.627.398-1.122.995-1.432 1.726-.647 1.527-2.344 2.755-4.654 3.411-.288.082-.485.345-.48.643.007.416.41.711.813.597 2.7-.766 4.714-2.263 5.515-4.153.444-1.05 1.322-1.494 2.182-1.494 1.428 0 2.81 1.224 2.085 2.935-1.529 3.612-5.11 5.937-9.157 6.958-.178.045-.33.162-.417.323s-.104.351-.044.523c.107.31.436.485.755.405 1.984-.499 3.819-1.28 5.372-2.294 1.048-.685 1.97-1.474 2.741-2.348zm-5.819-6.2c.293-.501.571-.974 1.049-1.414 1.13-1.041 2.662-1.543 4.204-1.379 1.453.155 2.734.882 3.514 1.993 1.08 1.539.809 3.067.547 4.544-.225 1.263-.456 2.569.263 3.712.543.863 1.571 1.518 3.177 2.006.339.103.699-.098.785-.439.087-.345-.113-.696-.456-.802-1.246-.382-2.04-.86-2.407-1.444-.457-.726-.285-1.691-.087-2.81.279-1.571.625-3.526-.759-5.5-.994-1.417-2.611-2.341-4.438-2.536-1.914-.205-3.818.42-5.223 1.715-.62.569-.975 1.174-1.288 1.708-.493.84-.909 1.546-2.312 2.005-.222.073-.398.261-.435.54-.06.46.386.827.832.682 1.879-.614 2.464-1.611 3.034-2.581zm-2.06-1.69.387-.572c1.549-2.217 4.286-3.304 7.323-2.909 2.886.376 5.256 2.014 6.037 4.173.692 1.914.419 3.459.199 4.701-.19 1.072-.354 1.999.22 2.742.233.302.565.535 1.021.71.38.146.796-.105.842-.505.035-.302-.137-.59-.42-.707-.195-.08-.334-.173-.416-.279-.229-.295-.116-.933.027-1.739.233-1.318.553-3.123-.255-5.357-1.13-3.123-4.746-5.102-8.454-5.102-2.466 0-4.86.882-6.553 2.746-.427.478-.69.823-.945 1.409-.167.382-.102.658.178.848.275.187.627.115.809-.159z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,3 @@
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="m12.042 23.648c-7.813 0-12.042-4.876-12.042-11.171 0-6.727 4.762-12.125 13.276-12.125 6.214 0 10.724 4.038 10.724 9.601 0 8.712-10.33 11.012-9.812 6.042-.71 1.108-1.854 2.354-4.053 2.354-2.516 0-4.08-1.842-4.08-4.807 0-4.444 2.921-8.199 6.379-8.199 1.659 0 2.8.876 3.277 2.221l.464-1.632h2.338c-.244.832-2.321 8.527-2.321 8.527-.648 2.666 1.35 2.713 3.122 1.297 3.329-2.58 3.501-9.327-.998-12.141-4.821-2.891-15.795-1.102-15.795 8.693 0 5.611 3.95 9.381 9.829 9.381 3.436 0 5.542-.93 7.295-1.948l1.177 1.698c-1.711.966-4.461 2.209-8.78 2.209zm-2.344-14.305c-.715 1.34-1.177 3.076-1.177 4.424 0 3.61 3.522 3.633 5.252.239.712-1.394 1.171-3.171 1.171-4.529 0-2.917-3.495-3.434-5.246-.134z"/>
</svg>

After

Width:  |  Height:  |  Size: 794 B

View File

@ -23,6 +23,14 @@ HTileDelegate {
subtitle.text: model.display_name ? model.user_id : "" subtitle.text: model.display_name ? model.user_id : ""
subtitle.color: theme.chat.roomPane.member.subtitle subtitle.color: theme.chat.roomPane.member.subtitle
contextMenu: HMenu {
HMenuItem {
icon.name: "copy-user-id"
text: qsTr("Copy user ID")
onTriggered: Clipboard.text = model.user_id
}
}
Behavior on title.color { HColorAnimation {} } Behavior on title.color { HColorAnimation {} }
} }

View File

@ -106,6 +106,12 @@ HTileDelegate {
} }
contextMenu: HMenu { contextMenu: HMenu {
HMenuItem {
icon.name: "copy-user-id"
text: qsTr("Copy user ID")
onTriggered: Clipboard.text = model.data.user_id
}
HMenuItem { HMenuItem {
icon.name: "sign-out" icon.name: "sign-out"
icon.color: theme.colors.negativeBackground icon.color: theme.colors.negativeBackground

View File

@ -88,6 +88,12 @@ HTileDelegate {
} }
contextMenu: HMenu { contextMenu: HMenu {
HMenuItem {
icon.name: "copy-room-id"
text: qsTr("Copy room ID")
onTriggered: Clipboard.text = model.data.room_id
}
HMenuItem { HMenuItem {
visible: invited visible: invited
icon.name: "invite-accept" icon.name: "invite-accept"