[libnma/lr/pkcs11-fixes: 10/12] cert-chooser-button: ellipsize the label




commit af04cc338b33ebbb7f26b9777fb1a5dbdb5396d8
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Wed Jan 19 10:09:29 2022 +0100

    cert-chooser-button: ellipsize the label
    
    Sometimes the label gets too long -- such as when a PKCS#11 URI is used
    when libnma is compiled w/o gcr support -- and that looks ugly.
    But it can also happen when the filename is too long.

 src/nma-cert-chooser-button.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/nma-cert-chooser-button.c b/src/nma-cert-chooser-button.c
index 78fb2668..633985d8 100644
--- a/src/nma-cert-chooser-button.c
+++ b/src/nma-cert-chooser-button.c
@@ -455,6 +455,7 @@ create_file_button (NMACertChooserButton *self)
 
        priv->button_label = gtk_label_new (NULL);
        gtk_widget_show (priv->button_label);
+       gtk_label_set_ellipsize (GTK_LABEL (priv->button_label), PANGO_ELLIPSIZE_END);
        g_object_set (priv->button_label, "xalign", (gfloat) 0, NULL);
        gtk_widget_set_hexpand (priv->button_label, TRUE);
        gtk_box_append (GTK_BOX (box), priv->button_label);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]