[gimp/gimp-2-10] app: handle GimpToolWidget::message in GimpToolWidgetGroup



commit 52a8dadaf643618d5da673d7f2387f8b0f907e3c
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 13 03:37:01 2019 -0500

    app: handle GimpToolWidget::message in GimpToolWidgetGroup
    
    ... by forwarding the message, if the emitting widget has focus.
    
    (cherry picked from commit 00a06f94be6a1c86a8d0056f4656480d9a706bbd)

 app/display/gimptoolwidgetgroup.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/app/display/gimptoolwidgetgroup.c b/app/display/gimptoolwidgetgroup.c
index 8fcb162d8c..d62f4c926b 100644
--- a/app/display/gimptoolwidgetgroup.c
+++ b/app/display/gimptoolwidgetgroup.c
@@ -123,6 +123,9 @@ static void             gimp_tool_widget_group_child_status_coords (GimpToolWidg
                                                                     gdouble                y,
                                                                     const gchar           *help,
                                                                     GimpToolWidgetGroup   *group);
+static void             gimp_tool_widget_group_child_message       (GimpToolWidget        *child,
+                                                                    const gchar           *message,
+                                                                    GimpToolWidgetGroup   *group);
 static void             gimp_tool_widget_group_child_focus_changed (GimpToolWidget        *child,
                                                                     GimpToolWidgetGroup   *group);
 
@@ -201,6 +204,9 @@ gimp_tool_widget_group_init (GimpToolWidgetGroup *group)
   gimp_container_add_handler (priv->children, "status-coords",
                               G_CALLBACK (gimp_tool_widget_group_child_status_coords),
                               group);
+  gimp_container_add_handler (priv->children, "message",
+                              G_CALLBACK (gimp_tool_widget_group_child_message),
+                              group);
   gimp_container_add_handler (priv->children, "focus-changed",
                               G_CALLBACK (gimp_tool_widget_group_child_focus_changed),
                               group);
@@ -596,6 +602,18 @@ gimp_tool_widget_group_child_status_coords (GimpToolWidget      *child,
     gimp_tool_widget_set_status_coords (widget, title, x, separator, y, help);
 }
 
+static void
+gimp_tool_widget_group_child_message (GimpToolWidget      *child,
+                                      const gchar         *message,
+                                      GimpToolWidgetGroup *group)
+{
+  GimpToolWidgetGroupPrivate *priv   = group->priv;
+  GimpToolWidget             *widget = GIMP_TOOL_WIDGET (group);
+
+  if (priv->focus_widget == child)
+    gimp_tool_widget_message_literal (widget, message);
+}
+
 static void
 gimp_tool_widget_group_child_focus_changed (GimpToolWidget      *child,
                                             GimpToolWidgetGroup *group)


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