From 8d6ef1d042ec2731f84245164094e622f4be3f2d Mon Sep 17 00:00:00 2001 From: Armin Preiml Date: Wed, 21 Dec 2022 09:45:22 +0100 Subject: [PATCH] key_box: trim values longer than 50 chars --- hiprompt_gtk/window.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hiprompt_gtk/window.py b/hiprompt_gtk/window.py index 4afed53..840dbcc 100644 --- a/hiprompt_gtk/window.py +++ b/hiprompt_gtk/window.py @@ -242,7 +242,10 @@ class Window: row.pack_start(name, True, True, 0) if pair.value is not None and not pair.private: - value = Gtk.Label(pair.value, xalign=1.0) + pair_value = pair.value + if len(pair_value) > 50: + pair_value = pair_value[:50] + "..." + value = Gtk.Label(pair_value, xalign=1.0) value.get_style_context().add_class("value") row.pack_start(value, True, True, 0) elif pair.private: -- 2.45.2