diff --git a/ags/widget/PopupWindow.ts b/ags/widget/PopupWindow.ts index 755f51f..4b382d1 100644 --- a/ags/widget/PopupWindow.ts +++ b/ags/widget/PopupWindow.ts @@ -8,6 +8,7 @@ type PopupWindowSpecificProps = { onButtonPressEvent?: (self: Gtk.Widget, event: Gdk.Event) => void; /** Stylesheet for the background of the popup-window */ cssBackgroundWindow?: string; + onClickedOutside?: (self: Widget.Window) => void; }; export type PopupWindowProps = Pick (allocation.x + allocation.width)) || (y < allocation.y || y > (allocation.y + allocation.height))) { - self.close(); + if(!props.onClickedOutside) { + self.close(); + return; + } + + props.onClickedOutside?.(self); } } },