diff --git a/src/ags.src.gresource.xml b/src/ags.src.gresource.xml index a119523..15c97d6 100644 --- a/src/ags.src.gresource.xml +++ b/src/ags.src.gresource.xml @@ -8,6 +8,11 @@ widgets.js window.js + widgets/shared.js + widgets/box.js + widgets/eventbox.js + widgets/centerbox.js + service/service.js service/apps.js service/audio.js diff --git a/src/utils.ts b/src/utils.ts index ee53339..45e3a6b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -163,6 +163,9 @@ export function timeout(ms: number, callback: () => void) { } export function runCmd(cmd: string | ((...args: any[]) => void), ...args: any[]) { + if (typeof cmd !== 'string' && typeof cmd !== 'function') + return warning('Command has to be string or function'); + if (!cmd) return; diff --git a/src/widget.ts b/src/widget.ts index ba3cf9b..ee2a3a5 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -1,6 +1,9 @@ import Gtk from 'gi://Gtk?version=3.0'; import { typecheck, error, warning, interval } from './utils.js'; import * as Widgets from './widgets.js'; +import Box from './widgets/box.js'; +import EventBox from './widgets/eventbox.js'; +import CenterBox from './widgets/centerbox.js'; interface ServiceAPI { instance: { @@ -190,3 +193,6 @@ export default function Widget(params: Widget | string | (() => Gtk.Widget) | Gt } Widget.widgets = widgets; +Widget.Box = Box; +Widget.EventBox = EventBox; +Widget.CenterBox = CenterBox; diff --git a/tsconfig.json b/tsconfig.json index 63d7df7..d12215a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,33 @@ { - "compilerOptions": { - "target": "es2022", - "module": "ES2020", - "lib": [ "ES2017" ], - "allowJs": true, - "checkJs": false, - "outDir": "_build/tsc-out", - "strict": true, - "moduleResolution": "node", - "baseUrl": ".", - "paths": { - "*": [ - "*", - "types/*", - "gi-types/*" - ] + "compilerOptions": { + "target": "es2022", + "module": "ES2020", + "lib": [ + "ES2017" + ], + "allowJs": true, + "checkJs": false, + "outDir": "_build/tsc-out", + "strict": true, + "moduleResolution": "node", + "baseUrl": ".", + "paths": { + "*": [ + "*", + "types/*", + "gi-types/*" + ] + }, + "typeRoots": [ + "gi-types" + ], + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, - "typeRoots": [ - "gi-types" - ], - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": [ - "gi-types/gi.d.ts", - "types/*", - "src/*" - ] + "include": [ + "gi-types/gi.d.ts", + "types/*", + "src/*", + "src/*/*" + ] }