mbrlabs / Lorien

Infinite canvas drawing/whiteboarding app for Windows, Linux and macOS. Made with Godot.
MIT License
5.54k stars 239 forks source link

Disable undo/redo buttons when there is nothing to undo/redo #291

Closed SamTheBlow closed 2 months ago

SamTheBlow commented 2 months ago

Second take. (First take: #256) I've rewritten it from scratch for the new Godot 4 version. I think my new approach looks much cleaner; let me know if anything needs to be changed.

I've tested it and it works as expected when switching between tabs, adding tabs, closing tabs, and loading projects. And this time the undo/redo buttons don't react when you zoom in/out, although, zooming still incorrectly dirties the project as mentioned in my previous PR.

SamTheBlow commented 2 months ago

New commit!

The _on_active_project_changed method is meant to be an event. So, I added a signal "active_project_changed" so that it really is called like an event now. Thanks for pointing it out. Let me know if you like this more, otherwise we can just rename the method like you suggested