Do not do shell darkening while GimpRectangleTool rectangles are being
2007-11-04 Martin Nordholts <martinn@svn.gnome.org> Do not do shell darkening while GimpRectangleTool rectangles are being rubber-banded. * app/tools/gimprectangletool.c (gimp_rectangle_tool_button_press) (gimp_rectangle_tool_button_release): Maintain a variable keeping track of if the rectangle is being rubber banded or not. (gimp_rectangle_tool_update_highlight): Do not set a shell highligt if the rectangle is being rubber-banded. (gimp_rectangle_tool_rubber_banding_func): New helper function. svn path=/trunk/; revision=24059
This commit is contained in:

committed by
Martin Nordholts

parent
f6994c34f5
commit
a07756d894
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
2007-11-04 Martin Nordholts <martinn@svn.gnome.org>
|
||||||
|
|
||||||
|
Do not do shell darkening while GimpRectangleTool rectangles are
|
||||||
|
being rubber-banded.
|
||||||
|
|
||||||
|
* app/tools/gimprectangletool.c
|
||||||
|
(gimp_rectangle_tool_button_press)
|
||||||
|
(gimp_rectangle_tool_button_release): Maintain a variable keeping
|
||||||
|
track of if the rectangle is being rubber banded or not.
|
||||||
|
(gimp_rectangle_tool_update_highlight): Do not set a shell
|
||||||
|
highligt if the rectangle is being rubber-banded.
|
||||||
|
(gimp_rectangle_tool_rubber_banding_func): New helper function.
|
||||||
|
|
||||||
2007-11-04 Sven Neumann <sven@gimp.org>
|
2007-11-04 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimpviewrendererbrush.c: implement
|
* app/widgets/gimpviewrendererbrush.c: implement
|
||||||
|
@ -156,6 +156,9 @@ struct _GimpRectangleToolPrivate
|
|||||||
*/
|
*/
|
||||||
gboolean narrow_mode;
|
gboolean narrow_mode;
|
||||||
|
|
||||||
|
/* True when the rectangle is being rubber banded. */
|
||||||
|
gboolean rubber_banding;
|
||||||
|
|
||||||
/* For what scale the handle sizes is calculated. We must cache this so that
|
/* For what scale the handle sizes is calculated. We must cache this so that
|
||||||
* we can differentiate between when the tool is resumed because of zoom level
|
* we can differentiate between when the tool is resumed because of zoom level
|
||||||
* just has changed or because the highlight has just been updated.
|
* just has changed or because the highlight has just been updated.
|
||||||
@ -214,6 +217,8 @@ static GtkAnchorType gimp_rectangle_tool_get_anchor (GimpRectangleTool
|
|||||||
|
|
||||||
static void gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool);
|
static void gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool);
|
||||||
|
|
||||||
|
static gboolean gimp_rectangle_tool_rubber_banding_func (GimpRectangleTool *rect_tool);
|
||||||
|
|
||||||
static void gimp_rectangle_tool_update_handle_sizes (GimpRectangleTool *rect_tool);
|
static void gimp_rectangle_tool_update_handle_sizes (GimpRectangleTool *rect_tool);
|
||||||
|
|
||||||
static gboolean gimp_rectangle_tool_scale_has_changed (GimpRectangleTool *rect_tool);
|
static gboolean gimp_rectangle_tool_scale_has_changed (GimpRectangleTool *rect_tool);
|
||||||
@ -902,6 +907,11 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
|
|||||||
private->other_side_y = other_side_y;
|
private->other_side_y = other_side_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Is the rectangle being rubber-banded? */
|
||||||
|
private->rubber_banding = gimp_rectangle_tool_rubber_banding_func (rect_tool);
|
||||||
|
|
||||||
|
gimp_rectangle_tool_update_highlight (rect_tool);
|
||||||
|
|
||||||
gimp_tool_control_activate (tool->control);
|
gimp_tool_control_activate (tool->control);
|
||||||
|
|
||||||
gimp_draw_tool_resume (draw_tool);
|
gimp_draw_tool_resume (draw_tool);
|
||||||
@ -978,6 +988,9 @@ gimp_rectangle_tool_button_release (GimpTool *tool,
|
|||||||
|
|
||||||
gimp_tool_control_set_snap_offsets (tool->control, 0, 0, 0, 0);
|
gimp_tool_control_set_snap_offsets (tool->control, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
/* On button release, we are not rubber-banding the rectangle any longer. */
|
||||||
|
private->rubber_banding = FALSE;
|
||||||
|
|
||||||
gimp_rectangle_tool_update_highlight (rect_tool);
|
gimp_rectangle_tool_update_highlight (rect_tool);
|
||||||
gimp_rectangle_tool_update_handle_sizes (rect_tool);
|
gimp_rectangle_tool_update_handle_sizes (rect_tool);
|
||||||
|
|
||||||
@ -1033,8 +1046,12 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
current_x,
|
current_x,
|
||||||
current_y);
|
current_y);
|
||||||
|
|
||||||
/* Update the highlight. */
|
/* Update the highlight, but only if it is not being
|
||||||
gimp_rectangle_tool_update_highlight (rect_tool);
|
* rubber-banded. If it is being rubber-banded, the highlight is not
|
||||||
|
* shown anyway.
|
||||||
|
*/
|
||||||
|
if (! gimp_rectangle_tool_rubber_banding_func (rect_tool))
|
||||||
|
gimp_rectangle_tool_update_highlight (rect_tool);
|
||||||
|
|
||||||
if (private->function != RECT_MOVING &&
|
if (private->function != RECT_MOVING &&
|
||||||
private->function != RECT_EXECUTING)
|
private->function != RECT_EXECUTING)
|
||||||
@ -2672,10 +2689,16 @@ gimp_rectangle_tool_get_anchor (GimpRectangleToolPrivate *private)
|
|||||||
static void
|
static void
|
||||||
gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool)
|
gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool)
|
||||||
{
|
{
|
||||||
GimpTool *tool = GIMP_TOOL (rect_tool);
|
GimpRectangleToolPrivate *private;
|
||||||
GimpRectangleOptions *options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
|
GimpTool *tool;
|
||||||
GimpDisplayShell *shell;
|
GimpRectangleOptions *options;
|
||||||
gboolean highlight = FALSE;
|
GimpDisplayShell *shell;
|
||||||
|
gboolean highlight;
|
||||||
|
|
||||||
|
tool = GIMP_TOOL (rect_tool);
|
||||||
|
options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
|
||||||
|
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
|
||||||
|
highlight = FALSE;
|
||||||
|
|
||||||
if (! tool->display)
|
if (! tool->display)
|
||||||
return;
|
return;
|
||||||
@ -2684,7 +2707,12 @@ gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool)
|
|||||||
|
|
||||||
g_object_get (options, "highlight", &highlight, NULL);
|
g_object_get (options, "highlight", &highlight, NULL);
|
||||||
|
|
||||||
if (highlight)
|
/* Don't show the highlight when the mouse is down. */
|
||||||
|
if (! highlight || private->rubber_banding)
|
||||||
|
{
|
||||||
|
gimp_display_shell_set_highlight (shell, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
GimpRectangleToolPrivate *private;
|
GimpRectangleToolPrivate *private;
|
||||||
GdkRectangle rect;
|
GdkRectangle rect;
|
||||||
@ -2698,10 +2726,43 @@ gimp_rectangle_tool_update_highlight (GimpRectangleTool *rect_tool)
|
|||||||
|
|
||||||
gimp_display_shell_set_highlight (shell, &rect);
|
gimp_display_shell_set_highlight (shell, &rect);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_rectangle_tool_rubber_banding_func:
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if the current function is a rubber-banding
|
||||||
|
* function.
|
||||||
|
*/
|
||||||
|
static gboolean
|
||||||
|
gimp_rectangle_tool_rubber_banding_func (GimpRectangleTool *rect_tool)
|
||||||
|
{
|
||||||
|
GimpRectangleToolPrivate *private;
|
||||||
|
gboolean rubber_banding_func;
|
||||||
|
|
||||||
|
rubber_banding_func = FALSE;
|
||||||
|
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
|
||||||
|
|
||||||
|
switch (private->function)
|
||||||
{
|
{
|
||||||
gimp_display_shell_set_highlight (shell, NULL);
|
case RECT_CREATING:
|
||||||
|
case RECT_RESIZING_LEFT:
|
||||||
|
case RECT_RESIZING_RIGHT:
|
||||||
|
case RECT_RESIZING_TOP:
|
||||||
|
case RECT_RESIZING_BOTTOM:
|
||||||
|
case RECT_RESIZING_UPPER_LEFT:
|
||||||
|
case RECT_RESIZING_UPPER_RIGHT:
|
||||||
|
case RECT_RESIZING_LOWER_LEFT:
|
||||||
|
case RECT_RESIZING_LOWER_RIGHT:
|
||||||
|
rubber_banding_func = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
rubber_banding_func = FALSE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return rubber_banding_func;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user