flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
6.43k stars 215 forks source link

reset colors #1068

Closed Doublonmousse closed 2 months ago

Doublonmousse commented 3 months ago

To fix #1056

A few things I'm not too sure about

image

flxzt commented 2 months ago

Shouldn't this be a reset for all color picker palette colors as described in issue #1056 ?

Doublonmousse commented 2 months ago

I'm not 100 % sure. Given the current position, one would expect it only applies to color picker palettes of the Document part of settings. But I don't want to mix things that affect the document (document background, grid color) with ones that don't (choice of pen colors).

Ideally this button should be in the color picker. But that means modifying the color picker (where almost all default colors are presented, though not in the exact same order) image

The current position of the button is very similar to the revert/apply buttons for the page format. Maybe It'd be better to mirror this for the Document section and have a reset/templates button combo (with the templates part to populate maybe later)

Doublonmousse commented 2 months ago

Maybe it'd be better to add a right click menu (that would also be triggered by a long touch press, and maybe pen long press) for each color in the color picker window to reset the colors.

(similar to how a right click in the color picker shows a customize option)

That could also be done for the individual color setters that are in the settings panel.

Doublonmousse commented 2 months ago

Well I tried to detect right clicks and long press gestures on each RnColorSetter but only right click gesture detection works. Long press will only work once for each color setter then stop working.

Not sure how to do it correctly and where to put code between RnColorSetter and RnColorPicker, so if anyone has a better idea on how to do that (I would've added a dropdown menu with at least a reset option for each color), feel free to continue this PR.

Will close it otherwise

flxzt commented 2 months ago

The long-press Gtk gesture has some issues, it's finicky to make it work. I've had similar issues with it in the past. I think the idea to implement the reset in this is very good in general, maybe we can revisit it at some point..

Doublonmousse commented 2 weeks ago

Relevant thread : https://discourse.gnome.org/t/gtk4-need-button-pressed-and-released-signals/8506/18

Basically this is something that gtk lets you do, even though it's almost guaranteed not to work. Creating a custom widget is needed

flxzt commented 2 weeks ago

Yeah in this case I can understand the reasoning why this can't be supported by the default GtkButton implementation. Subclassing and create a custom widget actually isn't that uncommon, we already do that in several places in the app