def messageListTreeview_drag_begin_cb(self, treeView, context): """This callback is in charge of changing the drag icon. This callback should be called 'after' (connect_after) so it can work properly!""" if treeView.get_selection().count_selected_rows() > 1: Gtk.drag_set_icon_stock(context, Gtk.STOCK_DND_MULTIPLE, 0, 0) else: Gtk.drag_set_icon_stock(context, Gtk.STOCK_DND, 0, 0)
def _dragbegin_cb(self, widget, context): try: output = self._get_point_active_output(*self._lastclick) except IndexError: # FIXME: abort? Gtk.drag_set_icon_stock(context, Gtk.STOCK_CANCEL, 10, 10) return self._draggingoutput = output self._draggingfrom = self._lastclick Gtk.drag_set_icon_stock(context, Gtk.STOCK_FULLSCREEN, 10, 10) self._draggingsnap = Snap( self._xrandr.configuration.outputs[self._draggingoutput].size, self.factor * 5, [(Position( (0, 0)), self._xrandr.state.virtual.max)] + [(virtual_state.position, virtual_state.size) for (k, virtual_state) in self._xrandr.configuration.outputs.items() if k != self._draggingoutput and virtual_state.active])
def _dragbegin_cb(self, widget, context): try: output = self._get_point_active_output(*self._lastclick) except IndexError: # FIXME: abort? Gtk.drag_set_icon_stock(context, Gtk.STOCK_CANCEL, 10, 10) return self._draggingoutput = output self._draggingfrom = self._lastclick Gtk.drag_set_icon_stock(context, Gtk.STOCK_FULLSCREEN, 10, 10) self._draggingsnap = Snap( self._xrandr.configuration.outputs[self._draggingoutput].size, self.factor * 5, [(Position((0, 0)), self._xrandr.state.virtual.max)] + [ (virtual_state.position, virtual_state.size) for (k, virtual_state) in self._xrandr.configuration.outputs.items() if k != self._draggingoutput and virtual_state.active ] )
def dnd_after_current_drag_begin(self, _widget, context): # Override default image of selected row with sonata icon: Gtk.drag_set_icon_stock(context, 'sonata', 0, 0)
def on_dnd_after_drag_begin(self, _widget, context): # Override default image of selected row with sonata icon: Gtk.drag_set_icon_stock(context, 'sonata', 0, 0)