[balsa/gtk3] Pack expander in a box to work around a Gtk bug



commit 7be920ab164fe276e5169f7c8abec5e9e042b31d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri May 20 22:21:03 2016 -0400

    Pack expander in a box to work around a Gtk bug
    
        * src/balsa-mime-widget-crypto.c
        (balsa_mime_widget_signature_widget): pack the GtkExpander in a
        GtkBox, to work around a Gtk bug that limits the mouse-sensitive
        area of the expander when the border-width is set.

 ChangeLog                      |    7 +++++++
 src/balsa-mime-widget-crypto.c |   12 ++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4c6a8db..9b3848e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2016-05-20  Albrecht Dreß
 
+       * src/balsa-mime-widget-crypto.c
+       (balsa_mime_widget_signature_widget): pack the GtkExpander in a
+       GtkBox, to work around a Gtk bug that limits the mouse-sensitive
+       area of the expander when the border-width is set.
+
+2016-05-20  Albrecht Dreß
+
        * libbalsa/gmime-multipart-crypt.c (g_mime_gpgme_mps_sign):
        refactor;
        (g_mime_gpgme_mpe_encrypt): ditto, removing leak.
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 79d15db..8703ae6 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -102,8 +102,16 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
 #endif /* HAVE_GPG */
 
     if (lines[1]) {
-        signature_widget = gtk_expander_new(lines[0]);
-        gtk_container_add(GTK_CONTAINER(signature_widget), vbox);
+        /* Hack alert: if we omit the box below and use the expander as signature widget
+         * directly, setting the container border width of the container = the expander
+         * causes its sensitive area to shrink to an almost unusable narrow line above
+         * the label... */
+        GtkWidget *expander;
+
+        signature_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+        expander = gtk_expander_new(lines[0]);
+        gtk_container_add(GTK_CONTAINER(signature_widget), expander);
+        gtk_container_add(GTK_CONTAINER(expander), vbox);
     } else {
         signature_widget = vbox;
     }


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