app: don't call control_activate()/control_halt() in GimpRectangleTool

Instead, call it in all implementors.
This commit is contained in:
Michael Natterer
2011-03-30 22:13:31 +02:00
parent 884e4868a4
commit 0db785c36a
4 changed files with 16 additions and 16 deletions

View File

@ -252,6 +252,8 @@ gimp_crop_tool_button_press (GimpTool *tool,
if (tool->display && display != tool->display)
gimp_rectangle_tool_cancel (GIMP_RECTANGLE_TOOL (tool));
gimp_tool_control_activate (tool->control);
gimp_rectangle_tool_button_press (tool, coords, time, state, display);
}
@ -271,6 +273,8 @@ gimp_crop_tool_button_release (GimpTool *tool,
state,
release_type,
display);
gimp_tool_control_halt (tool->control);
}
static void

View File

@ -353,19 +353,12 @@ gimp_rectangle_select_tool_delegate_button_press (GimpRectangleSelectTool *rect_
GimpDisplay *old_display = tool->display;
tool->display = display;
if (! gimp_tool_control_is_active (tool->control))
{
gimp_tool_control_activate (tool->control);
}
gimp_tool_control_activate (tool->control);
button_press_delegated
= gimp_selection_tool_start_edit (GIMP_SELECTION_TOOL (tool),
coords);
button_press_delegated =
gimp_selection_tool_start_edit (GIMP_SELECTION_TOOL (tool), coords);
if (gimp_tool_control_is_active (tool->control))
{
gimp_tool_control_halt (tool->control);
}
gimp_tool_control_halt (tool->control);
tool->display = old_display;
return button_press_delegated;
@ -409,6 +402,8 @@ gimp_rectangle_select_tool_button_press (GimpTool *tool,
return;
}
gimp_tool_control_activate (tool->control);
function = gimp_rectangle_tool_get_function (rectangle);
priv->saved_show_selection = gimp_display_shell_get_show_selection (shell);
@ -484,6 +479,8 @@ gimp_rectangle_select_tool_button_release (GimpTool *tool,
image = gimp_display_get_image (tool->display);
gimp_tool_control_halt (tool->control);
gimp_tool_pop_status (tool, display);
gimp_display_shell_set_show_selection (gimp_display_get_shell (display),
priv->saved_show_selection);

View File

@ -915,8 +915,6 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
gimp_draw_tool_pause (draw_tool);
gimp_tool_control_activate (tool->control);
GIMP_LOG (RECTANGLE_TOOL, "coords->x = %f, coords->y = %f",
coords->x, coords->y);
@ -1031,8 +1029,6 @@ gimp_rectangle_tool_button_release (GimpTool *tool,
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_tool_control_halt (tool->control);
GIMP_LOG (RECTANGLE_TOOL, "coords->x = %f, coords->y = %f",
coords->x, coords->y);

View File

@ -372,6 +372,8 @@ gimp_text_tool_button_press (GimpTool *tool,
if (press_type == GIMP_BUTTON_PRESS_NORMAL)
{
gimp_tool_control_activate (tool->control);
gimp_text_tool_reset_im_context (text_tool);
text_tool->selecting = FALSE;
@ -382,7 +384,6 @@ gimp_text_tool_button_press (GimpTool *tool,
! text_tool->moving)
{
gimp_rectangle_tool_set_function (rect_tool, GIMP_RECTANGLE_TOOL_DEAD);
gimp_tool_control_activate (tool->control);
}
else
{
@ -514,6 +515,8 @@ gimp_text_tool_button_release (GimpTool *tool,
GimpRectangleTool *rect_tool = GIMP_RECTANGLE_TOOL (tool);
GimpTextTool *text_tool = GIMP_TEXT_TOOL (tool);
gimp_tool_control_halt (tool->control);
if (text_tool->selecting)
{
/* we are in a selection process (user has initially clicked on