summaryrefslogtreecommitdiff
path: root/gjs/src
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-06-26 02:20:59 +0200
committerAylur <[email protected]>2024-06-26 02:20:59 +0200
commit710e419986b671dbe02021f19e9fe94e0d17ccb3 (patch)
tree0dedeeb4d7c9469e36fdeaf508fc97282b8aa0db /gjs/src
parent03228cdb160cff067e562a6ab7f8650af23358bd (diff)
feat: widget click through
Diffstat (limited to 'gjs/src')
-rw-r--r--gjs/src/astalify.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/gjs/src/astalify.ts b/gjs/src/astalify.ts
index 6c74179..f198f68 100644
--- a/gjs/src/astalify.ts
+++ b/gjs/src/astalify.ts
@@ -67,6 +67,7 @@ export type Widget<C extends { new(...args: any): Gtk.Widget }> = InstanceType<C
className: string
css: string
cursor: Cursor
+ clickThrough: boolean
toggleClassName(name: string, on?: boolean): void
hook(
object: Connectable,
@@ -205,6 +206,15 @@ function proxify<
this.cursor = cursor
}
+ Object.defineProperty(klass.prototype, "clickThrough", {
+ get() { return Astal.widget_get_click_through(this) },
+ set(v) { Astal.widget_set_click_through(this, v) },
+ })
+
+ klass.prototype.set_click_through = function(clickThrough: boolean) {
+ this.clickThrough = clickThrough
+ }
+
const proxy = new Proxy(klass, {
construct(_, [conf, ...children]) {
const self = new klass
@@ -256,6 +266,7 @@ export type ConstructProps<
className?: string
css?: string
cursor?: string
+ clickThrough?: boolean
}> & {
onDestroy?: (self: Widget<Self>) => unknown
onDraw?: (self: Widget<Self>) => unknown