diff options
author | fiaxh <git@mx.ax.lt> | 2017-08-31 22:22:44 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-08-31 23:52:15 +0200 |
commit | d0e86d0a8ebb6bbb254a0fb7474d09c58d8379e3 (patch) | |
tree | 7f3d7344f279ee83d5f3a726b85affeabcd57506 /main/src/ui/conversation_summary/conversation_view.vala | |
parent | d2a5287effcf60a44084568a37c9c9091d336178 (diff) | |
download | dino-d0e86d0a8ebb6bbb254a0fb7474d09c58d8379e3.tar.gz dino-d0e86d0a8ebb6bbb254a0fb7474d09c58d8379e3.zip |
small fixes
Diffstat (limited to 'main/src/ui/conversation_summary/conversation_view.vala')
-rw-r--r-- | main/src/ui/conversation_summary/conversation_view.vala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala index 9379e8ba..3f5a85b6 100644 --- a/main/src/ui/conversation_summary/conversation_view.vala +++ b/main/src/ui/conversation_summary/conversation_view.vala @@ -16,7 +16,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { [GtkChild] private Stack stack; private StreamInteractor stream_interactor; - private Gee.TreeSet<Plugins.MetaConversationItem> meta_items = new TreeSet<Plugins.MetaConversationItem>((a, b) => { return a.sort_time.compare(b.sort_time); }); + private Gee.TreeSet<Plugins.MetaConversationItem> meta_items = new TreeSet<Plugins.MetaConversationItem>(sort_meta_items); private Gee.Map<Plugins.MetaConversationItem, Gee.List<Plugins.MetaConversationItem>> meta_after_items = new Gee.HashMap<Plugins.MetaConversationItem, Gee.List<Plugins.MetaConversationItem>>(); private Gee.HashMap<Plugins.MetaConversationItem, ConversationItemSkeleton> item_item_skeletons = new Gee.HashMap<Plugins.MetaConversationItem, ConversationItemSkeleton>(); private Gee.HashMap<Plugins.MetaConversationItem, Widget> widgets = new Gee.HashMap<Plugins.MetaConversationItem, Widget>(); @@ -169,6 +169,15 @@ public class ConversationView : Box, Plugins.ConversationItemCollection { if (meta_items.size > 0) message_item_populator.populate_number(conversation, meta_items.first().sort_time, 20); } + private static int sort_meta_items(Plugins.MetaConversationItem a, Plugins.MetaConversationItem b) { + int res = a.sort_time.compare(b.sort_time); + if (res == 0) { + if (a.seccondary_sort_indicator < b.seccondary_sort_indicator) res = -1; + else if (a.seccondary_sort_indicator > b.seccondary_sort_indicator) res = 1; + } + return res; + } + // Workaround GTK TextView issues private void force_alloc_width(Widget widget, int width) { Allocation alloc = Allocation(); |