parent
e47f6ea0d7
commit
e3ca8dc85e
5 changed files with 234 additions and 32 deletions
nixosModules/ags/v2/widgets
|
@ -1,4 +1,4 @@
|
|||
import { Astal, Widget } from 'astal/gtk3';
|
||||
import { App, Astal, Widget } from 'astal/gtk3';
|
||||
import { register, property } from 'astal/gobject';
|
||||
import { Binding, idle } from 'astal';
|
||||
|
||||
|
@ -19,7 +19,7 @@ type PopupWindowProps = Widget.WindowProps & {
|
|||
|
||||
|
||||
@register()
|
||||
class PopupWindow extends Widget.Window {
|
||||
export class PopupWindow extends Widget.Window {
|
||||
@property(String)
|
||||
declare transition: HyprTransition | Binding<HyprTransition>;
|
||||
|
||||
|
@ -33,8 +33,8 @@ class PopupWindow extends Widget.Window {
|
|||
declare on_close: PopupCallback;
|
||||
|
||||
constructor({
|
||||
transition = 'fade',
|
||||
close_on_unfocus = 'none',
|
||||
transition = 'slide top',
|
||||
close_on_unfocus = 'released',
|
||||
on_open = () => { /**/ },
|
||||
on_close = () => { /**/ },
|
||||
|
||||
|
@ -45,7 +45,7 @@ class PopupWindow extends Widget.Window {
|
|||
}: PopupWindowProps) {
|
||||
super({
|
||||
...rest,
|
||||
name,
|
||||
name: `win-${name}`,
|
||||
namespace: `win-${name}`,
|
||||
visible: false,
|
||||
layer,
|
||||
|
@ -57,6 +57,8 @@ class PopupWindow extends Widget.Window {
|
|||
}),
|
||||
});
|
||||
|
||||
App.add_window(this);
|
||||
|
||||
const setTransition = (_: PopupWindow, t: HyprTransition | Binding<HyprTransition>) => {
|
||||
hyprMessage(`keyword layerrule animation ${t}, ${this.name}`);
|
||||
};
|
||||
|
|
|
@ -13,28 +13,7 @@ import { HasNotifs } from './notification';
|
|||
import { get_hyprland_monitor } from '../../lib';
|
||||
|
||||
/* Types */
|
||||
interface Layer {
|
||||
address: string
|
||||
x: number
|
||||
y: number
|
||||
w: number
|
||||
h: number
|
||||
namespace: string
|
||||
}
|
||||
interface Levels {
|
||||
0?: Layer[] | null
|
||||
1?: Layer[] | null
|
||||
2?: Layer[] | null
|
||||
3?: Layer[] | null
|
||||
}
|
||||
interface Layers {
|
||||
levels: Levels
|
||||
}
|
||||
type LayerResult = Record<string, Layers>;
|
||||
interface CursorPos {
|
||||
x: number
|
||||
y: number
|
||||
}
|
||||
import { CursorPos, LayerResult } from '../../lib';
|
||||
|
||||
|
||||
const display = Gdk.Display.get_default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue