cifrado r89 - trunk/package/cifrado



Author: bersace
Date: Fri Apr  4 18:09:34 2008
New Revision: 89
URL: http://svn.gnome.org/viewvc/cifrado?rev=89&view=rev

Log:
AmÃlioration de l'impression.


Modified:
   trunk/package/cifrado/cifrado.py

Modified: trunk/package/cifrado/cifrado.py
==============================================================================
--- trunk/package/cifrado/cifrado.py	(original)
+++ trunk/package/cifrado/cifrado.py	Fri Apr  4 18:09:34 2008
@@ -845,23 +845,23 @@
         cr.restore()
 
         # chiffrements
-        hw,h = self.impr_text(contexte, "Chiffrement",
+        hw,h = self.impr_text(contexte, "Chiffrà avec",
                               font='sans bold 9',
                               y=hh/pango.SCALE,
                               align=pango.ALIGN_RIGHT)
-                       
+
         iter = em.codeurs.get_iter_first()
         mw = 0
         layouts = []
         while iter is not None and em.codeurs.iter_is_valid(iter):
             codeur = em.get_codeur(iter)
 
-            nom = em.get_codeur_nom(iter)
+            texte = em.get_codeur_nom(iter)
             prop = codeur.get_prop_desc()
             if prop is not None:
-                nom+=' ( '+prop+' )'
+                texte+=' ( '+prop+' )'
 
-            layout = self.layout_text(contexte, nom,
+            layout = self.layout_text(contexte, texte,
                                  font='sans normal 7')
             w,h = layout.get_size()
             mw = max(mw, w)
@@ -870,23 +870,24 @@
             
             iter = em.codeurs.iter_next(iter)
 
-        mw/= pango.SCALE
-        il = 2*pango.SCALE
-        y = hh + il + h + il
+        il = 3                  # interligne
+        mw/= pango.SCALE        # largeur max
+        wc = 2*il+max(hw,mw)/pango.SCALE    # largeur de colonne
+        y = hh + il*pango.SCALE + h + il*pango.SCALE
 
         for layout in layouts:
             self.impr_layout(contexte, layout,
                              x=contexte.get_width()-mw,
                              y=y/pango.SCALE)
             w,h = layout.get_size()
-            y+=h+il
+            y+=h+il*pango.SCALE
 
         # sÃparateur vertical
         cr.new_path()
         cr.save()
         cr.set_source_rgb(.5, .5, .5)
 
-        cr.move_to(contexte.get_width()-(2*il)/pango.SCALE-max(mw,hw/pango.SCALE),
+        cr.move_to(contexte.get_width()-wc-il,
                    hh/pango.SCALE)
         cr.rel_line_to(0, (y-hh)/pango.SCALE)
         cr.set_line_width(.5)
@@ -895,8 +896,9 @@
         
         # Original
         self.impr_text(contexte, message.message,
+                       font='sans normal 7',
                        y=int(1.5 * hh/pango.SCALE),
-                       width=contexte.get_width()*pango.SCALE-2*il-mw*pango.SCALE,
+                       width=contexte.get_width()*pango.SCALE-(il+wc)*pango.SCALE,
                        justify=True)
 
         # ChiffrÃ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]