xournalpp / xournalpp

Xournal++ is a handwriting notetaking software with PDF annotation support. Written in C++ with GTK3, supporting Linux (e.g. Ubuntu, Debian, Arch, SUSE), macOS and Windows 10. Supports pen input from devices such as Wacom Tablets.
https://xournalpp.github.io
GNU General Public License v2.0
11.2k stars 801 forks source link

Option to keep eraser cursor the same as pen cursor #1910

Open 0ffz opened 4 years ago

0ffz commented 4 years ago

Is your feature request related to a problem? Please describe. I have my stylus set up to erase when I press one of the side buttons. When I go to erase something, it switches to the eraser's square cursor, which I find distracting.

Describe the solution you'd like I don't find this to be an issue with any other tools, so I think a simple option for the eraser tool to use the pen cursor would be enough.

I've been meaning to contribute to the project for a while now, and this sounds easy enough to pull off myself, so if this is a really low priority for any of the active developers, I could get a PR going if someone gives me the go-ahead.

My only concern is that this sounds like a very specific issue which might be better left implemented on a larger scale, i.e. customizing any tool to use any cursor, which sounds quite a bit harder to implement properly. I can't think of any more uses for that off the top of my head, perhaps someone else can think of some?

Technius commented 4 years ago

Yes, the eraser definitely could use some improvement.

When I go to erase something, it switches to the eraser's square cursor, which I find distracting.

Which part do you exactly find distracting? I personally find the opacity of the eraser to be very distracting as I can't see what I'm erasing.

I've been meaning to contribute to the project for a while now, and this sounds easy enough to pull off myself, so if this is a really low priority for any of the active developers, I could get a PR going if someone gives me the go-ahead.

That would be great! Most of the team is either busy or working on other major issues right now, like the viewport refactor or the new file format. You'll want to look in src/gui/XournalppCursor.cpp. Let us know if you need help.

My only concern is that this sounds like a very specific issue which might be better left implemented on a larger scale, i.e. customizing any tool to use any cursor, which sounds quite a bit harder to implement properly.

The actual changing of cursors shouldn't be complicated (see XournalppCursor). The largest amount of work will probably be in implementing the configuration settings to go along with it.

0ffz commented 4 years ago

Personally I find the square makes it hard to see where the center of the cursor is. I get it's meant to be representative of the area it's erasing, but it's just weird going from a point to a square, especially on a 2-in-1 where you're writing right on the screen and that precision in a way leads to responsiveness.

I think the visual feedback of the tool switching is just too much. I think some people might prefer knowing the exact bounds of what they're erasing, so that's why I want to keep this optional.

I was thinking of also playing around with making it draw a circle with a white center and black outline, so you'd still get a bit of feedback, but it wouldn't be nearly as great.

Also, now that I think about it, it's pretty annoying when you lift your pen off while erasing, and the square just stays there, though maybe that's a different problem, since it's still a little annoying with the pen's dot, you just notice it a lot less. Has a timeout on the cursors been considered before?

0ffz commented 4 years ago

Having played around with it a bit, it's extremely easy to just change the cursor, but I'm really new to C++ and GTK3 so I don't know how to make it configurable. I was originally thinking of making it a toggle option beneath eraser options in the tool menu, but I think it'd be better to have a menu that lets you define a map of tools to cursors, though the GUI for that is definitely outside my abilities. Perhaps this could lead to some new cursor variants for people to choose from in the future.

LittleHuba commented 4 years ago

I'm quite sure we had that idea once to actually make the cursors per tool selectable but I can't seem to find that ticket on short notice. You can create the GUI using Glade-Editor which allows you to edit it graphically. Then take a look at how the Settings Dialog works. We have already gone some way to make this easier. You don't learn anything new if you don't go outside your comfort zone. 😉

If you have any problems you can't solve yourself we are happy to help you out on Gitter!

Febbe commented 4 years ago

I really don't like the eraser cursor to have the same size than the pen cursor. I also hate the new marker cursor. The cursor should exactly represent the size of the drawing/erasing

LittleHuba commented 4 years ago

These cursors should have the color, alpha and size of what they do. That way you can actually see in advance how the document will change once you press the button.

Febbe commented 4 years ago

Yes exactly. So having a white/background colored square or circle with the erasers size is exactly what we want.

LittleHuba commented 4 years ago

Eraser should be handled slightly different. I'd add a border with the reverse color to the background color. The whole circle including the border should make up the area that is erased. That makes the eraser better visible.

0ffz commented 4 years ago

I think most people would prefer the current, more exact eraser, but I use it to delete full strokes anyways, so the size doesn't really help convey any information. To be honest, maybe specifically for erasers it'd be nice to have a single point option for the size, which could use the pen cursor.

Either way, if I do anything with the cursor customization, it wouldn't touch any of the defaults. I'm fine with getting out of my comfort zone to learn, it's just that this would take me a lot longer to actually complete!

LittleHuba commented 4 years ago

Well it might still be a lot faster thanwhat we can promise. We are a team of about 6 devs working more or less actively (freetime dependend) on this project playing catch-up with a few hundred issues and a major rewrite underway...

So try your hand and if you don't manage we at least have some stuff to continue from and/or you learned something about C++ and GTK. Win win!

Febbe commented 4 years ago

@0ffz oh yes I forgot about the stroke eraser. In this case the size of deletion circle should have the same size as the pen radius. And so the drawn eraser circle.

nekohayo commented 3 years ago

I find the size/shape representation useful. However, if precision is your issue, perhaps its fill color could be made semi-transparent, and have an "X" or "+" crosshair in the middle to indicate the center?