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

Allow for requesting the user's attention to the window #2905

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

TicClick
Copy link
Contributor

@TicClick TicClick commented Apr 16, 2023

calls request_user_attention() with different platform-dependent effects, as seen in UserAttentionType's documentation. the attention type enum (almost) mirrors that of winit's but I'm open to other options if this is not how it should be done.

example action (windows)

source: https://github.com/TicClick/egui-attention-tester

2023-04-16.05-04-18.mp4

@emilk
Copy link
Owner

emilk commented Apr 18, 2023

#2900 has been merged - please rebase on it 🙏

@TicClick TicClick force-pushed the user-attention branch 2 times, most recently from e5c3e60 to f1c9833 Compare April 18, 2023 13:53
@TicClick
Copy link
Contributor Author

all done, thanks for the quick response

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Looks good - it would be nice with a test of this in egui_demo_app:s backend_panel.rs - e.g. a button to request attention after a two-second delay (so the user can alt-tab away and test it properly)

crates/eframe/src/epi.rs Outdated Show resolved Hide resolved
Co-authored-by: Emil Ernerfeldt <[email protected]>
@TicClick
Copy link
Contributor Author

TicClick commented Apr 18, 2023

Looks good - it would be nice with a test of this in egui_demo_app:s backend_panel.rs - e.g. a button to request attention after a two-second delay (so the user can alt-tab away and test it properly)

can do that in the present PR, or file a new one -- what do you prefer? I have a tester app already so it won't be too much work either way

@emilk
Copy link
Owner

emilk commented Apr 18, 2023

A separate app to test this would make sense! Please add it to examples 🙏

@emilk emilk added feature New feature or request eframe Relates to epi and eframe labels Apr 18, 2023
@TicClick TicClick requested a review from emilk April 18, 2023 21:19
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Good example, and works like a charm, but please get rid of the chrono dependency 🙏

examples/user_attention/src/main.rs Outdated Show resolved Hide resolved
examples/user_attention/src/main.rs Outdated Show resolved Hide resolved
@emilk emilk merged commit e3a021e into emilk:master Apr 19, 2023
@emilk
Copy link
Owner

emilk commented Apr 19, 2023

Thank you!

@TicClick TicClick deleted the user-attention branch April 19, 2023 13:57
@TicClick TicClick restored the user-attention branch April 19, 2023 13:57
@TicClick TicClick deleted the user-attention branch April 19, 2023 13:57
@TicClick TicClick restored the user-attention branch April 19, 2023 13:57
@TicClick TicClick deleted the user-attention branch April 19, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants