From 06dbd4beeae916d821b460f6fb53ee69ac890d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cs=C3=A1nyi=20Istv=C3=A1n?= Date: Thu, 2 Jul 2026 23:55:12 +0200 Subject: [PATCH 1/2] Update BaseIcon types --- packages/gnome-shell/src/ui/iconGrid.d.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/gnome-shell/src/ui/iconGrid.d.ts b/packages/gnome-shell/src/ui/iconGrid.d.ts index 5872a7e..9bd0d6c 100644 --- a/packages/gnome-shell/src/ui/iconGrid.d.ts +++ b/packages/gnome-shell/src/ui/iconGrid.d.ts @@ -6,23 +6,38 @@ import type Shell from '@girs/shell-18'; export namespace BaseIcon { export interface ConstructorProps { - createIcon: any | null; + createIcon: (size: number) => St.Icon | null; setSizeManually: boolean; showLabel: boolean; } } export class BaseIcon extends Shell.SquareBin { - createIcon: any | null; + iconSize: number; icon: St.Icon | null; label: St.Label | null; - _setSizeManually?: boolean; + _box: St.BoxLayout; + _iconBin: St.Bin; + _setSizeManually: boolean; constructor(label: string, params?: Partial); _init(params?: Partial): void; _init(label: string, params?: Partial): void; + + /** + * This can be overridden by a subclass, or by the createIcon + * parameter to _init() + */ + createIcon(size: number): St.Icon; + setIconSize(size: number): void; + animateZoomOut(): void; + animateZoomOutAtPos(): void; + update(): void; + + _createIconTexture(size: number): void; + _onIconThemeChanged(): void; } export namespace IconGrid { From 50e4c75a94c6fc904c2133e330d31620a3006d09 Mon Sep 17 00:00:00 2001 From: Pascal Garber Date: Fri, 3 Jul 2026 21:53:07 +0200 Subject: [PATCH 2/2] fix: correct BaseIcon method/prop signatures - animateZoomOutAtPos(x, y): upstream takes coordinates (js/ui/iconGrid.js); the declaration had no parameters, so callers passing (x, y) would fail to type-check. - createIcon ConstructorProp: parenthesize to `((size) => St.Icon) | null` so the property is nullable (matching the `createIcon: null` default) rather than a function returning `St.Icon | null`. --- packages/gnome-shell/src/ui/iconGrid.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gnome-shell/src/ui/iconGrid.d.ts b/packages/gnome-shell/src/ui/iconGrid.d.ts index 9bd0d6c..8367f40 100644 --- a/packages/gnome-shell/src/ui/iconGrid.d.ts +++ b/packages/gnome-shell/src/ui/iconGrid.d.ts @@ -6,7 +6,7 @@ import type Shell from '@girs/shell-18'; export namespace BaseIcon { export interface ConstructorProps { - createIcon: (size: number) => St.Icon | null; + createIcon: ((size: number) => St.Icon) | null; setSizeManually: boolean; showLabel: boolean; } @@ -33,7 +33,7 @@ export class BaseIcon extends Shell.SquareBin { createIcon(size: number): St.Icon; setIconSize(size: number): void; animateZoomOut(): void; - animateZoomOutAtPos(): void; + animateZoomOutAtPos(x: number, y: number): void; update(): void; _createIconTexture(size: number): void;