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



commit 300166a6125bb7f232a3d03133eb981e52b604c9
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 13 03:38:19 2019 -0500

    app: handle GimpToolWidget::message in GimpDrawTool
    
    ... by forwarding the message to the tool.
    
    (cherry picked from commit 265071f34bc7dd3c40686f70da4d6cf97cfe6207)

 app/tools/gimpdrawtool.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 5e5ad1d515..154ccb5f94 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -105,6 +105,10 @@ static void          gimp_draw_tool_widget_status_coords
                                                    gdouble           y,
                                                    const gchar      *help,
                                                    GimpTool         *tool);
+static void          gimp_draw_tool_widget_message
+                                                  (GimpToolWidget   *widget,
+                                                   const gchar      *message,
+                                                   GimpTool         *tool);
 static void          gimp_draw_tool_widget_snap_offsets
                                                   (GimpToolWidget   *widget,
                                                    gint              offset_x,
@@ -387,6 +391,16 @@ gimp_draw_tool_widget_status_coords (GimpToolWidget *widget,
                                 title, x, separator, y, help);
 }
 
+static void
+gimp_draw_tool_widget_message (GimpToolWidget *widget,
+                               const gchar    *message,
+                               GimpTool       *tool)
+{
+  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
+
+  gimp_tool_message_literal (tool, draw_tool->display, message);
+}
+
 static void
 gimp_draw_tool_widget_snap_offsets (GimpToolWidget   *widget,
                                     gint              offset_x,
@@ -674,6 +688,9 @@ gimp_draw_tool_set_widget (GimpDrawTool   *draw_tool,
       g_signal_handlers_disconnect_by_func (draw_tool->widget,
                                             gimp_draw_tool_widget_status_coords,
                                             draw_tool);
+      g_signal_handlers_disconnect_by_func (draw_tool->widget,
+                                            gimp_draw_tool_widget_message,
+                                            draw_tool);
       g_signal_handlers_disconnect_by_func (draw_tool->widget,
                                             gimp_draw_tool_widget_snap_offsets,
                                             draw_tool);
@@ -707,6 +724,9 @@ gimp_draw_tool_set_widget (GimpDrawTool   *draw_tool,
       g_signal_connect (draw_tool->widget, "status-coords",
                         G_CALLBACK (gimp_draw_tool_widget_status_coords),
                         draw_tool);
+      g_signal_connect (draw_tool->widget, "message",
+                        G_CALLBACK (gimp_draw_tool_widget_message),
+                        draw_tool);
       g_signal_connect (draw_tool->widget, "snap-offsets",
                         G_CALLBACK (gimp_draw_tool_widget_snap_offsets),
                         draw_tool);


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