From c3c40547939b342f7d7ec8e3f43a59dc3a2d34d8 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 14 Jan 2025 10:12:20 -0500 Subject: [PATCH] refactor(ags4): split up astalify code --- .../{subclasses => astalify}/astalify.ts | 137 +++--------------- modules/ags/gtk4/widget/astalify/bindings.ts | 27 ++++ .../_astal.ts => astalify/construct.ts} | 94 +----------- .../ags/gtk4/widget/astalify/controller.ts | 120 +++++++++++++++ modules/ags/gtk4/widget/astalify/generics.ts | 28 ++++ modules/ags/gtk4/widget/astalify/index.ts | 5 + modules/ags/gtk4/widget/subclasses/box.ts | 2 +- modules/ags/gtk4/widget/subclasses/button.ts | 2 +- .../ags/gtk4/widget/subclasses/calendar.ts | 2 +- .../ags/gtk4/widget/subclasses/centerbox.ts | 2 +- modules/ags/gtk4/widget/subclasses/entry.ts | 2 +- modules/ags/gtk4/widget/subclasses/image.ts | 2 +- modules/ags/gtk4/widget/subclasses/label.ts | 2 +- .../ags/gtk4/widget/subclasses/levelbar.ts | 2 +- .../ags/gtk4/widget/subclasses/menubutton.ts | 2 +- modules/ags/gtk4/widget/subclasses/overlay.ts | 6 +- modules/ags/gtk4/widget/subclasses/popover.ts | 2 +- .../ags/gtk4/widget/subclasses/revealer.ts | 2 +- modules/ags/gtk4/widget/subclasses/slider.ts | 2 +- modules/ags/gtk4/widget/subclasses/stack.ts | 2 +- modules/ags/gtk4/widget/subclasses/switch.ts | 2 +- modules/ags/gtk4/widget/subclasses/window.ts | 2 +- 22 files changed, 223 insertions(+), 224 deletions(-) rename modules/ags/gtk4/widget/{subclasses => astalify}/astalify.ts (51%) create mode 100644 modules/ags/gtk4/widget/astalify/bindings.ts rename modules/ags/gtk4/widget/{subclasses/_astal.ts => astalify/construct.ts} (53%) create mode 100644 modules/ags/gtk4/widget/astalify/controller.ts create mode 100644 modules/ags/gtk4/widget/astalify/generics.ts create mode 100644 modules/ags/gtk4/widget/astalify/index.ts diff --git a/modules/ags/gtk4/widget/subclasses/astalify.ts b/modules/ags/gtk4/widget/astalify/astalify.ts similarity index 51% rename from modules/ags/gtk4/widget/subclasses/astalify.ts rename to modules/ags/gtk4/widget/astalify/astalify.ts index d6d7c36f..f37e9bd2 100644 --- a/modules/ags/gtk4/widget/subclasses/astalify.ts +++ b/modules/ags/gtk4/widget/astalify/astalify.ts @@ -1,126 +1,22 @@ -// A mixin class must have a constructor with a single rest parameter of type 'any[]' -/* eslint "@typescript-eslint/no-explicit-any": ["error", { "ignoreRestArgs": true }] */ - import { property, register } from 'astal'; -import { Gdk, Gtk } from 'astal/gtk4'; -import Binding, { type Connectable, type Subscribable } from 'astal/binding'; +import { Gtk, hook } from 'astal/gtk4'; +import { type Connectable, type Subscribable } from 'astal/binding'; + +import construct from './construct'; +import setupControllers from './controller'; import { - type EventController, - hook, + type BindableProps, + dummyBuilder, + type MixinParams, noImplicitDestroy, setChildren, - construct, -} from './_astal'; + childType, +} from './generics'; -import { type AstalifyProps, type BindableProps } from './_astal'; -export { type AstalifyProps, type BindableProps }; - -export type BindableChild = Gtk.Widget | Binding; - -export const type = Symbol('child type'); -const dummyBuilder = new Gtk.Builder(); - -const setupControllers = (widget: Gtk.Widget, { - onFocusEnter, - onFocusLeave, - onKeyPressed, - onKeyReleased, - onKeyModifier, - onLegacy, - onButtonPressed, - onButtonReleased, - onHoverEnter, - onHoverLeave, - onMotion, - onScroll, - onScrollDecelerate, - ...props -}: EventController & T) => { - if (onFocusEnter || onFocusLeave) { - const focus = new Gtk.EventControllerFocus(); - - widget.add_controller(focus); - - if (onFocusEnter) { focus.connect('focus-enter', () => onFocusEnter(widget)); } - - if (onFocusLeave) { focus.connect('focus-leave', () => onFocusLeave(widget)); } - } - - if (onKeyPressed || onKeyReleased || onKeyModifier) { - const key = new Gtk.EventControllerKey(); - - widget.add_controller(key); - - if (onKeyPressed) { - key.connect('key-pressed', (_, val, code, state) => onKeyPressed(widget, val, code, state)); - } - - if (onKeyReleased) { - key.connect('key-released', (_, val, code, state) => - onKeyReleased(widget, val, code, state)); - } - - if (onKeyModifier) { - key.connect('modifiers', (_, state) => onKeyModifier(widget, state)); - } - } - - if (onLegacy || onButtonPressed || onButtonReleased) { - const legacy = new Gtk.EventControllerLegacy(); - - widget.add_controller(legacy); - - legacy.connect('event', (_, event) => { - if (event.get_event_type() === Gdk.EventType.BUTTON_PRESS) { - onButtonPressed?.(widget, event as Gdk.ButtonEvent); - } - - if (event.get_event_type() === Gdk.EventType.BUTTON_RELEASE) { - onButtonReleased?.(widget, event as Gdk.ButtonEvent); - } - - onLegacy?.(widget, event); - }); - } - - if (onMotion || onHoverEnter || onHoverLeave) { - const hover = new Gtk.EventControllerMotion(); - - widget.add_controller(hover); - - if (onHoverEnter) { - hover.connect('enter', (_, x, y) => onHoverEnter(widget, x, y)); - } - - if (onHoverLeave) { - hover.connect('leave', () => onHoverLeave(widget)); - } - - if (onMotion) { - hover.connect('motion', (_, x, y) => onMotion(widget, x, y)); - } - } - - if (onScroll || onScrollDecelerate) { - const scroll = new Gtk.EventControllerScroll(); - - widget.add_controller(scroll); - - if (onScroll) { - scroll.connect('scroll', (_, x, y) => onScroll(widget, x, y)); - } - - if (onScrollDecelerate) { - scroll.connect('decelerate', (_, x, y) => onScrollDecelerate(widget, x, y)); - } - } - - return props; -}; export default < - C extends new (...props: any[]) => Gtk.Widget, + C extends new (...props: MixinParams) => Gtk.Widget, ConstructorProps, >( cls: C, @@ -151,12 +47,12 @@ export default < } - declare private [type]: string; + declare private [childType]: string; @property(String) - get type(): string { return this[type]; } + get type(): string { return this[childType]; } - set type(value: string) { this[type] = value; } + set type(value: string) { this[childType] = value; } @property(Object) @@ -194,7 +90,7 @@ export default < widget.vfunc_add_child( dummyBuilder, child, - type in widget ? widget[type] as string : null, + childType in widget ? widget[childType] as string : null, ); } } @@ -234,7 +130,7 @@ export default < } - constructor(...params: any[]) { + constructor(...params: MixinParams) { const props = params[0] || {}; super('cssName' in props ? { cssName: props.cssName } : {}); @@ -264,5 +160,6 @@ export default < Partial> >; + // override the parameters of the `super` constructor return Widget as unknown as WidgetClass; }; diff --git a/modules/ags/gtk4/widget/astalify/bindings.ts b/modules/ags/gtk4/widget/astalify/bindings.ts new file mode 100644 index 00000000..c23001cc --- /dev/null +++ b/modules/ags/gtk4/widget/astalify/bindings.ts @@ -0,0 +1,27 @@ +import { Variable } from 'astal'; +import { Binding } from 'astal/binding'; + + +export const mergeBindings = ( + array: (Value | Binding | Binding)[], +): Value[] | Binding => { + const getValues = (args: Value[]) => { + let i = 0; + + return array.map((value) => value instanceof Binding ? + args[i++] : + value); + }; + + const bindings = array.filter((i) => i instanceof Binding); + + if (bindings.length === 0) { + return array as Value[]; + } + + if (bindings.length === 1) { + return (bindings[0] as Binding).as(getValues); + } + + return Variable.derive(bindings, getValues)(); +}; diff --git a/modules/ags/gtk4/widget/subclasses/_astal.ts b/modules/ags/gtk4/widget/astalify/construct.ts similarity index 53% rename from modules/ags/gtk4/widget/subclasses/_astal.ts rename to modules/ags/gtk4/widget/astalify/construct.ts index 4c41f4e4..27d108d6 100644 --- a/modules/ags/gtk4/widget/subclasses/_astal.ts +++ b/modules/ags/gtk4/widget/astalify/construct.ts @@ -1,92 +1,14 @@ -import { execAsync, Variable } from 'astal'; -import { type Gdk, type Gtk, type ConstructProps } from 'astal/gtk4'; -import { Binding, type Connectable, kebabify, snakeify, type Subscribable } from 'astal/binding'; +import { execAsync } from 'astal'; +import { type Gtk, type ConstructProps } from 'astal/gtk4'; +import { Binding, kebabify, snakeify } from 'astal/binding'; -export interface EventController { - onFocusEnter?: (self: Self) => void - onFocusLeave?: (self: Self) => void +import { mergeBindings } from './bindings'; +import { type EventController } from './controller'; +import { type AstalifyProps, type BindableProps, type GenericWidget, setChildren } from './generics'; - onKeyPressed?: (self: Self, keyval: number, keycode: number, state: Gdk.ModifierType) => void - onKeyReleased?: (self: Self, keyval: number, keycode: number, state: Gdk.ModifierType) => void - onKeyModifier?: (self: Self, state: Gdk.ModifierType) => void - onLegacy?: (self: Self, event: Gdk.Event) => void - onButtonPressed?: (self: Self, state: Gdk.ButtonEvent) => void - onButtonReleased?: (self: Self, state: Gdk.ButtonEvent) => void - - onHoverEnter?: (self: Self, x: number, y: number) => void - onHoverLeave?: (self: Self) => void - onMotion?: (self: Self, x: number, y: number) => void - - onScroll?: (self: Self, dx: number, dy: number) => void - onScrollDecelerate?: (self: Self, vel_x: number, vel_y: number) => void -} - -export type BindableProps = { - [K in keyof T]: Binding | T[K]; -}; - -export interface AstalifyProps { - css: string - child: Gtk.Widget - children: Gtk.Widget[] -} - -export const noImplicitDestroy = Symbol('no no implicit destroy'); -export const setChildren = Symbol('children setter method'); - -const mergeBindings = ( - array: (Value | Binding | Binding)[], -): Value[] | Binding => { - const getValues = (args: Value[]) => { - let i = 0; - - return array.map((value) => value instanceof Binding ? - args[i++] : - value); - }; - - const bindings = array.filter((i) => i instanceof Binding); - - if (bindings.length === 0) { - return array as Value[]; - } - - if (bindings.length === 1) { - return (bindings[0] as Binding).as(getValues); - } - - return Variable.derive(bindings, getValues)(); -}; - -export const hook = ( - widget: Widget, - object: Connectable | Subscribable, - signalOrCallback: string | ((self: Widget, ...args: unknown[]) => void), - callback?: (self: Widget, ...args: unknown[]) => void, -) => { - if (typeof object.connect === 'function' && callback) { - const id = object.connect(signalOrCallback, (_: unknown, ...args: unknown[]) => { - callback(widget, ...args); - }); - - widget.connect('destroy', () => { - (object.disconnect as Connectable['disconnect'])(id); - }); - } - else if (typeof object.subscribe === 'function' && typeof signalOrCallback === 'function') { - const unsub = object.subscribe((...args: unknown[]) => { - signalOrCallback(widget, ...args); - }); - - widget.connect('destroy', unsub); - } -}; - -export const construct = < - Self extends InstanceType & { - [setChildren]: (children: Gtk.Widget[]) => void - }, +export default < + Self extends GenericWidget, Props extends Gtk.Widget.ConstructorProps, >( widget: Self, diff --git a/modules/ags/gtk4/widget/astalify/controller.ts b/modules/ags/gtk4/widget/astalify/controller.ts new file mode 100644 index 00000000..48c0fdb0 --- /dev/null +++ b/modules/ags/gtk4/widget/astalify/controller.ts @@ -0,0 +1,120 @@ +import { Gdk, Gtk } from 'astal/gtk4'; + +export interface EventController { + onFocusEnter?: (self: Self) => void + onFocusLeave?: (self: Self) => void + + onKeyPressed?: (self: Self, keyval: number, keycode: number, state: Gdk.ModifierType) => void + onKeyReleased?: (self: Self, keyval: number, keycode: number, state: Gdk.ModifierType) => void + onKeyModifier?: (self: Self, state: Gdk.ModifierType) => void + + onLegacy?: (self: Self, event: Gdk.Event) => void + onButtonPressed?: (self: Self, state: Gdk.ButtonEvent) => void + onButtonReleased?: (self: Self, state: Gdk.ButtonEvent) => void + + onHoverEnter?: (self: Self, x: number, y: number) => void + onHoverLeave?: (self: Self) => void + onMotion?: (self: Self, x: number, y: number) => void + + onScroll?: (self: Self, dx: number, dy: number) => void + onScrollDecelerate?: (self: Self, vel_x: number, vel_y: number) => void +} + + +export default (widget: Gtk.Widget, { + onFocusEnter, + onFocusLeave, + onKeyPressed, + onKeyReleased, + onKeyModifier, + onLegacy, + onButtonPressed, + onButtonReleased, + onHoverEnter, + onHoverLeave, + onMotion, + onScroll, + onScrollDecelerate, + ...props +}: EventController & T) => { + if (onFocusEnter || onFocusLeave) { + const focus = new Gtk.EventControllerFocus(); + + widget.add_controller(focus); + + if (onFocusEnter) { focus.connect('focus-enter', () => onFocusEnter(widget)); } + + if (onFocusLeave) { focus.connect('focus-leave', () => onFocusLeave(widget)); } + } + + if (onKeyPressed || onKeyReleased || onKeyModifier) { + const key = new Gtk.EventControllerKey(); + + widget.add_controller(key); + + if (onKeyPressed) { + key.connect('key-pressed', (_, val, code, state) => onKeyPressed(widget, val, code, state)); + } + + if (onKeyReleased) { + key.connect('key-released', (_, val, code, state) => + onKeyReleased(widget, val, code, state)); + } + + if (onKeyModifier) { + key.connect('modifiers', (_, state) => onKeyModifier(widget, state)); + } + } + + if (onLegacy || onButtonPressed || onButtonReleased) { + const legacy = new Gtk.EventControllerLegacy(); + + widget.add_controller(legacy); + + legacy.connect('event', (_, event) => { + if (event.get_event_type() === Gdk.EventType.BUTTON_PRESS) { + onButtonPressed?.(widget, event as Gdk.ButtonEvent); + } + + if (event.get_event_type() === Gdk.EventType.BUTTON_RELEASE) { + onButtonReleased?.(widget, event as Gdk.ButtonEvent); + } + + onLegacy?.(widget, event); + }); + } + + if (onMotion || onHoverEnter || onHoverLeave) { + const hover = new Gtk.EventControllerMotion(); + + widget.add_controller(hover); + + if (onHoverEnter) { + hover.connect('enter', (_, x, y) => onHoverEnter(widget, x, y)); + } + + if (onHoverLeave) { + hover.connect('leave', () => onHoverLeave(widget)); + } + + if (onMotion) { + hover.connect('motion', (_, x, y) => onMotion(widget, x, y)); + } + } + + if (onScroll || onScrollDecelerate) { + const scroll = new Gtk.EventControllerScroll(); + + widget.add_controller(scroll); + + if (onScroll) { + scroll.connect('scroll', (_, x, y) => onScroll(widget, x, y)); + } + + if (onScrollDecelerate) { + scroll.connect('decelerate', (_, x, y) => onScrollDecelerate(widget, x, y)); + } + } + + return props; +}; diff --git a/modules/ags/gtk4/widget/astalify/generics.ts b/modules/ags/gtk4/widget/astalify/generics.ts new file mode 100644 index 00000000..d4d006fa --- /dev/null +++ b/modules/ags/gtk4/widget/astalify/generics.ts @@ -0,0 +1,28 @@ +import { Gtk } from 'astal/gtk4'; +import { Binding } from 'astal/binding'; + +// A mixin class must have a constructor with a single rest parameter of type 'any[]' +// eslint-disable-next-line "@typescript-eslint/no-explicit-any" +export type MixinParams = any[]; + +export type BindableChild = Gtk.Widget | Binding; + +export type BindableProps = { + [K in keyof T]: Binding | T[K]; +}; + +export const noImplicitDestroy = Symbol('no no implicit destroy'); +export const setChildren = Symbol('children setter method'); +export const childType = Symbol('child type'); + +export const dummyBuilder = new Gtk.Builder(); + +export type GenericWidget = InstanceType & { + [setChildren]: (children: Gtk.Widget[]) => void +}; + +export interface AstalifyProps { + css: string + child: Gtk.Widget + children: Gtk.Widget[] +} diff --git a/modules/ags/gtk4/widget/astalify/index.ts b/modules/ags/gtk4/widget/astalify/index.ts new file mode 100644 index 00000000..80986ad2 --- /dev/null +++ b/modules/ags/gtk4/widget/astalify/index.ts @@ -0,0 +1,5 @@ +import astalify from './astalify'; + +export default astalify; + +export { type AstalifyProps, type BindableProps, childType } from './generics'; diff --git a/modules/ags/gtk4/widget/subclasses/box.ts b/modules/ags/gtk4/widget/subclasses/box.ts index 9a22016a..2ba6eae8 100644 --- a/modules/ags/gtk4/widget/subclasses/box.ts +++ b/modules/ags/gtk4/widget/subclasses/box.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Astal, type ConstructProps, Gtk } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type BoxProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/button.ts b/modules/ags/gtk4/widget/subclasses/button.ts index 5308b7b9..d932596b 100644 --- a/modules/ags/gtk4/widget/subclasses/button.ts +++ b/modules/ags/gtk4/widget/subclasses/button.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; type ButtonSignals = Record<`on${string}`, unknown[]> & { diff --git a/modules/ags/gtk4/widget/subclasses/calendar.ts b/modules/ags/gtk4/widget/subclasses/calendar.ts index ede72aec..c7a86e93 100644 --- a/modules/ags/gtk4/widget/subclasses/calendar.ts +++ b/modules/ags/gtk4/widget/subclasses/calendar.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; type CalendarSignals = Record<`on${string}`, unknown[]> & { diff --git a/modules/ags/gtk4/widget/subclasses/centerbox.ts b/modules/ags/gtk4/widget/subclasses/centerbox.ts index e72de0a9..b7de42f5 100644 --- a/modules/ags/gtk4/widget/subclasses/centerbox.ts +++ b/modules/ags/gtk4/widget/subclasses/centerbox.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type CenterBoxProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/entry.ts b/modules/ags/gtk4/widget/subclasses/entry.ts index 32546625..14362955 100644 --- a/modules/ags/gtk4/widget/subclasses/entry.ts +++ b/modules/ags/gtk4/widget/subclasses/entry.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; type EntrySignals = Record<`on${string}`, unknown[]> & { diff --git a/modules/ags/gtk4/widget/subclasses/image.ts b/modules/ags/gtk4/widget/subclasses/image.ts index 74a71f8c..c58a9322 100644 --- a/modules/ags/gtk4/widget/subclasses/image.ts +++ b/modules/ags/gtk4/widget/subclasses/image.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type ImageProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/label.ts b/modules/ags/gtk4/widget/subclasses/label.ts index 80168a62..e5691fee 100644 --- a/modules/ags/gtk4/widget/subclasses/label.ts +++ b/modules/ags/gtk4/widget/subclasses/label.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type LabelProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/levelbar.ts b/modules/ags/gtk4/widget/subclasses/levelbar.ts index 5a10e367..39dca036 100644 --- a/modules/ags/gtk4/widget/subclasses/levelbar.ts +++ b/modules/ags/gtk4/widget/subclasses/levelbar.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type LevelBarProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/menubutton.ts b/modules/ags/gtk4/widget/subclasses/menubutton.ts index aa09f4f2..bfb0283a 100644 --- a/modules/ags/gtk4/widget/subclasses/menubutton.ts +++ b/modules/ags/gtk4/widget/subclasses/menubutton.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type MenuButtonProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/overlay.ts b/modules/ags/gtk4/widget/subclasses/overlay.ts index ca0e90d5..a53e9ad2 100644 --- a/modules/ags/gtk4/widget/subclasses/overlay.ts +++ b/modules/ags/gtk4/widget/subclasses/overlay.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type, type AstalifyProps } from './astalify'; +import astalify, { childType, type AstalifyProps } from '../astalify'; export type OverlayProps = ConstructProps< @@ -29,8 +29,8 @@ export class OverlayClass extends astalify(Gtk.Overlay) { setChildren(self: OverlayClass, children: Gtk.Widget[]) { for (const child of children) { - const types = type in child ? - (child[type] as string).split(/\s+/) : + const types = childType in child ? + (child[childType] as string).split(/\s+/) : []; if (types.includes('overlay')) { diff --git a/modules/ags/gtk4/widget/subclasses/popover.ts b/modules/ags/gtk4/widget/subclasses/popover.ts index f334b3cb..67fc7748 100644 --- a/modules/ags/gtk4/widget/subclasses/popover.ts +++ b/modules/ags/gtk4/widget/subclasses/popover.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type PopoverProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/revealer.ts b/modules/ags/gtk4/widget/subclasses/revealer.ts index 9608355e..b1f5a54d 100644 --- a/modules/ags/gtk4/widget/subclasses/revealer.ts +++ b/modules/ags/gtk4/widget/subclasses/revealer.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type RevealerProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/slider.ts b/modules/ags/gtk4/widget/subclasses/slider.ts index 8f53ed5a..e99bb084 100644 --- a/modules/ags/gtk4/widget/subclasses/slider.ts +++ b/modules/ags/gtk4/widget/subclasses/slider.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Astal, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; type SliderSignals = Record<`on${string}`, unknown[]> & { diff --git a/modules/ags/gtk4/widget/subclasses/stack.ts b/modules/ags/gtk4/widget/subclasses/stack.ts index b1bf835f..9638f7f8 100644 --- a/modules/ags/gtk4/widget/subclasses/stack.ts +++ b/modules/ags/gtk4/widget/subclasses/stack.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type StackProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/switch.ts b/modules/ags/gtk4/widget/subclasses/switch.ts index 383c1bb1..a9b96707 100644 --- a/modules/ags/gtk4/widget/subclasses/switch.ts +++ b/modules/ags/gtk4/widget/subclasses/switch.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Gtk, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type SwitchProps = ConstructProps< diff --git a/modules/ags/gtk4/widget/subclasses/window.ts b/modules/ags/gtk4/widget/subclasses/window.ts index 9febebfb..4df0da6d 100644 --- a/modules/ags/gtk4/widget/subclasses/window.ts +++ b/modules/ags/gtk4/widget/subclasses/window.ts @@ -1,7 +1,7 @@ import { register } from 'astal'; import { Astal, type ConstructProps } from 'astal/gtk4'; -import astalify, { type AstalifyProps } from './astalify'; +import astalify, { type AstalifyProps } from '../astalify'; export type WindowProps = ConstructProps<