Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-10-23 13:42:03 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-10-23 14:57:53 (GMT)
commitb11508e23aa072163228f4419cc97dfe2af0dd91 (patch)
treea2a35c19bd9446e6bf0f927a3e49718436489b51
parente02308729a1c071ff53bd16415d90117875193a2 (diff)
Avoid changing edition_mode in a globe if not needed
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--globos.py8
-rw-r--r--historietaactivity.py14
2 files changed, 11 insertions, 11 deletions
diff --git a/globos.py b/globos.py
index 938b3f3..c54ce8d 100644
--- a/globos.py
+++ b/globos.py
@@ -70,9 +70,12 @@ class Globo:
font_name)
def set_selected(self, selected):
- logging.debug('Set selected %s', selected)
+ logging.debug('Set selected %s (%s)', selected, self.texto.text)
self.selec = selected
if self.texto is not None:
+ if selected and self.texto.get_edition_mode():
+ # if already is in edit mode, do nothing
+ return
self.texto.set_edition_mode(selected)
def imprimir(self, context):
@@ -856,6 +859,9 @@ class CuadroTexto:
if parse:
self._parse_font_description()
+ def get_edition_mode(self):
+ return self._in_edition
+
def set_edition_mode(self, in_edition):
if self._in_edition == in_edition:
return
diff --git a/historietaactivity.py b/historietaactivity.py
index 2ef636d..11f4c50 100644
--- a/historietaactivity.py
+++ b/historietaactivity.py
@@ -513,10 +513,10 @@ class ComicBox(Gtk.EventBox):
self.show_all()
def set_globo_activo(self, globo):
- if globo is None:
- if self._globo_activo is not None:
- self._globo_activo.set_selected(False)
- else:
+ if self._globo_activo is not None and \
+ self._globo_activo != globo:
+ self._globo_activo.set_selected(False)
+ if globo is not None:
globo.set_selected(True)
self._globo_activo = globo
if globo is not None and globo.texto is not None:
@@ -671,17 +671,11 @@ class ComicBox(Gtk.EventBox):
self.is_punto = True
if (not self.is_dimension) and not (self.is_punto):
- if self._globo_activo is not None:
- #self.glob_press.is_selec(event.x,event.y)
- self._globo_activo.set_selected(False)
- self.glob_press = False
-
if self.globos:
list_aux = self.globos[:]
list_aux.reverse()
for i in list_aux:
if i.is_selec(event.x, event.y):
- # i.mover_a(event.x,event.y,self.get_allocation())
self.glob_press = True
self.set_globo_activo(i)
self.redraw()