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

Common panels #5659

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Common panels #5659

wants to merge 12 commits into from

Conversation

sharky98
Copy link

⚠️ This would be a breaking change, since use must import the trait to use the methods transfered to the traits.

Merged the sides.
Merged the panel options.

Started panel shows
…move TopBottomSide

NOTE: Non-working commit
following those steps:
1. Rename `egui::SidePanel` with `egui::Panel`.
2. Rename `width` with `size` in all chained methods.
    - `default_width()` to `default_size()`
    - `min_width()` to `min_size()`
    - `max_width()` to `max_size()`
    - `width_range()` to `size_range()`
    - `exact_width()` to `exact_size()`

if using `Panel::new()`, replace
- `Side::Left` with `Side::Vertical(VerticalSide::Left)`
- `Side::Right` with `Side::Vertical(VerticalSide::Right)`

NOTE: Non-working commit
…pBottomPanel when both SidePanel and TopBottomPanel were mentioned.

following those steps:
1. Rename `egui::TopBottomPanel` with `egui::Panel`.
2. Rename `height` with `size` in all chained methods.
    - `default_height()` to `default_size()`
    - `min_height()` to `min_size()`
    - `max_height()` to `max_size()`
    - `height_range()` to `size_range()`
    - `exact_height()` to `exact_size()`

if using `Panel::new()`, replace
- `TopBottomSide::Top` with `Side::Horizontal(HorizontalSide::Top)`
- `TopBottomSide::Bottom` with `Side::Horizontal(HorizontalSide::Bottom)`

NOTE: Non-working commit
- replace switch fn with closures in some places.
- integrate the switch fn inside the main switch.
- make sure lifetime are defined for PanelSizer.
- remove some `mut`, `&`, and `*` where they superfluous.
- wrongly called `ctx()` when it was a variable 🤦.
- cannot use `impl Trait` in a variable declaration type.
@sharky98
Copy link
Author

Locally, all the tests passed (except those regarding git lfs and some images that the delta has nothing to do with my change (more or less text, etc.). The panel demo in egui_demo_app works as before. I did not saw anything different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce a Panel trait for SidePanel and TopBottomPanel
1 participant