Set default underline for button and tabs for issue528

This commit is contained in:
Cédric Krier committed 2008-11-27 00:03:24 +01:00
1 parent dbe6efaf08
commit 2d632e8651
3 files changed
+14 -3

No files matched your search

+4 -1
View File
@@ -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)
@@ -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)
+4 -1
View File
@@ -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)