-
Notifications
You must be signed in to change notification settings - Fork 922
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
Modify child_window example #4054
Open
Sl-L
wants to merge
20
commits into
rust-windowing:master
Choose a base branch
from
Sl-L:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
…ith a different color than the parent window and made it so the child windows fill a grid instead of stacking on top of one another
kchibisov
requested changes
Dec 25, 2024
…til/fill.rs and defined fill_window with it
kchibisov
requested changes
Dec 28, 2024
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.
Currently, the child_window example fills the child windows with the same color as the parent window, so the creation and presence of a child window is only perceptible through the terminal messages. In addition to that, all child windows are placed on top of one another.
What I did was change the fill_window function defined in examples/util/fill.rs so that it accepts a color argument, then I had to copy the color that was hardcoded and put it as argument on all calls to fill_window on the other examples. I originally wanted use transparency on the parent window instead, changing the alpha channel of the color on fill_window and adding the transparency attribute to the parent window but, while it worked for me, there's an open issue in transparency (#2502) so I decided it may not be a good idea
After that I added a child_counter to spawn_child_window of the child_window example and use it to calculate a position for the new child_window on a 5 column grid. Also changed the child window size from 200x200 to 128x96 so that a 5x5 grid gets formed if the initial size of the parent window is kept.