mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 04:48:27 +00:00
Align DatePickerPopup and TimePickerPopup placement logic (#9410)
Updated the `width` and `height` properties of `DatePickerPopup` and `TimePickerPopup` components to use dynamic sizing based on `dialog` dimensions instead of fixed pixel values. Previously, the lack of `width` and `height` in `TimePickerPopup` caused inconsistent placement when displayed at a specific location: - `DatePickerPopup` was centered on the given (x, y) - `TimePickerPopup` used its top-left corner as the anchor point Now both components consistently render centered at the specified (x, y). Fixes #9262
This commit is contained in:
parent
30e52ffa9a
commit
d89f8cfe17
10 changed files with 30 additions and 10 deletions
|
|
@ -17,8 +17,9 @@ export component DatePickerPopup inherits PopupWindow {
|
|||
callback canceled();
|
||||
callback accepted(date: Date);
|
||||
|
||||
width: 368px;
|
||||
height: 524px;
|
||||
width: dialog.width;
|
||||
height: dialog.height;
|
||||
|
||||
close-policy: PopupClosePolicy.no-auto-close;
|
||||
|
||||
background-layer := MenuBorder {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ export component TimePickerPopup inherits PopupWindow {
|
|||
callback canceled();
|
||||
callback accepted(/* current-time */ Time);
|
||||
|
||||
width: dialog.width;
|
||||
height: dialog.height;
|
||||
|
||||
close-policy: PopupClosePolicy.no-auto-close;
|
||||
|
||||
background-layer := MenuBorder {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue