emilk / emilk/egui

egui::Area for egui::Modal precise size

Open
#5,753 0 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

The request
i think it would be great if egui::Area, used in egui::Modal to define the default area that the modal should occupy, had a way to define a fixed dimension. now I'm using this:

Modal::default_area(id)
                        .constrain(false)
                        .default_size(if app_state.reset_button_clicked {
                            UiSize::small_modal_vec_defaultsize()
                        } else {
                            UiSize::modal_vec_defaultsize()
                        }),

but like this if the bigger is used the graphic memory will save the dimension and is going to stay big, leaving a lot of white space.

What should be a good idea
I have no idea of how the Area works, but in my opinion it would be a great idea to implement a fixed size, so the modal will always adapt to that size and not grow bigger or stay bigger following the memory.

I hope I described it well, if not please ask question so i can clear out any doubt 😃

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the egui::Area and egui::Modal entry points, focusing on how default_size, constrain, and remembered dimensions interact. Done means providing a fixed-size option that lets the modal use its requested dimensions without retaining a larger previous size or leaving excess white space.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.