1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Add Area::constrain_to and Window::constrain_to (#3396)

* Rename `drag_bounds` to `constrain_to`

and allow turning off constraining for `Window`s

* Constrain DatePicker popup to screen

* Fix typo
This commit is contained in:
Emil Ernerfeldt
2023-09-27 08:40:24 +02:00
committed by GitHub
parent 1911248ade
commit 1b18f8e266
6 changed files with 72 additions and 41 deletions

View File

@@ -117,6 +117,7 @@ impl<'a> Widget for DatePickerButton<'a> {
} = Area::new(ui.make_persistent_id(self.id_source))
.order(Order::Foreground)
.fixed_pos(pos)
.constrain_to(ui.ctx().screen_rect())
.show(ui.ctx(), |ui| {
let frame = Frame::popup(ui.style());
frame