Add "system" theme setting for MacOS
This commit is contained in:
parent
089a232a60
commit
fd36720079
13 changed files with 174 additions and 35 deletions
|
@ -9,7 +9,23 @@ $(document).on('keyup', e => {
|
|||
});
|
||||
|
||||
const $body = $(document.body);
|
||||
$body.addClass(`${window.theme}-theme`);
|
||||
|
||||
async function applyTheme() {
|
||||
'use strict';
|
||||
|
||||
const theme = await window.getThemeSetting();
|
||||
$body.removeClass('light-theme');
|
||||
$body.removeClass('dark-theme');
|
||||
$body.addClass(`${theme === 'system' ? window.systemTheme : theme}-theme`);
|
||||
}
|
||||
|
||||
applyTheme();
|
||||
|
||||
window.subscribeToSystemThemeChange(() => {
|
||||
'use strict';
|
||||
|
||||
applyTheme();
|
||||
});
|
||||
|
||||
window.view = new Whisper.ConfirmationDialogView({
|
||||
message: i18n('audioPermissionNeeded'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue