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

UiBuilder #4634

Closed
emilk opened this issue Jun 7, 2024 · 0 comments
Closed

UiBuilder #4634

emilk opened this issue Jun 7, 2024 · 0 comments

Comments

@emilk
Copy link
Owner

emilk commented Jun 7, 2024

Problem

There are too many helpers for building child Uis:

  • ui.add_visible_ui
  • ui.scope
  • ui.with_layout
  • ui.push_id
  • ui.push_stack_info

There are also a few setting you can set, which would be better set once at creating, and never changed:

  • opacity
  • visibility
  • enabledness
  • sizing_pass

Solution

We should create a UiBuilder for creating new Uis, using a builder-pattern.

Optional settings include:

  • id source
  • layout
  • sizing_pass
  • visibility
  • opacity
  • enabled
  • stack_info
  • frame??

Then we can start deprecating some functions on Ui

@emilk emilk added this to the Next Major Release milestone Jun 7, 2024
emilk added a commit that referenced this issue Aug 26, 2024
* Part of #4634

The goals is to create fewer, more powerful entry points.


### Added
* `egui::UiBuilder`
* `Ui::allocate_new_ui`
* `Ui::new_child`

### Breaking changes
* `Ui::new` now takes a `UiBuilder`
* Deprecated
	* `ui.add_visible_ui`
	* `ui.allocate_ui_at_rect`
	* `ui.child_ui`
	* `ui.child_ui_with_id_source`
	* `ui.push_stack_info`
@emilk emilk closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant