From 054d3fec1627a9ee8d84d636d578aa68d3494d19 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 21 Aug 2022 00:10:59 +0200 Subject: Fix encryption button update and reduce its required GTK version MenuButton.activate only exists since 4.4 --- .../conversation_content_view/conversation_item_skeleton.vala | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'main/src/ui/conversation_content_view') 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 14fcd536..e4e6b804 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -132,19 +132,15 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, ContentMetaItem ci = item as ContentMetaItem; if (item.encryption != Encryption.NONE && item.encryption != Encryption.UNKNOWN && ci != null) { string? icon_name = null; - foreach(var e in app.plugin_registry.encryption_list_entries) { - if (e.encryption == item.encryption) { - icon_name = e.get_encryption_icon_name(conversation, ci.content_item); - break; - } - } + var encryption_entry = app.plugin_registry.encryption_list_entries[item.encryption]; + icon_name = encryption_entry.get_encryption_icon_name(conversation, ci.content_item); encryption_image.icon_name = icon_name ?? "changes-prevent-symbolic"; encryption_image.visible = true; } if (item.encryption == Encryption.NONE) { if (conversation.encryption != Encryption.NONE) { - encryption_image.icon_name = "dino-changes-allowed-symbolic"; + encryption_image.icon_name = "changes-allow-symbolic"; encryption_image.tooltip_text = Util.string_if_tooltips_active(_("Unencrypted")); Util.force_error_color(encryption_image); encryption_image.visible = true; -- cgit v1.2.3-70-g09d2