Closed freakode closed 7 years ago
Note that this PR makes the Horizontal Value - Title Panels all have the same behavior as KeyPanels previously had.
Hey, I really liked the idea of merging the rendering code for all the panels. I noticed a lot of switch statements on the rendering mode in your implementation though. So I moved all the logic specific to a rendering mode to the corresponding mode. This will also make adding possible future modes easier.
I did some testing to verify that none of the rendering bugs I encountered before occurred and everything seems fine.
If you're okay with the changes I made I'll merge this. Or if you have any corrections/suggestions we can discuss those.
Yeah I like those changes! It definitely makes the code even cleaner. I'm fine with merging this.
Thanks again ^^. There's still some things I'd like to refactor myself, but I'll probably release a new version soon.
BasePanel and KeyPanel share most of their rendering code since KeyPanel is essentially just a BasePanel with the ability to toggle the color of the panel if its key is pressed. This functionality was added to BasePanel, along with general refactoring to make its intent clearer, and KeyPanel was refactored to subclass BasePanel.