From a8bbf6b29b9095eb6e3475b6c4941d33a89ba46d Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 12 Apr 2008 11:40:52 +0000 Subject: [PATCH] Applied modified patch from Daniel Hornung that changes the mouse cursor 2008-04-12 Martin Nordholts Applied modified patch from Daniel Hornung that changes the mouse cursor to a "clicking will create a selection"-icon when hovering the center of a pending Scissors Select Tool selection (bug #493370) * app/tools/gimpiscissorstool.c (gimp_iscissors_tool_cursor_update): Use the new cursor icon. * cursors/modifier-select.png * cursors/xbm/modifier-select.xbm * cursors/xbm/modifier-select-mask.xbm: New cursor icon. * cursors/makefile.msc * cursors/Makefile.am * app/widgets/gimpcursor.c * app/widgets/widgets-enums.h: Changed accordingly. svn path=/trunk/; revision=25473 --- ChangeLog | 18 +++++++++++++++ app/tools/gimpiscissorstool.c | 32 +++++++++++++++++++++------ app/widgets/gimpcursor.c | 8 +++++++ app/widgets/widgets-enums.h | 1 + cursors/Makefile.am | 1 + cursors/makefile.msc | 1 + cursors/modifier-select.png | Bin 0 -> 221 bytes cursors/xbm/modifier-select-mask.xbm | 14 ++++++++++++ cursors/xbm/modifier-select.xbm | 14 ++++++++++++ 9 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 cursors/modifier-select.png create mode 100644 cursors/xbm/modifier-select-mask.xbm create mode 100644 cursors/xbm/modifier-select.xbm diff --git a/ChangeLog b/ChangeLog index 469407013a..00597fa893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-04-12 Martin Nordholts + + Applied modified patch from Daniel Hornung that changes the mouse + cursor to a "clicking will create a selection"-icon when hovering + the center of a pending Scissors Select Tool selection (bug #493370) + + * app/tools/gimpiscissorstool.c + (gimp_iscissors_tool_cursor_update): Use the new cursor icon. + + * cursors/modifier-select.png + * cursors/xbm/modifier-select.xbm + * cursors/xbm/modifier-select-mask.xbm: New cursor icon. + + * cursors/makefile.msc + * cursors/Makefile.am + * app/widgets/gimpcursor.c + * app/widgets/widgets-enums.h: Changed accordingly. + 2008-04-12 Martin Nordholts * plug-ins/script-fu/scripts/3d-outline.scm diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 0be4104960..76f9552f88 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -1018,9 +1018,18 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool, switch (iscissors->op) { case ISCISSORS_OP_SELECT: - GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, - state, display); - return; + { + GimpSelectionOptions *options; + + options = GIMP_SELECTION_TOOL_GET_OPTIONS (tool); + + /* Do not overwrite the modifiers for add, subtract, intersect */ + if(options->operation == GIMP_CHANNEL_OP_REPLACE) + { + modifier = GIMP_CURSOR_MODIFIER_SELECT; + } + } + break; case ISCISSORS_OP_MOVE_POINT: modifier = GIMP_CURSOR_MODIFIER_MOVE; @@ -1042,10 +1051,19 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool, break; } - gimp_tool_set_cursor (tool, display, - GIMP_CURSOR_MOUSE, - GIMP_TOOL_CURSOR_ISCISSORS, - modifier); + + if (modifier != GIMP_CURSOR_MODIFIER_NONE) + { + gimp_tool_set_cursor (tool, display, + GIMP_CURSOR_MOUSE, + GIMP_TOOL_CURSOR_ISCISSORS, + modifier); + } + else + { + GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, + state, display); + } } static gboolean diff --git a/app/widgets/gimpcursor.c b/app/widgets/gimpcursor.c index 5b27ceca76..07a4b2c8a6 100644 --- a/app/widgets/gimpcursor.c +++ b/app/widgets/gimpcursor.c @@ -158,6 +158,8 @@ #include "cursors/xbm/modifier-pattern-mask.xbm" #include "cursors/xbm/modifier-join.xbm" #include "cursors/xbm/modifier-join-mask.xbm" +#include "cursors/xbm/modifier-select.xbm" +#include "cursors/xbm/modifier-select-mask.xbm" typedef struct _GimpCursor GimpCursor; @@ -587,6 +589,12 @@ static GimpCursor gimp_cursor_modifiers[] = modifier_join_width, modifier_join_height, 0, 0, modifier_join, NULL, NULL, NULL + }, + { + modifier_select_bits, modifier_select_mask_bits, + modifier_select_width, modifier_select_height, + 0, 0, + modifier_select, NULL, NULL, NULL } }; diff --git a/app/widgets/widgets-enums.h b/app/widgets/widgets-enums.h index fb5e8ee749..9ba74ef913 100644 --- a/app/widgets/widgets-enums.h +++ b/app/widgets/widgets-enums.h @@ -280,6 +280,7 @@ typedef enum /*< skip >*/ GIMP_CURSOR_MODIFIER_BACKGROUND, GIMP_CURSOR_MODIFIER_PATTERN, GIMP_CURSOR_MODIFIER_JOIN, + GIMP_CURSOR_MODIFIER_SELECT, GIMP_CURSOR_MODIFIER_LAST } GimpCursorModifier; diff --git a/cursors/Makefile.am b/cursors/Makefile.am index 3a4894568b..9034529463 100644 --- a/cursors/Makefile.am +++ b/cursors/Makefile.am @@ -30,6 +30,7 @@ CURSOR_IMAGES = \ modifier-pattern.png \ modifier-plus.png \ modifier-resize.png \ + modifier-select.png \ \ tool-airbrush.png \ tool-blend.png \ diff --git a/cursors/makefile.msc b/cursors/makefile.msc index fffd20ead9..5693542ebe 100644 --- a/cursors/makefile.msc +++ b/cursors/makefile.msc @@ -30,6 +30,7 @@ CURSOR_LIST = \ modifier_pattern modifier-pattern.png \ modifier_plus modifier-plus.png \ modifier_resize modifier-resize.png \ + modifier_select modifier-select.png \ \ tool_airbrush tool-airbrush.png \ tool_blend tool-blend.png \ diff --git a/cursors/modifier-select.png b/cursors/modifier-select.png new file mode 100644 index 0000000000000000000000000000000000000000..b116153665eaa2d0c4a2ad520715f74dba4a7ab0 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkED zxeh4sxLoWx{^IX>wJ!ojcdx`ca`A@!%wOE%pmN0J&8f1jvF?VcqSLRuSA1E~^>-1o zX6yYYQ+uxU%O&on_i-)SiH}|f-59Bd;y85}S Ib4q9e00Fj3?EnA( literal 0 HcmV?d00001 diff --git a/cursors/xbm/modifier-select-mask.xbm b/cursors/xbm/modifier-select-mask.xbm new file mode 100644 index 0000000000..a9eb4a5b52 --- /dev/null +++ b/cursors/xbm/modifier-select-mask.xbm @@ -0,0 +1,14 @@ +#define modifier_select_mask_width 32 +#define modifier_select_mask_height 32 +static unsigned char modifier_select_mask_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0xe0, 0x3d, + 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x38, 0xe0, + 0x00, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x10, 0x40, + 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0xe0, 0x3d, 0x00, 0x00, 0xc0, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/cursors/xbm/modifier-select.xbm b/cursors/xbm/modifier-select.xbm new file mode 100644 index 0000000000..434321e671 --- /dev/null +++ b/cursors/xbm/modifier-select.xbm @@ -0,0 +1,14 @@ +#define modifier_select_width 32 +#define modifier_select_height 32 +static unsigned char modifier_select_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, + 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };