[gimp] Issue #3876 - The tool options of some transform tools are vertically centered ...



commit d93fefb174dcc0c5f27a8e6b2c525884f2f8869d
Author: Ell <ell_se yahoo com>
Date:   Mon Sep 9 16:49:04 2019 +0300

    Issue #3876 - The tool options of some transform tools are vertically centered ...
    
    ... in their dockable dialog
    
    In GimpChainButton, override GtkWidget::compute_expand() to avoid
    inheriting [hv]expand from the button's chain lines, so that these
    propeties don't in turn propagate to the widget's ancestors,
    screwing with their layout.

 libgimpwidgets/gimpchainbutton.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/libgimpwidgets/gimpchainbutton.c b/libgimpwidgets/gimpchainbutton.c
index 680a16626d..a072d565fa 100644
--- a/libgimpwidgets/gimpchainbutton.c
+++ b/libgimpwidgets/gimpchainbutton.c
@@ -92,6 +92,10 @@ static void      gimp_chain_button_get_property     (GObject         *object,
                                                      GValue          *value,
                                                      GParamSpec      *pspec);
 
+static void      gimp_chain_button_compute_expand   (GtkWidget       *widget,
+                                                     gboolean        *hexpand_p,
+                                                     gboolean        *vexpand_p);
+
 static void      gimp_chain_button_clicked_callback (GtkWidget       *widget,
                                                      GimpChainButton *button);
 static void      gimp_chain_button_update_image     (GimpChainButton *button);
@@ -118,11 +122,14 @@ static const gchar * const gimp_chain_icon_names[] =
 static void
 gimp_chain_button_class_init (GimpChainButtonClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->constructed  = gimp_chain_button_constructed;
-  object_class->set_property = gimp_chain_button_set_property;
-  object_class->get_property = gimp_chain_button_get_property;
+  object_class->constructed    = gimp_chain_button_constructed;
+  object_class->set_property   = gimp_chain_button_set_property;
+  object_class->get_property   = gimp_chain_button_get_property;
+
+  widget_class->compute_expand = gimp_chain_button_compute_expand;
 
   gimp_chain_button_signals[TOGGLED] =
     g_signal_new ("toggled",
@@ -301,6 +308,16 @@ gimp_chain_button_get_property (GObject    *object,
     }
 }
 
+static void
+gimp_chain_button_compute_expand (GtkWidget *widget,
+                                  gboolean  *hexpand_p,
+                                  gboolean  *vexpand_p)
+{
+  /* don't inherit [hv]expand from the chain lines.  see issue #3876. */
+  *hexpand_p = FALSE;
+  *vexpand_p = FALSE;
+}
+
 /**
  * gimp_chain_button_new:
  * @position: The position you are going to use for the button


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