serge-rgb / milton

An infinite-canvas paint program
GNU General Public License v3.0
1.53k stars 133 forks source link

Linux stylus buttons #207

Open MaciejWieczor opened 1 year ago

MaciejWieczor commented 1 year ago

I added two entries in the settings menu to give stylus buttons some common functionalities. While being able to change the lower button bind to for example "switch to brush" it is still able to pan the canvas (this allows some function on the upper button and pan + return to brush on the lower one). All code running is inside #ifdef linux clauses as on windows stylus buttons functions are defined with the gui driver

Screenshot-2023-05-29-14:54:28

All changes in the settings for the stylus are persistent. For now only functions that came to my mind were switch to brush and eraser and changing the size of the brush (as these are the ones I use the most probably)

MaciejWieczor commented 1 year ago

This PR responds to this issue: #177

serge-rgb commented 1 year ago

Hey Maciej, thanks for the PR.

There are some changes that would make the code better.

Here's some stuff I did in my local branch:

These are two things that I still intend to look at -

My plan is to finish those two items and then merge your PR. Will probably get back to it next week, so feel free to do the same changes yourself and I can merge them. If not, just wait and I will post here when I finish it

MaciejWieczor commented 1 year ago

I had some time so I tried reformatting my changes. Hopefully they are going to be more helpful than problematic :b

On the two other things