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

Add methods to collapse a window #358

Open
emilk opened this issue May 8, 2021 · 9 comments · May be fixed by #4835 or #3517
Open

Add methods to collapse a window #358

emilk opened this issue May 8, 2021 · 9 comments · May be fixed by #4835 or #3517
Labels
feature New feature or request

Comments

@emilk
Copy link
Owner

emilk commented May 8, 2021

We should add two methods to egui::Window

  • default_collapsed: set whether the initial state of the window is collapsed
  • collapsed: set whether the current state of the window is collapsed
@emilk emilk added the feature New feature or request label May 8, 2021
@nside
Copy link

nside commented May 8, 2021

i'll take it

@nside
Copy link

nside commented May 8, 2021

i've got this nside@9285214 but it's overriding the state in the collapsing header. somehow the ctx is needed to retrieve the header state. how would you handle this?

@nside
Copy link

nside commented May 8, 2021

why not keep the collapsing header state in the window struct?

@emilk
Copy link
Owner Author

emilk commented May 9, 2021

struct Window is a builder - it stores no state at all between frames. The position and size of a window is stored in area::State, the scroll offset in scroll_area::State, the collapsing state in collapsing_header::State.

@nside
Copy link

nside commented May 9, 2021

I meant adding an Option<collapsing_header::State> field to the struct Window - similar to how area and scroll are handled. Otherwise the collapsed bool would need to be handled similarly to the window open state?

@leo848
Copy link

leo848 commented Nov 3, 2022

Any updates on this? Is there any way to have a window collapsed by default at this point?

@lordbenedikt
Copy link

I also would like this feature. I'm creating an editor app with lots of functionalities that shouldn't be visible right at startup.

Norlock added a commit to Norlock/egui that referenced this issue Nov 1, 2023
Fixes: emilk#358

You can open / close windows programmatically to events. See demo about.

The good thing about the new API, is that it won't lock the
borrowchecker (unlike open). It's maybe a good idea to considering open
as deprecated.
Norlock added a commit to Norlock/egui that referenced this issue Nov 1, 2023
Fixes: emilk#358

You can open / close windows programmatically to events. See demo about.

The good thing about the new API, is that it won't lock the
borrowchecker (unlike open). It's maybe a good idea to considering open
as deprecated.
@Norlock Norlock linked a pull request Nov 1, 2023 that will close this issue
Norlock added a commit to Norlock/egui that referenced this issue Nov 1, 2023
Fixes: emilk#358

You can open / close windows programmatically to events. See demo about.

The good thing about the new API, is that it won't lock the
borrowchecker (unlike open). It's maybe a good idea to considering open
as deprecated.
Norlock added a commit to Norlock/egui that referenced this issue Nov 1, 2023
Fixes: emilk#358

You can open / close windows programmatically to events. See demo about.

The good thing about the new API, is that it won't lock the
borrowchecker (unlike open). It's maybe a good idea to considering open
as deprecated.
@konradmoesch
Copy link

I'd also like this feature. Is someone working on this? I see #3517 marked as draft with no progress for four months.
Are you still working on it, @Norlock?
Or would you be open to me taking over the PR or making a whole new attempt at this feature?

@Norlock
Copy link

Norlock commented Jul 14, 2024

You can also continue, I have been busy with other projects so haven't really looked into it. But let me try if I can make an improvement (today/tomorrow). I will have to look at the code again.

@Norlock Norlock linked a pull request Jul 16, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
6 participants