[gimp/gimp-2-10] libgimpwidgets: in GimpChainButton, emit "toggled" signal when "active" changes



commit 0f727e4f2f48674dcd867e36a975041dace1fb5a
Author: Ell <ell_se yahoo com>
Date:   Fri Feb 8 08:07:05 2019 -0500

    libgimpwidgets: in GimpChainButton, emit "toggled" signal when "active" changes
    
    In GimpChainButton, emit the "toggled" signal whenever the chain
    button's "active" property changes, either due to user interaction,
    or programatically.  Previously, it would only get emitted when the
    button was actually clicked.
    
    In particular, this fixes an issue where the aspect ratio of a
    coordinates size-entry won't get updated when its chain button got
    toggled programatically, as can happen with the scale tool.
    
    (cherry picked from commit c0c055b4e975e7524051e6b5b96a6eda0ac30d34)

 libgimpwidgets/gimpchainbutton.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libgimpwidgets/gimpchainbutton.c b/libgimpwidgets/gimpchainbutton.c
index 5d42b63a61..83ee9f790a 100644
--- a/libgimpwidgets/gimpchainbutton.c
+++ b/libgimpwidgets/gimpchainbutton.c
@@ -367,6 +367,8 @@ gimp_chain_button_set_active (GimpChainButton  *button,
 
       gimp_chain_button_update_image (button);
 
+      g_signal_emit (button, gimp_chain_button_signals[TOGGLED], 0);
+
       g_object_notify (G_OBJECT (button), "active");
     }
 }
@@ -391,11 +393,7 @@ static void
 gimp_chain_button_clicked_callback (GtkWidget       *widget,
                                     GimpChainButton *button)
 {
-  g_return_if_fail (GIMP_IS_CHAIN_BUTTON (button));
-
   gimp_chain_button_set_active (button, ! button->active);
-
-  g_signal_emit (button, gimp_chain_button_signals[TOGGLED], 0);
 }
 
 static void


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