From 6ea6082b78f2dcea3acda84f2d202f816bd9db85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Oct 2023 18:29:20 +0200 Subject: [PATCH] Wrap long label to 80 chars Closes #12618 --- sao/src/sao.less | 4 +++- .../tryton/gui/window/view_form/view/form_gtk/state_widget.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sao/src/sao.less b/sao/src/sao.less index 6867baff8e..ef4a162106 100644 --- a/sao/src/sao.less +++ b/sao/src/sao.less @@ -640,7 +640,9 @@ img.icon { } } .form-label { - white-space: pre; + white-space: pre-wrap; + width: max-content; + max-width: 80ch; } .form-char, .form-password, .form-integer, .form-float, .form-date, .form-datetime, .form-time, .form-timedelta, .form-selection, diff --git a/tryton/tryton/gui/window/view_form/view/form_gtk/state_widget.py b/tryton/tryton/gui/window/view_form/view/form_gtk/state_widget.py index b4a5b57a8f..0df55668a7 100644 --- a/tryton/tryton/gui/window/view_form/view/form_gtk/state_widget.py +++ b/tryton/tryton/gui/window/view_form/view/form_gtk/state_widget.py @@ -50,6 +50,8 @@ class Label(StateMixin, Gtk.Label): readonly = ((field and field.attrs.get('readonly')) or state_changes.get('readonly', not bool(field))) common.apply_label_attributes(self, readonly, required) + self.set_max_width_chars(80) + self.set_line_wrap(True) class VBox(StateMixin, Gtk.VBox):