Skip to content
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

feat: use_window_size #34

Merged
merged 6 commits into from
Apr 19, 2024
Merged

Conversation

DogeDark
Copy link
Member

Adds a new hook and function for cross-platform window size retrieving.

fn App() -> Element {
    let window_size = use_window_size();

    rsx! {
        p { "Width: {window_size.0}" }
        p { "Height: {window_size.1}" }
    }
}

@DogeDark DogeDark added the enhancement New feature or request label Apr 18, 2024
@DogeDark DogeDark self-assigned this Apr 18, 2024
@DogeDark DogeDark requested a review from marc2332 April 18, 2024 05:04
Copy link
Collaborator

@marc2332 marc2332 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest looks good!

Cargo.toml Outdated Show resolved Hide resolved
@marc2332 marc2332 changed the title Use Window Size Hook feat: use_window_size Apr 18, 2024
@DogeDark DogeDark requested a review from marc2332 April 18, 2024 17:54
sdk/src/utils/window.rs Outdated Show resolved Hide resolved
Co-authored-by: Marc Espin <[email protected]>
@DogeDark DogeDark merged commit 57c6ff6 into DioxusLabs:master Apr 19, 2024
4 checks passed
@DogeDark DogeDark deleted the use_window_size branch April 19, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants