n00kii / egui-modal

a simple modal library for egui
MIT License
57 stars 9 forks source link

Allow modals to have a window frame and title #18

Open zeozeozeo opened 3 months ago

zeozeozeo commented 3 months ago

https://github.com/n00kii/egui-modal/assets/108888572/0d4e6b64-c65c-4865-b6e8-e73e6f185975

This allows for modal to have an egui window border with a custom title and an ❌ button to close the modal

n00kii commented 3 months ago

thank you for this. i'm wondering if it might be better to just switch the current implementation of titling to use the window title. the only problem i can think of right now is that the window title gives an implicit "close" option (the x icon) in situations where a developer might not want to give the user an option to ignore the choices presented by the modal. perhaps we can rid of the x icon?

zeozeozeo commented 3 months ago

thank you for this. i'm wondering if it might be better to just switch the current implementation of titling to use the window title. the only problem i can think of right now is that the window title gives an implicit "close" option (the x icon) in situations where a developer might not want to give the user an option to ignore the choices presented by the modal. perhaps we can rid of the x icon?

https://github.com/n00kii/egui-modal/assets/108888572/bbf8933e-84db-49d6-9057-2001474669b5

this works, but i'm not sure if it should be shown by default. and since it's better to switch the implementation to just using window titles, should the old title thing be removed?

n00kii commented 3 months ago

this works, but i'm not sure if it should be shown by default. and since it's better to switch the implementation to just using window titles, should the old title thing be removed?

indeed, the close button should be off by default; removing the old title implementation would be great!