feat(electron): add tray menu settings (#11437)

fix AF-2447
This commit is contained in:
pengx17
2025-04-03 15:56:52 +00:00
parent 0aeb3041b5
commit 8ce10e6d0a
19 changed files with 330 additions and 150 deletions

View File

@@ -25,14 +25,18 @@ export function setupEvents(frameworkProvider: FrameworkProvider) {
.catch(console.error);
});
events?.applicationMenu.openInSettingModal(activeTab => {
events?.applicationMenu.openInSettingModal(({ activeTab, scrollAnchor }) => {
using currentWorkspace = getCurrentWorkspace(frameworkProvider);
if (!currentWorkspace) {
return;
}
const { workspace } = currentWorkspace;
workspace.scope.get(WorkspaceDialogService).open('setting', {
const workspaceDialogService = workspace.scope.get(WorkspaceDialogService);
// close all other dialogs first
workspaceDialogService.closeAll();
workspaceDialogService.open('setting', {
activeTab: activeTab as unknown as SettingTab,
scrollAnchor,
});
});

View File

@@ -6,7 +6,10 @@ import {
configureDesktopApiModule,
DesktopApiService,
} from '@affine/core/modules/desktop-api';
import { configureSpellCheckSettingModule } from '@affine/core/modules/editor-setting';
import {
configureSpellCheckSettingModule,
configureTraySettingModule,
} from '@affine/core/modules/editor-setting';
import { configureFindInPageModule } from '@affine/core/modules/find-in-page';
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
import {
@@ -27,6 +30,7 @@ export function setupModules() {
configureFindInPageModule(framework);
configureDesktopApiModule(framework);
configureSpellCheckSettingModule(framework);
configureTraySettingModule(framework);
configureDesktopBackupModule(framework);
framework.impl(PopupWindowProvider, p => {