[gimp] app: handle GimpToolWidget::message in GimpDrawTool



commit 265071f34bc7dd3c40686f70da4d6cf97cfe6207
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.

 app/tools/gimpdrawtool.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index c3736abaae..c26de07272 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,
@@ -670,6 +684,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);
@@ -703,6 +720,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]