diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-07-19 17:27:14 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-07-19 17:27:14 +0900 |
| commit | 3c1cc04020678b76a622a1a7a28a2c1e529f7665 (patch) | |
| tree | c191782fc9e8c9eee61f64450726c77a3cae65ed /config/ags/modules/.widgethacks/popupwindow.js | |
| parent | ef1b52470a5fd2ec4b5b24ea6c1d56ca62c3c9fa (diff) | |
updated copy.sh and still added ags
Diffstat (limited to 'config/ags/modules/.widgethacks/popupwindow.js')
| -rw-r--r-- | config/ags/modules/.widgethacks/popupwindow.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config/ags/modules/.widgethacks/popupwindow.js b/config/ags/modules/.widgethacks/popupwindow.js new file mode 100644 index 00000000..26dad59c --- /dev/null +++ b/config/ags/modules/.widgethacks/popupwindow.js @@ -0,0 +1,32 @@ +import App from 'resource:///com/github/Aylur/ags/app.js'; +import Widget from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Window } = Widget; + + +export default ({ + name, + child, + showClassName = "", + hideClassName = "", + ...props +}) => { + return Window({ + name, + visible: false, + layer: 'overlay', + ...props, + + child: Box({ + setup: (self) => { + self.hook(App, (self, currentName, visible) => { + if (currentName === name) { + self.toggleClassName(hideClassName, !visible); + } + }).keybind("Escape", () => App.closeWindow(name)) + if (showClassName !== "" && hideClassName !== "") + self.className = `${showClassName} ${hideClassName}`; + }, + child: child, + }), + }); +}
\ No newline at end of file |
