changeset 4fa3d3585653 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=4fa3d3585653
description:
Add label to button of richtext toolbar
issue8232
review279111002
diffstat:
tryton/gui/window/view_form/view/form_gtk/richtextbox.py | 17 +++++++++++++--
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r 6390c8999218 -r 4fa3d3585653
tryton/gui/window/view_form/view/form_gtk/richtextbox.py
--- a/tryton/gui/window/view_form/view/form_gtk/richtextbox.py Tue Apr 02
17:57:05 2019 +0200
+++ b/tryton/gui/window/view_form/view/form_gtk/richtextbox.py Tue Apr 02
17:59:03 2019 +0200
@@ -38,11 +38,16 @@
}[CONFIG['client.toolbar']])
tag_widgets = self.tag_widgets[textview] = {}
- for icon in ['bold', 'italic', 'underline']:
+ for icon, label in [
+ ('bold', _("Bold")),
+ ('italic', _("Italic")),
+ ('underline', _("Underline")),
+ ]:
button = Gtk.ToggleToolButton()
button.set_icon_widget(IconFactory.get_image(
'tryton-format-%s' % icon,
Gtk.IconSize.SMALL_TOOLBAR))
+ button.set_label(label)
button.connect('toggled', self.toggle_props, icon, textview)
toolbar.insert(button, -1)
tag_widgets[icon] = button
@@ -67,12 +72,18 @@
toolbar.insert(Gtk.SeparatorToolItem(), -1)
button = None
- for name in ['left', 'center', 'right', 'justify']:
+ for name, label in [
+ ('left', _("Align Left")),
+ ('center', _("Align Center")),
+ ('right', _("Align Right")),
+ ('justify', _("Justify")),
+ ]:
icon = 'tryton-format-align-%s' % name
button = Gtk.RadioToolButton.new_from_widget(button)
button.set_icon_widget(IconFactory.get_image(
icon, Gtk.IconSize.SMALL_TOOLBAR))
button.set_active(icon == 'left')
+ button.set_label(label)
button.connect(
'toggled', self.toggle_justification, name, textview)
toolbar.insert(button, -1)
@@ -81,7 +92,7 @@
toolbar.insert(Gtk.SeparatorToolItem(), -1)
for icon, label in [
- ('foreground', _('Foreground')),
+ ('foreground', _("Foreground Color")),
# TODO ('background', _('Background')),
]:
button = Gtk.ToolButton()