-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic icon positon depending on ui-scale #225
Merged
Merged
Conversation
This file contains 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
Once you have implemented everything you want to with this, are happy with the functionality, and convert this from a draft pr to a regular pr, then we will review this. It might take some time before we get to it, depending on our personal schedules and free cycles, but we are aware of it. |
This information may be usefull elsewhere. The value is checked to be inside the expected range.
klingbolt
suggested changes
Nov 20, 2023
To avoid code duplication the core functionality of _on_Dialog_hide was moved to an independet function.
AsherGlick
reviewed
Nov 20, 2023
This check does not hold a real value while most components of burrito only work reliable on fullscreen anyway.
Instead of calculating the position it is now directly read from a dictionary as an absolute value.
AsherGlick
approved these changes
Nov 25, 2023
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.
This PR aims to change the position of the main button/icon according to the used ui-scale.
Nothing will be scaled or otherwise resized, all this PR does is recalculating the position.
What needs to happen to move the button/icon and the clickable are.
Burrito/Spatial.tscn
Lines 74 to 75 in a344bdf
set_minimal_mouse_block()
must be called once after changing the margins.Burrito/Spatial.gd
Line 121 in a344bdf
How to calculate the margins.
Every button has a fixed width depending on the ui-scale.
If we know the width of one button we can calculate the margin of every n..th button.
So we can preset the button width for every scale, we can also preset the desired position of our button. (e.g. if the native ui has 10 buttons we want to be on position 11.)
After reading the ui-scale from the link, it can be used to select the appropriate base width and calculate the final position.
Possible conflicts.
When the function
set_minimal_mouse_block()
is called, the clickable area of all open windows will be deleted.So the user will see the windows but can no longer interact with them.