From c1533f25775d3d9db5395107d6f3fd695b041926 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 24 Apr 2018 14:59:28 +0200 Subject: Redesign chat input + move file upload there --- main/src/ui/conversation_summary/conversation_view.vala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'main/src/ui/conversation_summary') diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala index 03dbe554..fac53b7d 100644 --- a/main/src/ui/conversation_summary/conversation_view.vala +++ b/main/src/ui/conversation_summary/conversation_view.vala @@ -32,6 +32,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { private Mutex reloading_mutex = Mutex(); private bool animate = false; + private bool firstLoad = true; public ConversationView(StreamInteractor stream_interactor) { this.stream_interactor = stream_interactor; @@ -59,7 +60,22 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { Util.force_base_background(this); } + // Workaround GTK TextView issues: Delay first load of contents public void initialize_for_conversation(Conversation? conversation) { + if (firstLoad) { + int timeout = firstLoad ? 1000 : 0; + Timeout.add(timeout, () => { + initialize_for_conversation_(conversation); + return false; + }); + firstLoad = false; + } else { + initialize_for_conversation_(conversation); + } + + } + + private void initialize_for_conversation_(Conversation? conversation) { Dino.Application app = Dino.Application.get_default(); if (this.conversation != null) { foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_item_populators) { -- cgit v1.2.3-70-g09d2