diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-30 21:46:40 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-30 21:46:40 +1100 |
| commit | 966ec5023a61bfdc1135fa3bf71b87e63c9ff383 (patch) | |
| tree | 8f885c8e139eed1d7e7940f6188e3aebd105cd2b /src | |
| parent | imports: use typescript import paths (diff) | |
| download | caelestia-shell-966ec5023a61bfdc1135fa3bf71b87e63c9ff383.tar.gz caelestia-shell-966ec5023a61bfdc1135fa3bf71b87e63c9ff383.tar.bz2 caelestia-shell-966ec5023a61bfdc1135fa3bf71b87e63c9ff383.zip | |
allow toggling sideleft and right from cli
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/popupwindow.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/widgets/popupwindow.ts b/src/widgets/popupwindow.ts index 39fff5e..ffed396 100644 --- a/src/widgets/popupwindow.ts +++ b/src/widgets/popupwindow.ts @@ -12,7 +12,6 @@ export default class PopupWindow extends Widget.Window { constructor(props: Widget.WindowProps) { super({ keymode: Astal.Keymode.ON_DEMAND, - exclusivity: Astal.Exclusivity.IGNORE, borderWidth: 20, // To allow shadow, cause if not it gets cut off ...props, visible: false, @@ -40,9 +39,25 @@ export default class PopupWindow extends Widget.Window { else if (marginLeft + pWidth > mWidth) marginLeft = mWidth - pWidth; this.anchor = Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT; + this.exclusivity = Astal.Exclusivity.IGNORE; this.marginLeft = marginLeft; this.marginTop = cy + (height - y); this.show(); } + + popup_at_corner(corner: `${"top" | "bottom"} ${"left" | "right"}`) { + let anchor = 0; + if (corner.includes("top")) anchor |= Astal.WindowAnchor.TOP; + else anchor |= Astal.WindowAnchor.BOTTOM; + if (corner.includes("left")) anchor |= Astal.WindowAnchor.LEFT; + else anchor |= Astal.WindowAnchor.RIGHT; + + this.anchor = anchor; + this.exclusivity = Astal.Exclusivity.NORMAL; + this.marginLeft = 0; + this.marginTop = 0; + + this.show(); + } } |