mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-01 09:13:19 +00:00
31 lines
638 B
Text
31 lines
638 B
Text
import { Palette } from "Palette.slint";
|
|
|
|
export component Modal inherits Rectangle {
|
|
public function show() {
|
|
if (self.absolute-position.x < 500px) {
|
|
self.x += 500px - self.absolute-position.x;
|
|
}
|
|
if (self.absolute-position.y != 100px) {
|
|
self.y += 100px - self.absolute-position.y;
|
|
}
|
|
popup.show()
|
|
}
|
|
|
|
public function close() {
|
|
popup.close()
|
|
}
|
|
|
|
popup := PopupWindow {
|
|
close-policy: close-on-click-outside;
|
|
background := Rectangle {
|
|
height: 100%;
|
|
width: 100%;
|
|
background: Palette.background1;
|
|
border-color: Palette.popup-border;
|
|
border-width: 1px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
@children
|
|
}
|
|
}
|