diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-09-22 19:16:49 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-09-22 19:16:49 +0200 |
commit | c59cef2ee7de5c2dc882c496deb569affb03bad8 (patch) | |
tree | dacf15d7bbedfe397a60387fde1dda3fbd68d92e /src/gui/piePreview.vala | |
parent | 5e23ab97cea2ac130e20ac46911cab0d9356f33d (diff) | |
parent | 45a3d7f0e2783d9898f017772583d31c1c9e0f03 (diff) |
Merge tag 'upstream/0.7.0'
Upstream version 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); |