diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-09-22 19:16:47 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-09-22 19:16:47 +0200 |
commit | 45a3d7f0e2783d9898f017772583d31c1c9e0f03 (patch) | |
tree | a0b24517d375d6572741975f9ee787cb1596574b /src/gui/piePreview.vala | |
parent | 4b19e75939c5b7122d1429f6f258d4b83cd90dde (diff) |
New upstream version 0.7.0upstream/0.7.0
Diffstat (limited to 'src/gui/piePreview.vala')
-rw-r--r-- | src/gui/piePreview.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/piePreview.vala b/src/gui/piePreview.vala index eadaa8e..540ab51 100644 --- a/src/gui/piePreview.vala +++ b/src/gui/piePreview.vala @@ -87,8 +87,9 @@ class PiePreview : Gtk.DrawingArea { this.enable_drag_source(); Gtk.TargetEntry uri_dest = {"text/uri-list", 0, 0}; + Gtk.TargetEntry text_dest = {"text/plain", 0, 0}; Gtk.TargetEntry slice_dest = {"text/plain", Gtk.TargetFlags.SAME_WIDGET, 0}; - Gtk.TargetEntry[] destinations = { uri_dest, slice_dest }; + Gtk.TargetEntry[] destinations = { uri_dest, text_dest, slice_dest }; Gtk.drag_dest_set(this, Gtk.DestDefaults.ALL, destinations, Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK); this.drag_begin.connect(this.on_start_drag); @@ -349,6 +350,16 @@ class PiePreview : Gtk.DrawingArea { int position = this.renderer.get_active_slice(); this.renderer.set_dnd_mode(false); + var text = selection_data.get_text(); + if (text != null && GLib.Uri.parse_scheme(text) != null) { + pie.add_action(ActionRegistry.new_for_uri(text), position); + this.renderer.add_group(pie.action_groups[position], position); + + if (this.renderer.slices.size == 1) + this.on_first_slice_added(); + } + + foreach (var uri in selection_data.get_uris()) { pie.add_action(ActionRegistry.new_for_uri(uri), position); this.renderer.add_group(pie.action_groups[position], position); |