app: use the unobtrusive cursor only in no-pointer+no-outline case.

We take a step back from the original MR which was proposing the "single
dot" cursor as a new "Pointer mode" option. I was really unsure this was
the best solution, especially reading again the whole original report.
It means that now nearly all of the original patch has been rewritten
another way, but let's leave the contributor commit as a start point to
get to where we are, and as acknowledgement of the contribution.

The reporter was annoyed by the crosshair when none were requested and
probably mostly for painting tools only (at least examples were about
brush or pencil, etc.) while showing outline. It looks to me like the
real issue was maybe when we were showing the big crosshair when using
the 4-arc fallback outline, for instance when using a dynamics changing
size. If so, this main issue is already fixed by my commit 64dc26064b.
No need of a new option for this, especially if the option can be as
confusing as a barely visible dot-cursor (I can already imagine the bug
reports of people tweaking random preferences and unhappy because the
pointer became invisible, while they don't know how they did it).

Instead I would say that when people specifically uncheck both "Show
brush outline" and "Show pointer" options, showing a huge crosshair
feels quite counter-productive. This is where I think that our small
unobtrusive cursor (probably a better name than "Single dot" by the way,
as it's not a single dot anymore) might be of use, the ultimate case
when someone really want a cursor as inconspicuous as possible, while
still having a visible feedback of the pointer position (even with
display-tablets, parallax issues make such a visual feedback important
to target where one paints).
So let's try this first and see how it goes.
This commit is contained in:
Jehan 2022-03-13 13:10:36 +01:00
parent 365478f24d
commit fc063cb2ca
5 changed files with 33 additions and 23 deletions

View File

@ -78,7 +78,6 @@ gimp_cursor_mode_get_type (void)
{ GIMP_CURSOR_MODE_TOOL_ICON, "GIMP_CURSOR_MODE_TOOL_ICON", "tool-icon" },
{ GIMP_CURSOR_MODE_TOOL_CROSSHAIR, "GIMP_CURSOR_MODE_TOOL_CROSSHAIR", "tool-crosshair" },
{ GIMP_CURSOR_MODE_CROSSHAIR, "GIMP_CURSOR_MODE_CROSSHAIR", "crosshair" },
{ GIMP_CURSOR_MODE_SINGLE_DOT, "GIMP_CURSOR_MODE_SINGLE_DOT", "single-dot" },
{ 0, NULL, NULL }
};
@ -87,7 +86,6 @@ gimp_cursor_mode_get_type (void)
{ GIMP_CURSOR_MODE_TOOL_ICON, NC_("cursor-mode", "Tool icon"), NULL },
{ GIMP_CURSOR_MODE_TOOL_CROSSHAIR, NC_("cursor-mode", "Tool icon with crosshair"), NULL },
{ GIMP_CURSOR_MODE_CROSSHAIR, NC_("cursor-mode", "Crosshair only"), NULL },
{ GIMP_CURSOR_MODE_SINGLE_DOT, NC_("cursor-mode", "Single dot"), NULL },
{ 0, NULL, NULL }
};

View File

@ -53,7 +53,6 @@ typedef enum
GIMP_CURSOR_MODE_TOOL_ICON, /*< desc="Tool icon" >*/
GIMP_CURSOR_MODE_TOOL_CROSSHAIR, /*< desc="Tool icon with crosshair" >*/
GIMP_CURSOR_MODE_CROSSHAIR, /*< desc="Crosshair only" >*/
GIMP_CURSOR_MODE_SINGLE_DOT /*< desc="Single dot" >*/
} GimpCursorMode;

View File

@ -417,8 +417,10 @@ _("When enabled, dialogs will show a help button that gives access to " \
"be reached by pressing F1.")
#define SHOW_PAINT_TOOL_CURSOR_BLURB \
_("When enabled, the mouse pointer will be shown over the image while " \
"using a paint tool.")
_("When enabled, the pointer will be shown over the image while " \
"using a paint tool. " \
"If both the brush outline and pointer are disabled, the " \
"position will be indicated as unobtrusively as possibly.")
#define SHOW_MENUBAR_BLURB \
_("When enabled, the menubar is visible by default. This can also be " \

View File

@ -242,7 +242,8 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
}
if (cursor_type != GIMP_CURSOR_NONE &&
cursor_type != GIMP_CURSOR_BAD)
cursor_type != GIMP_CURSOR_BAD &&
cursor_type != GIMP_CURSOR_SINGLE_DOT)
{
switch (shell->display->config->cursor_mode)
{
@ -270,11 +271,6 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
modifier = GIMP_CURSOR_MODIFIER_NONE;
}
break;
case GIMP_CURSOR_MODE_SINGLE_DOT:
cursor_type = GIMP_CURSOR_SINGLE_DOT;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
break;
}
}

View File

@ -569,10 +569,16 @@ gimp_paint_tool_cursor_update (GimpTool *tool,
if (! paint_tool->show_cursor &&
modifier != GIMP_CURSOR_MODIFIER_BAD)
{
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_NONE,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
if (paint_tool->draw_brush)
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_NONE,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
else
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_SINGLE_DOT,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
return;
}
@ -869,15 +875,24 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
! paint_tool->show_cursor &&
! paint_tool->draw_circle)
{
/* don't leave the user without any indication and draw
* a fallback crosshair
/* I am not sure this case can/should ever happen since now we
* always set the GIMP_CURSOR_SINGLE_DOT when neither pointer
* nor outline options are checked. Yet let's imagine any
* weird case where brush outline is wanted, without pointer
* cursor, yet we fail to draw the outline while neither
* circle nor fallbacks are requested (it depends on per-class
* implementation of get_outline()).
*
* In such a case, we don't want to leave the user without any
* indication so we draw a fallback crosshair.
*/
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSSHAIR,
cur_x, cur_y,
GIMP_TOOL_HANDLE_SIZE_CROSSHAIR,
GIMP_TOOL_HANDLE_SIZE_CROSSHAIR,
GIMP_HANDLE_ANCHOR_CENTER);
if (paint_tool->draw_brush)
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
cur_x, cur_y,
GIMP_TOOL_HANDLE_SIZE_CROSSHAIR,
GIMP_TOOL_HANDLE_SIZE_CROSSHAIR,
GIMP_HANDLE_ANCHOR_CENTER);
}
}