Make sure windows with titlebar have OS class

This commit is contained in:
Fedor Indutny 2022-06-09 09:21:17 -07:00 committed by GitHub
parent 5634601554
commit 9975758fde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 3 deletions

View file

@ -29,6 +29,7 @@
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="ts/set_os_class.js"></script>
<script type="application/javascript" src="ts/windows/init.js"></script>
</body>
</html>

View file

@ -33,6 +33,7 @@
type="application/javascript"
src="ts/windows/applyTheme.js"
></script>
<script type="text/javascript" src="ts/set_os_class.js"></script>
<script type="application/javascript" src="ts/windows/init.js"></script>
</body>
</html>

View file

@ -33,6 +33,7 @@
type="application/javascript"
src="ts/windows/applyTheme.js"
></script>
<script type="text/javascript" src="ts/set_os_class.js"></script>
<script type="application/javascript" src="ts/windows/init.js"></script>
</body>
</html>

View file

@ -3,11 +3,11 @@
{
let className: string;
if (window.Signal.OS.isWindows()) {
if (window.SignalContext.OS.isWindows()) {
className = 'os-windows';
} else if (window.Signal.OS.isMacOS()) {
} else if (window.SignalContext.OS.isMacOS()) {
className = 'os-macos';
} else if (window.Signal.OS.isLinux()) {
} else if (window.SignalContext.OS.isLinux()) {
className = 'os-linux';
} else {
throw new Error('Unexpected operating system; not applying ');

View file

@ -27,6 +27,7 @@ import { createSetting } from '../util/preload';
import { initialize as initializeLogging } from '../logging/set_up_renderer_logging';
import { waitForSettingsChange } from './waitForSettingsChange';
import { createNativeThemeListener } from '../context/createNativeThemeListener';
import { isWindows, isLinux, isMacOS } from '../OS';
const config = url.parse(window.location.toString(), true).query;
const { locale } = config;
@ -56,6 +57,11 @@ export type SignalContextType = {
themeSetting: SettingType<IPCEventsValuesType['themeSetting']>;
waitForChange: () => Promise<void>;
};
OS: {
isWindows: typeof isWindows;
isLinux: typeof isLinux;
isMacOS: typeof isMacOS;
};
config: ParsedUrlQuery;
getAppInstance: () => string | undefined;
getEnvironment: () => string;
@ -77,6 +83,11 @@ export const SignalContext: SignalContextType = {
themeSetting: createSetting('themeSetting', { setter: false }),
waitForChange: waitForSettingsChange,
},
OS: {
isWindows,
isLinux,
isMacOS,
},
bytes: new Bytes(),
config,
crypto: new Crypto(),