mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
Rename the "overlay indicator" feature to "task widget" across the entire codebase for clearer naming. Includes file renames, config key migration, IPC event rename, and translation key updates. Migration handles old persisted data from both the `overlayIndicator` config key and the deprecated `misc.isOverlayIndicatorEnabled` field. The `taskWidget` type is made optional in GlobalConfigState to prevent Typia auto-fix from overwriting migrated values during upgrade.
26 lines
835 B
TypeScript
26 lines
835 B
TypeScript
import { contextBridge, ipcRenderer } from 'electron';
|
|
|
|
contextBridge.exposeInMainWorld('taskWidgetAPI', {
|
|
showMainWindow: () => {
|
|
ipcRenderer.send('task-widget-show-main-window');
|
|
},
|
|
onUpdateContent: (callback: (data: any) => void) => {
|
|
const listener = (event: Electron.IpcRendererEvent, data: any): void =>
|
|
callback(data);
|
|
ipcRenderer.on('update-content', listener);
|
|
|
|
// Return cleanup function
|
|
return () => {
|
|
ipcRenderer.removeListener('update-content', listener);
|
|
};
|
|
},
|
|
onUpdateOpacity: (callback: (opacity: number) => void) => {
|
|
const listener = (_event: Electron.IpcRendererEvent, opacity: number): void =>
|
|
callback(opacity);
|
|
ipcRenderer.on('update-opacity', listener);
|
|
|
|
return () => {
|
|
ipcRenderer.removeListener('update-opacity', listener);
|
|
};
|
|
},
|
|
});
|