-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.js
44 lines (25 loc) · 869 Bytes
/
ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/****************************************************************************
* ui.js
* openacousticdevices.info
* August 2021
*****************************************************************************/
'use strict';
/* global document */
const {ipcRenderer} = require('electron');
const { Menu } = require('@electron/remote');
const nightMode = require('./nightMode.js');
/* UI components */
const applicationMenu = Menu.getApplicationMenu();
/* Switch between display modes */
function setNightMode (nm) {
nightMode.setNightMode(nm);
}
exports.setNightMode = setNightMode;
function toggleNightMode () {
nightMode.toggle();
}
exports.toggleNightMode = toggleNightMode;
exports.isNightMode = nightMode.isEnabled;
ipcRenderer.on('poll-night-mode', function () {
ipcRenderer.send('night-mode-poll-reply', nightMode.isEnabled());
});