diff options
author | fiaxh <git@lightrise.org> | 2020-02-21 02:11:23 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-02-22 02:58:36 +0100 |
commit | 28c44380ba89e51c5aeac01ca9549633fbeb7e11 (patch) | |
tree | 8172f1d6c3bcd2450082fa8fa1fb76e9a214cfc5 /main/src/ui/conversation_summary | |
parent | a7e92960a3f4d31cfb2fbe2e3ba4941cf3b8faf2 (diff) | |
download | dino-28c44380ba89e51c5aeac01ca9549633fbeb7e11.tar.gz dino-28c44380ba89e51c5aeac01ca9549633fbeb7e11.zip |
Move ConversationContentView+ChatInput into ConversationView, handle drag'n'drop on ConversationView level
Diffstat (limited to 'main/src/ui/conversation_summary')
-rw-r--r-- | main/src/ui/conversation_summary/conversation_view.vala | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala index 33980c09..92d94cd7 100644 --- a/main/src/ui/conversation_summary/conversation_view.vala +++ b/main/src/ui/conversation_summary/conversation_view.vala @@ -4,15 +4,6 @@ using Pango; using Dino.Entities; -enum Target { - URI_LIST, - STRING -} - -const TargetEntry[] target_list = { - { "text/uri-list", 0, Target.URI_LIST }, -}; - namespace Dino.Ui.ConversationSummary { [GtkTemplate (ui = "/im/dino/Dino/conversation_summary/view.ui")] @@ -67,9 +58,12 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins return true; }); - drag_dest_unset(main); - drag_dest_set(scrolled, DestDefaults.ALL, target_list, Gdk.DragAction.COPY); - scrolled.drag_data_received.connect(this.on_drag_data_received); + const TargetEntry[] target_list = { + { "text/uri-list", 0, Target.URI_LIST } + }; +// drag_dest_unset(main); +// drag_dest_set(scrolled, DestDefaults.ALL, target_list, Gdk.DragAction.COPY); +// scrolled.drag_data_received.connect(() => print("a\n")); return this; } @@ -185,28 +179,6 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins do_insert_item(item); } - public void on_drag_data_received(Widget widget, Gdk.DragContext context, - int x, int y, - SelectionData selection_data, - uint target_type, uint time) { - if ((selection_data != null) && (selection_data.get_length() >= 0)) { - switch (target_type) { - case Target.URI_LIST: - string[] uris = selection_data.get_uris(); - for (int i = 0; i < uris.length; i++) { - try { - string filename = Filename.from_uri(uris[i]); - stream_interactor.get_module(FileManager.IDENTITY).send_file(filename, conversation); - } catch (Error err) { - } - } - break; - default: - break; - } - } - } - public void do_insert_item(Plugins.MetaConversationItem item) { lock (meta_items) { insert_new(item); |