diff options
author | fiaxh <git@lightrise.org> | 2020-03-28 19:55:22 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-03-29 20:24:39 +0200 |
commit | 853dfa2d6f0d1300b096f0c6a12ca179208f5287 (patch) | |
tree | 83e56212534585625f1dd9f6e4ac152e97a3cc59 | |
parent | 1016529c36011ec881820b61778821ae4caa230a (diff) | |
download | dino-853dfa2d6f0d1300b096f0c6a12ca179208f5287.tar.gz dino-853dfa2d6f0d1300b096f0c6a12ca179208f5287.zip |
Visually mark unencrypted messages if conversation is encrypted
-rw-r--r-- | main/CMakeLists.txt | 1 | ||||
-rw-r--r-- | main/data/icons/dino-changes-allowed-symbolic.svg | 10 | ||||
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_item_skeleton.vala | 21 |
3 files changed, 32 insertions, 0 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 083e64c8..5f5b7831 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -13,6 +13,7 @@ find_packages(MAIN_PACKAGES REQUIRED ) set(RESOURCE_LIST + icons/dino-changes-allowed-symbolic.svg icons/dino-changes-prevent-symbolic.svg icons/dino-conversation-list-placeholder-arrow.svg icons/dino-double-tick-symbolic.svg diff --git a/main/data/icons/dino-changes-allowed-symbolic.svg b/main/data/icons/dino-changes-allowed-symbolic.svg new file mode 100644 index 00000000..46f4487c --- /dev/null +++ b/main/data/icons/dino-changes-allowed-symbolic.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"> + <g transform="translate(-154.64 -256.66)"> + <g transform="matrix(.74332 0 0 .74332 157.02 256.73)" fill="#000000"> + <path d="m3 9h10c0.554 0 1 0.446 1 1v3c0 0.554-0.446 1-1 1h-10c-0.554 0-1-0.446-1-1v-3c0-0.554 0.446-1 1-1z" overflow="visible"/> + <path d="M 7,0 C 7,0 6.291,-0.014 5.553,0.356 4.814,0.725 4,1.666 4,3 V 4.4127188 H 6 V 3 C 6,2.333 6.186,2.275 6.447,2.145 6.71,2.014 7,2 7,2 H 9 C 9,2 9.291,2.014 9.553,2.145 9.814,2.275 10,2.333 10,3 v 8 h 2 V 3 C 12,1.667 11.186,0.725 10.447,0.356 9.71,-0.014 9,0 9,0 Z" font-family="sans-serif" font-weight="400" overflow="visible" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none" white-space="normal"/> + <path d="m2 12h12v4h-12z" overflow="visible"/> + </g> + </g> +</svg> diff --git a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala index b4cd766f..8c59dde7 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -124,6 +124,13 @@ public class ItemMetaDataHeader : Box { } } } + if (item.encryption == Encryption.NONE) { + conversation.notify["encryption"].connect(update_unencrypted_icon); + update_unencrypted_icon(); + } + + this.add(received_image); + if (item.display_time != null) { update_time(); } @@ -132,6 +139,20 @@ public class ItemMetaDataHeader : Box { update_received_mark(); } + private void update_unencrypted_icon() { + if (conversation.encryption != Encryption.NONE) { + encryption_image = new Image() { opacity=0.4, visible = true }; + encryption_image.set_from_icon_name("dino-changes-allowed-symbolic", ICON_SIZE_HEADER); + encryption_image.tooltip_text = _("Unencrypted"); + this.add(encryption_image); + this.reorder_child(encryption_image, 3); + Util.force_error_color(encryption_image); + } else if (encryption_image != null) { + encryption_image.destroy(); + encryption_image = null; + } + } + private void update_time() { time_label.label = get_relative_time(item.display_time.to_local()).to_string(); |