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
@@ -39,7 +39,9 @@ export function createApplicationMenu() {
label: `About ${app.getName()}`,
click: async () => {
await showMainWindow();
applicationMenuSubjects.openInSettingModal$.next('about');
applicationMenuSubjects.openInSettingModal$.next({
activeTab: 'about',
});
},
},
{ type: 'separator' },
@@ -18,7 +18,9 @@ export const applicationMenuEvents = {
};
},
// todo: properly define the active tab type
openInSettingModal: (fn: (activeTab: string) => void) => {
openInSettingModal: (
fn: (props: { activeTab: string; scrollAnchor?: string }) => void
) => {
const sub = applicationMenuSubjects.openInSettingModal$.subscribe(fn);
return () => {
sub.unsubscribe();
@@ -3,5 +3,8 @@ import { Subject } from 'rxjs';
export const applicationMenuSubjects = {
newPageAction$: new Subject<'page' | 'edgeless'>(),
openJournal$: new Subject<void>(),
openInSettingModal$: new Subject<string>(),
openInSettingModal$: new Subject<{
activeTab: string;
scrollAnchor?: string;
}>(),
};