Please review this at http://codereview.appspot.com/183162

For:
https://bugs.tryton.org/roundup/issue1366
https://bugs.tryton.org/roundup/issue1367

Affected files:
  M tryton/gui/window/view_form/view/form_gtk/parser.py


Index: tryton/gui/window/view_form/view/form_gtk/parser.py
===================================================================
--- a/tryton/gui/window/view_form/view/form_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/form_gtk/parser.py
@@ -257,6 +257,8 @@
     def __init__(self, label=None, attrs=None):
         super(Frame, self).__init__(label=label)
         self.attrs = attrs or {}
+        if not label:
+            self.set_shadow_type(gtk.SHADOW_NONE)

     def state_set(self, model):
         state_changes = self.attrs.get('states', {})
@@ -463,7 +465,8 @@
                 text = attrs.get('string', '')
                 if not text:
                     if 'name' in attrs and attrs['name'] in fields:
-                        if 'states' in fields[attrs['name']]:
+                        if 'states' not in attrs \
+                                and 'states' in fields[attrs['name']]:
                             attrs['states'] =
fields[attrs['name']]['states']
                         if gtk.widget_get_default_direction() ==
gtk.TEXT_DIR_RTL:
                             text = _(':') + fields[attrs['name']]['string']
@@ -671,12 +674,9 @@
                 if attrs.get('string'):
                     text = attrs['string']

-                if text:
-                    frame = Frame(text, attrs)
-                    frame.add(widget)
-                    button_list.append(frame)
-                else:
-                    frame = widget
+                frame = Frame(text, attrs)
+                frame.add(widget)
+                button_list.append(frame)
                 container.wid_add(frame,
colspan=int(attrs.get('colspan', 1)),
                         expand=int(attrs.get('expand', 0)),
                         rowspan=int(attrs.get('rowspan', 1)), ypadding=0,



-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: [email protected]
Jabber: [email protected]
Website: http://www.b2ck.com/
twitter: http://twitter.com/cedrickrier
identi.ca: http://identi.ca/cedrickrier

Attachment: pgpgG5ue2W8p1.pgp
Description: PGP signature

Reply via email to