diff --git a/tryton/gui/window/view_form/view/form.py b/tryton/gui/window/view_form/view/form.py index 25c0997931..22d25eaec2 100644 --- a/tryton/gui/window/view_form/view/form.py +++ b/tryton/gui/window/view_form/view/form.py @@ -106,7 +106,10 @@ class ViewForm(ParserView): tbutton = gtk.ToolButton(iconstock) tbutton.set_use_underline(True) - tbutton.set_label(tool['name']) + text = tool['name'] + if '_' not in text: + text = '_' + text + tbutton.set_label(text) gtktoolbar.insert(tbutton, -1) tbutton.connect('clicked', self._action, tool, icontype) diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py index 554f477495..15f4e6841a 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -19,8 +19,11 @@ class Button(object): super(Button, self).__init__() self.attrs = attrs or {} self.widget = gtk.Button() + text = attrs.get('string', _('Unknown')) + if '_' not in text: + text = '_' + text self.widget.set_use_underline(True) - self.widget.set_label(attrs.get('string', _('Unknown'))) + self.widget.set_label(text) if attrs.get('icon', False): try: stock = attrs['icon'] @@ -557,6 +560,8 @@ class ParserForm(ParserInterface): text = fields[attrs['name']]['string'] if not text: text = _('No String Attr.') + if '_' not in text: + text = '_' + text label = gtk.Label(text) label.set_angle(angle) label.set_use_underline(True) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 5439787b35..141c8c0712 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -193,7 +193,10 @@ class ViewList(ParserView): tbutton = gtk.ToolButton(iconstock) tbutton.set_use_underline(True) - tbutton.set_label(tool['name']) + text = tool['name'] + if '_' not in text: + text = '_' + text + tbutton.set_label(text) gtktoolbar.insert(tbutton, -1) tbutton.connect('clicked', self._action, tool, icontype)