Skip to content

Modify child_window example#4054

Merged
kchibisov merged 21 commits intorust-windowing:masterfrom
Sl-L:dev
Jan 10, 2025
Merged

Modify child_window example#4054
kchibisov merged 21 commits intorust-windowing:masterfrom
Sl-L:dev

Conversation

@Sl-L
Copy link
Contributor

@Sl-L Sl-L commented Dec 23, 2024

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.

Sl-L added 2 commits December 23, 2024 10:37
…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
@Sl-L Sl-L changed the title Dev Modify child_window example Dec 23, 2024
@Sl-L Sl-L requested a review from kchibisov December 25, 2024 16:38
@Sl-L Sl-L requested a review from kchibisov December 28, 2024 14:29
@madsmtm madsmtm added the S - docs Awareness, docs, examples, etc. label Dec 31, 2024
@kchibisov kchibisov merged commit 69382fd into rust-windowing:master Jan 10, 2025
58 checks passed
@Sl-L Sl-L deleted the dev branch January 15, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S - docs Awareness, docs, examples, etc.

Development

Successfully merging this pull request may close these issues.

3 participants