Pushed as f70075323cfd80413b0fdf53fe41561eae4dd6da 2012/8/8 Manuel Quiñones <ma...@laptop.org>: > 2012/8/8 Manuel Quiñones <ma...@laptop.org>: >> Thanks, >> >> 2012/8/8 <godi...@sugarlabs.org>: >>> From: Gonzalo Odiard <godi...@gmail.com> >>> >>> This patch solves the following problems: >>> >>> * API changed in the drag and drop code in Gtk. >>> Drag and drop is not working yet (SL #3796) >> >> I added a # FIXME in the code too, >> >>> but the code needed to enable drag and drop is ported. >>> * Changes in the way to get color information from the theme >>> this is because Gtk.Style was deprecated by Gtk.StyleContext. >>> * The internal button was not visible. >>> >>> Signed-of-by: Gonzalo Odiard <gonz...@laptop.org> >>> >>> ----- >>> v2: Fixed comment based on manuq feedback, and add a note >>> about the non working drag and drop. >>> --- >>> src/sugar3/graphics/colorbutton.py | 30 ++++++++++++++++++------------ >>> 1 file changed, 18 insertions(+), 12 deletions(-) >>> >>> diff --git a/src/sugar3/graphics/colorbutton.py >>> b/src/sugar3/graphics/colorbutton.py >>> index c21da47..3b847b3 100644 >>> --- a/src/sugar3/graphics/colorbutton.py >>> +++ b/src/sugar3/graphics/colorbutton.py >>> @@ -64,20 +64,19 @@ class _ColorButton(Gtk.Button): >>> GObject.GObject.__init__(self, **kwargs) >>> >>> if self._accept_drag: >>> - Gtk.drag_dest_set(self, Gtk.DEST_DEFAULT_MOTION | >>> - Gtk.DEST_DEFAULT_HIGHLIGHT | >>> - Gtk.DEST_DEFAULT_DROP, >>> - [('application/x-color', 0, 0)], >>> - Gdk.DragAction.COPY) >>> - self.drag_source_set(Gdk.EventMask.BUTTON1_MASK | >>> Gdk.EventMask.BUTTON3_MASK, >>> - [('application/x-color', 0, 0)], >>> - Gdk.DragAction.COPY) >>> + self.drag_dest_set(Gtk.DestDefaults.MOTION | >>> + Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, >>> + [Gtk.TargetEntry.new('application/x-color', 0, 0)], >>> + Gdk.DragAction.COPY) >>> + self.drag_source_set(Gdk.ModifierType.BUTTON1_MASK | \ >> >> and removed that slash at the end of the line. Modified patch attached. >> >> Acked-by: Manuel Quiñones <ma...@laptop.org> >> >> >> -- >> .. manuq .. > > > > -- > .. manuq ..
-- .. manuq .. _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel