Constrain date picker to screen (#1699)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
parent
62a00c4597
commit
4525cad7af
1 changed files with 4 additions and 0 deletions
|
@ -95,6 +95,10 @@ impl<'a> Widget for DatePickerButton<'a> {
|
||||||
if pos.x + width_with_padding > ui.clip_rect().right() {
|
if pos.x + width_with_padding > ui.clip_rect().right() {
|
||||||
pos.x = button_response.rect.right() - width_with_padding;
|
pos.x = button_response.rect.right() - width_with_padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check to make sure the calendar never is displayed out of window
|
||||||
|
pos.x = pos.x.max(ui.style().spacing.window_margin.left);
|
||||||
|
|
||||||
//TODO(elwerene): Better positioning
|
//TODO(elwerene): Better positioning
|
||||||
|
|
||||||
let area_response = Area::new(ui.make_persistent_id(&self.id_source))
|
let area_response = Area::new(ui.make_persistent_id(&self.id_source))
|
||||||
|
|
Loading…
Reference in a new issue