From 1f50357015b08d05c693ece95e2da35165fb9edb Mon Sep 17 00:00:00 2001 From: Karine Delvare Date: Sat, 8 Oct 2005 19:20:31 +0000 Subject: [PATCH] app/tools/gimpcroptool.c app/tools/gimpnewrectselecttool.c added status 2005-10-08 Karine Delvare * app/tools/gimpcroptool.c * app/tools/gimpnewrectselecttool.c * app/tools/gimprectangletool.c: added status bar info to tell the user what to do once the rectangle area is drawn. Fixes bug #318267. --- ChangeLog | 7 +++++++ app/tools/gimpcroptool.c | 28 +++++++++++++++++++++++++++- app/tools/gimpnewrectselecttool.c | 22 +++++++++++++++++++++- app/tools/gimprectangleselecttool.c | 22 +++++++++++++++++++++- app/tools/gimprectangletool.c | 10 +++++++--- 5 files changed, 83 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1075d21cd..1af9736e44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-08 Karine Delvare + + * app/tools/gimpcroptool.c + * app/tools/gimpnewrectselecttool.c + * app/tools/gimprectangletool.c: added status bar info to tell the user + what to do once the rectangle area is drawn. Fixes bug #318267. + 2005-10-07 Michael Natterer * tools/pdbgen/pdb/grid.pdb: fixed (false) uninitialized variable diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index dc95460488..9a59887848 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -53,6 +53,11 @@ static void gimp_crop_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *gdisp); +static void gimp_crop_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp); static void gimp_crop_tool_cursor_update (GimpTool *tool, GimpCoords *coords, GdkModifierType state, @@ -142,7 +147,7 @@ gimp_crop_tool_class_init (GimpCropToolClass *klass) tool_class->initialize = gimp_rectangle_tool_initialize; tool_class->control = gimp_crop_tool_control; tool_class->button_press = gimp_rectangle_tool_button_press; - tool_class->button_release = gimp_rectangle_tool_button_release; + tool_class->button_release = gimp_crop_tool_button_release; tool_class->motion = gimp_rectangle_tool_motion; tool_class->key_press = gimp_rectangle_tool_key_press; tool_class->modifier_key = gimp_rectangle_tool_modifier_key; @@ -196,6 +201,25 @@ gimp_crop_tool_control (GimpTool *tool, GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp); } +static void +gimp_crop_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp) +{ + GimpCropOptions *options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options); + + if (options->crop_mode == GIMP_CROP_MODE_CROP) + gimp_tool_push_status (tool, gdisp, + _("Click or press enter to crop.")); + else + gimp_tool_push_status (tool, gdisp, + _("Click or press enter to resize.")); + + gimp_rectangle_tool_button_release (tool, coords, time, state, gdisp); +} + static void gimp_crop_tool_cursor_update (GimpTool *tool, GimpCoords *coords, @@ -223,6 +247,8 @@ gimp_crop_tool_execute (GimpRectangleTool *rectangle, options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options); + gimp_tool_pop_status (tool, tool->gdisp); + gimage = tool->gdisp->gimage; max_x = gimage->width; max_y = gimage->height; diff --git a/app/tools/gimpnewrectselecttool.c b/app/tools/gimpnewrectselecttool.c index 530a91171c..f51dd4af0c 100644 --- a/app/tools/gimpnewrectselecttool.c +++ b/app/tools/gimpnewrectselecttool.c @@ -64,6 +64,11 @@ static void gimp_new_rect_select_tool_finalize (GObject *object); static void gimp_new_rect_select_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *gdisp); +static void gimp_new_rect_select_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp); static void gimp_new_rect_select_tool_oper_update (GimpTool *tool, GimpCoords *coords, GdkModifierType state, @@ -152,7 +157,7 @@ gimp_new_rect_select_tool_class_init (GimpNewRectSelectToolClass *klass) tool_class->initialize = gimp_rectangle_tool_initialize; tool_class->control = gimp_new_rect_select_tool_control; tool_class->button_press = gimp_rectangle_tool_button_press; - tool_class->button_release = gimp_rectangle_tool_button_release; + tool_class->button_release = gimp_new_rect_select_tool_button_release; tool_class->motion = gimp_rectangle_tool_motion; tool_class->key_press = gimp_rectangle_tool_key_press; tool_class->modifier_key = gimp_rectangle_tool_modifier_key; @@ -206,6 +211,19 @@ gimp_new_rect_select_tool_control (GimpTool *tool, GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp); } +static void +gimp_new_rect_select_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp) +{ + gimp_tool_push_status (tool, gdisp, + _("Click or press enter to create the selection.")); + + gimp_rectangle_tool_button_release (tool, coords, time, state, gdisp); +} + static void gimp_new_rect_select_tool_oper_update (GimpTool *tool, GimpCoords *coords, @@ -251,6 +269,8 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); + gimp_tool_pop_status (tool, tool->gdisp); + gimage = tool->gdisp->gimage; max_x = gimage->width; max_y = gimage->height; diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c index 530a91171c..f51dd4af0c 100644 --- a/app/tools/gimprectangleselecttool.c +++ b/app/tools/gimprectangleselecttool.c @@ -64,6 +64,11 @@ static void gimp_new_rect_select_tool_finalize (GObject *object); static void gimp_new_rect_select_tool_control (GimpTool *tool, GimpToolAction action, GimpDisplay *gdisp); +static void gimp_new_rect_select_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp); static void gimp_new_rect_select_tool_oper_update (GimpTool *tool, GimpCoords *coords, GdkModifierType state, @@ -152,7 +157,7 @@ gimp_new_rect_select_tool_class_init (GimpNewRectSelectToolClass *klass) tool_class->initialize = gimp_rectangle_tool_initialize; tool_class->control = gimp_new_rect_select_tool_control; tool_class->button_press = gimp_rectangle_tool_button_press; - tool_class->button_release = gimp_rectangle_tool_button_release; + tool_class->button_release = gimp_new_rect_select_tool_button_release; tool_class->motion = gimp_rectangle_tool_motion; tool_class->key_press = gimp_rectangle_tool_key_press; tool_class->modifier_key = gimp_rectangle_tool_modifier_key; @@ -206,6 +211,19 @@ gimp_new_rect_select_tool_control (GimpTool *tool, GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp); } +static void +gimp_new_rect_select_tool_button_release (GimpTool *tool, + GimpCoords *coords, + guint32 time, + GdkModifierType state, + GimpDisplay *gdisp) +{ + gimp_tool_push_status (tool, gdisp, + _("Click or press enter to create the selection.")); + + gimp_rectangle_tool_button_release (tool, coords, time, state, gdisp); +} + static void gimp_new_rect_select_tool_oper_update (GimpTool *tool, GimpCoords *coords, @@ -251,6 +269,8 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); + gimp_tool_pop_status (tool, tool->gdisp); + gimage = tool->gdisp->gimage; max_x = gimage->width; max_y = gimage->height; diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c index afeb7c559a..be66828169 100644 --- a/app/tools/gimprectangletool.c +++ b/app/tools/gimprectangletool.c @@ -1335,13 +1335,17 @@ gimp_rectangle_tool_button_release (GimpTool *tool, GimpDisplay *gdisp) { GimpRectangleTool *rectangle = GIMP_RECTANGLE_TOOL (tool); - gint lastx, lasty; - gint pressx, pressy; + guint function; + gint lastx, lasty; + gint pressx, pressy; g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool)); gimp_tool_control_halt (tool->control); - gimp_tool_pop_status (tool, gdisp); + + g_object_get (rectangle, "function", &function, NULL); + if (function == RECT_EXECUTING) + gimp_tool_pop_status (tool, gdisp); if (! (state & GDK_BUTTON3_MASK)) {