diff options
Diffstat (limited to 'addons/bubblemessage.py')
-rw-r--r-- | addons/bubblemessage.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/addons/bubblemessage.py b/addons/bubblemessage.py index 6572a6a..d76dc1c 100644 --- a/addons/bubblemessage.py +++ b/addons/bubblemessage.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -from ..actions import Action, DragWrapper +from ..actions import Action from ..properties import TStringProperty, TArrayProperty from .. import overlayer from ..services import ObjectStore @@ -86,21 +86,17 @@ class BubbleMessage(Action): """ if not self.overlay: self.overlay = ObjectStore().activity._overlayer - assert not self._drag, "bubble action set to editmode twice" x, y = self.position self._bubble = overlayer.TextBubble(text=self.message, tailpos=self.tail_pos) - self.overlay.put(self._bubble, x, y) + self._handle = self.overlay.put( + self._bubble, + x, y, + draggable=True, + position_cb=self._update_position) self._bubble.show() - self._drag = DragWrapper(self._bubble, self.position, True) - def exit_editmode(self, *args): - x,y = self._drag.position - self.position = (int(x), int(y)) - if self._drag: - self._drag.draggable = False - self._drag = None if self._bubble: self.overlay.remove(self._bubble) self._bubble = None |