[gtk/matthiasc/for-master] inspector: Limit the width of readonly properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] inspector: Limit the width of readonly properties
- Date: Tue, 17 Nov 2020 18:37:15 +0000 (UTC)
commit 34d547a2aa0d9031108489b8358e806605038011
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Nov 17 13:33:59 2020 -0500
inspector: Limit the width of readonly properties
For readonly properties, we show the serialized value
in a label. If we don't take precautions, this can cause
our window to grow extremely wide, and break things.
So, ellipsize things at a reasonable size.
Fixes: #3278
gtk/inspector/prop-editor.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index dc2f6f2648..019d34ffbe 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1551,6 +1551,11 @@ constructed (GObject *object)
if (!can_modify)
{
label = gtk_label_new ("");
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 20);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_widget_set_hexpand (label, TRUE);
+ gtk_widget_set_halign (label, GTK_ALIGN_FILL);
gtk_widget_add_css_class (label, "dim-label");
gtk_box_append (GTK_BOX (box), label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]