mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(electron): add isMaximized flag to html (#6199)
to make some special ui rules for desktop
This commit is contained in:
@@ -96,6 +96,10 @@ async function createWindow(additionalArguments: string[]) {
|
||||
);
|
||||
|
||||
logger.info('main window is ready to show');
|
||||
|
||||
if (browserWindow.isMaximized() || browserWindow.isFullScreen()) {
|
||||
uiSubjects.onMaximized.next(true);
|
||||
}
|
||||
});
|
||||
|
||||
browserWindow.on('close', e => {
|
||||
|
||||
@@ -12,6 +12,10 @@ import { getChallengeResponse } from './challenge';
|
||||
import { getGoogleOauthCode } from './google-auth';
|
||||
|
||||
export const uiHandlers = {
|
||||
isMaximized: async () => {
|
||||
const window = await getMainWindow();
|
||||
return window?.isMaximized();
|
||||
},
|
||||
handleThemeChange: async (_, theme: (typeof nativeTheme)['themeSource']) => {
|
||||
nativeTheme.themeSource = theme;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user