feat: Extract InspectorController, add panelBuilder & Zoomable Color Picker#19
Open
yelmuratoff wants to merge 14 commits intokekland:masterfrom
Open
feat: Extract InspectorController, add panelBuilder & Zoomable Color Picker#19yelmuratoff wants to merge 14 commits intokekland:masterfrom
yelmuratoff wants to merge 14 commits intokekland:masterfrom
Conversation
…ntroller` and add `panelBuilder` for custom UI.
…vation instead of none.
…nd simplify controller update logic.
…hild and refine color handling logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overall, there aren't any massive changes here. I just added some things I personally found missing during my work and fixed a couple of annoyances.
The main issue was the tight coupling between the UI and the logic. All the management logic was stuck inside the Inspector widget, which made customizing the panel impossible. I figured it was better to move the logic into a separate InspectorController and leave the UI implementation up to the developer.
Panel Builder: Thanks to the controller, you can now build the panel UI however you need using the panelBuilder callback. I kept it backward compatible, though: if you don't provide this parameter, it renders the standard interface just like before. So, for those who don't need customization, nothing changes visually.
Zoom for Color Picker: It was basically impossible to pick a specific pixel on touch screens because your finger blocked the view. I added a zoom overlay (magnifier) on press, so now you can actually see where you are pointing.
This should also resolve #7. Since users can now wrap the Inspector with any UI they want, I updated the example folder to demonstrate this using my
draggable_panelpackage.This PR is just a proposal/idea. Feel free to add to it, change whatever you see fit, or let me know if something needs a change. I just think these features would be useful to a lot of people.