Improve contrast for crosshair cursors
ClosedPublic

Authored by ndavis on Nov 13 2018, 11:38 AM.

Details

Summary

The crosshair cursors had barely visible outlines, unlike their companions, so they were almost impossible to distinguish against backgrounds of a similar color. This patch fixes that.

BUG: 400110
FIXED-IN: 5.12.8

Test Plan

Breeze crosshair against a dark background:

Breeze Snow crosshair against a light background:

Diff Detail

Repository
R31 Breeze
Branch
better-crosshair-cursor (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4918
Build 4936: arc lint + arc unit
ngraham created this revision.Nov 13 2018, 11:38 AM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 13 2018, 11:38 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Nov 13 2018, 11:38 AM
ngraham edited the test plan for this revision. (Show Details)Nov 13 2018, 11:39 AM
ngraham added a reviewer: Plasma.
ndavis added a subscriber: ndavis.Nov 13 2018, 4:29 PM

What color is the area on the inside of the cursor? I'm not sure, but it looks like it has a gradient, which doesn't really match the other Breeze cursors.

It is indeed a weird gradient. I was just trying to make the minimum required number of changes to fix the bug, but I can fix that too if you'd like.

It is indeed a weird gradient. I was just trying to make the minimum required number of changes to fix the bug, but I can fix that too if you'd like.

Yes, if you're going to add an outline like the other breeze cursor states, you might as well make the inside match. I think it wold probably look better too.

ngraham edited the test plan for this revision. (Show Details)Nov 13 2018, 6:48 PM
ngraham updated this revision to Diff 45429.Nov 13 2018, 6:51 PM

Remove interior gradients in favor of a flat fill of the standard color

You should probably do Breeze Snow as well since it has the exact same issue. In fact, it's probably even worse since a majority of websites use a white background.

ndavis added a comment.EditedNov 13 2018, 6:55 PM

Those crosshair outlines seem to be a bit jagged, unlike the other breeze cursors.

Yeah, they currently have hard edges. I'm sadly pretty abysmal with this kind of pixel art, but hopefully I'll muddle through...

Yeah, they currently have hard edges. I'm sadly pretty abysmal with this kind of pixel art, but hopefully I'll muddle through...

Maybe the original cursors were made with SVG sources? Could those be found somewhere?

Yeah, they currently have hard edges. I'm sadly pretty abysmal with this kind of pixel art, but hopefully I'll muddle through...

Maybe the original cursors were made with SVG sources? Could those be found somewhere?

Oh, so they were! They're right there in cursors/Breeze/src/cursors.svg cursors/Breeze_Snow/src/cursors.svg

The good news is that this means we can do it right! The bad news is that it might take me a while to figure out how to get from point A to point B here. :) I'll give it my best shot.

Turns out there already is an outline, but it's at 10% opacity instead of 100% and the crosshair doesn't have a blurred shadow around it like the other breeze cursors. I think we should do our best to try to keep the crosshair feeling precise while also improving the contrast around it.

Would you like to take over? I have a feeling that you can do a better job than I can, and you also know what you're doing with the tools, too. :)

Would you like to take over? I have a feeling that you can do a better job than I can, and you also know what you're doing with the tools, too. :)

Sure. I've basically already completed it from fooling around.

ndavis commandeered this revision.Nov 13 2018, 7:13 PM
ndavis added a reviewer: ngraham.

I find the Breeze Snow cursors to bee generally lacking in contrast because of the 60% opacity outline. Should I expand this commit to improve the contrast for all Breeze Snow cursors as well?

Go for it! That bugged me too.

What's the best way to update this diff? What I'm doing completely discards your changes. Should I get this diff with arc patch D16861 and then update the diff from that branch or can I make my own branch and do arc diff --update D16861 to overwrite your changes?

I think either way would work. For maximum surety, I would download it locally and then do arc diff --update D16861.

Why do we have the cursor theme pre-built in the repo? It's making Arcanist take forever.

Don't ask me, I just live here. :)

ndavis updated this revision to Diff 45434.Nov 13 2018, 8:49 PM

Improve contrast for Breeze Snow and Breeze crosshair

I'd like to remove the extra junk, but I don't want to break anything either.

So is there a script that regenerates all the X11 cursor files from the SVG whenever it's changed or something? Because I'm willing to bet you didn't change all 654 cursors...

ndavis retitled this revision from Improve crosshair cursor to Improve contrast for Breeze Snow and the Breeze crosshair.Nov 13 2018, 8:59 PM
ndavis edited the summary of this revision. (Show Details)
ndavis edited the test plan for this revision. (Show Details)

So is there a script that regenerates all the X11 cursor files from the SVG whenever it's changed or something? Because I'm willing to bet you didn't change all 654 cursors...

There's a build.sh file that uses xcursorgen. I used that.

ndavis planned changes to this revision.Nov 13 2018, 9:29 PM

Hmm some of the cursors seem blurrier than they used to be and I have no idea why.

FWIW the actual crosshair cursors seem better to me now, especially the Breeze snow one. You could maybe just take the changed files for the crosshairs and make a new diff with just them if you can't figure out the other issue.

I think I found the reason why the prebuilt cursor themes are included in the repo in the README:

No trimming will have been done to the cursors, and X11 *may* give you split-second glitches when switching cursors making them appear to 'jump' for an instant. To remedy this, you will need to open any auto-generated in gimp and re-export when with the “trim whitespace” option checked. I do not beleive it impacts all versions of X, or Wayland.

You will need the “X11 Mouse Cursor (XMC)” plugin for GIMP installed to trim the cursors if you choose to do so.

Imagine that, reading the README. :) If manual work is required for each image, that seems like all the more reason to only include the two changed ones in the diff.

ndavis retitled this revision from Improve contrast for Breeze Snow and the Breeze crosshair to Improve contrast for crosshair cursors.Nov 13 2018, 11:33 PM
ndavis edited the summary of this revision. (Show Details)
ndavis edited the test plan for this revision. (Show Details)

Imagine that, reading the README. :) If manual work is required for each image, that seems like all the more reason to only include the two changed ones in the diff.

Yep. This is a terrible workflow. I hope all of this is simpler in Wayland. One SVG for each cursor and just using the SVGs as cursor files would be ideal.

ndavis updated this revision to Diff 45482.Nov 14 2018, 8:06 PM

Only change crosshair cursors and source SVG

ndavis edited the test plan for this revision. (Show Details)Nov 14 2018, 8:22 PM
ndavis edited the test plan for this revision. (Show Details)Nov 14 2018, 8:26 PM
ngraham accepted this revision.Nov 14 2018, 8:32 PM

Lovely work :)

I notice this is now branched off of master. Could you land this on the Plasma/5.12 branch and then merge to Plasma/5.14 and then master? This is documented at https://community.kde.org/Infrastructure/Phabricator#Landing_on_the_.22Stable_branch.22, but please feel free to hit me up for details if anything isn't clear.

This revision is now accepted and ready to land.Nov 14 2018, 8:32 PM
This revision was automatically updated to reflect the committed changes.