@adecore/shell 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/theme.js +2 -2
- package/dist/window-state.js +0 -1
- package/dist/windows.js +4 -3
- package/package.json +1 -1
- package/src/theme.ts +2 -2
- package/src/window-state.ts +0 -1
- package/src/windows.ts +5 -3
package/dist/theme.js
CHANGED
|
@@ -12,12 +12,12 @@ export const createTheme = (options) => {
|
|
|
12
12
|
apply: (theme) => {
|
|
13
13
|
current = theme;
|
|
14
14
|
options.nativeTheme.themeSource = theme.followsSystem ? 'system' : theme.resolved;
|
|
15
|
+
const overlay = platform === 'darwin' ? undefined : overlayOf(theme.resolved);
|
|
15
16
|
for (const window of options.windows()) {
|
|
16
17
|
if (window.isDestroyed()) {
|
|
17
18
|
continue;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
if (platform !== 'darwin' && overlay) {
|
|
20
|
+
if (overlay) {
|
|
21
21
|
window.setTitleBarOverlay(overlay);
|
|
22
22
|
}
|
|
23
23
|
window.setBackgroundColor(theme.background);
|
package/dist/window-state.js
CHANGED
package/dist/windows.js
CHANGED
|
@@ -57,6 +57,7 @@ export const createWindows = (options) => {
|
|
|
57
57
|
return null;
|
|
58
58
|
};
|
|
59
59
|
const holderOf = (key) => alive().find((entry) => entry.key === key) ?? null;
|
|
60
|
+
const pageWindow = (contents) => alive().find((entry) => entry.window.webContents === contents)?.window ?? null;
|
|
60
61
|
const raise = (window) => {
|
|
61
62
|
if (window.isMinimized()) {
|
|
62
63
|
window.restore();
|
|
@@ -66,10 +67,10 @@ export const createWindows = (options) => {
|
|
|
66
67
|
};
|
|
67
68
|
const boundsFor = (key) => {
|
|
68
69
|
const stateKey = key ?? UNKEYED_STATE;
|
|
69
|
-
const front = focused();
|
|
70
70
|
if (options.state.has(stateKey)) {
|
|
71
71
|
return options.state.bounds(stateKey);
|
|
72
72
|
}
|
|
73
|
+
const front = focused();
|
|
73
74
|
if (!front) {
|
|
74
75
|
return options.state.bounds(options.formerKey !== undefined && options.state.has(options.formerKey) ? options.formerKey : stateKey);
|
|
75
76
|
}
|
|
@@ -159,7 +160,7 @@ export const createWindows = (options) => {
|
|
|
159
160
|
* The window whose own page this is, and null for anything else, a `<webview>` inside it included.
|
|
160
161
|
* This is the check for an IPC message that may speak for the app.
|
|
161
162
|
*/
|
|
162
|
-
fromPage:
|
|
163
|
+
fromPage: pageWindow,
|
|
163
164
|
/*
|
|
164
165
|
* Moves what a window shows into a new window, which comes to the front, and leaves the old one
|
|
165
166
|
* without a key. The key is never without a window in between. Null for a window that shows nothing.
|
|
@@ -179,7 +180,7 @@ export const createWindows = (options) => {
|
|
|
179
180
|
if (guestOwner !== undefined) {
|
|
180
181
|
return entries.get(guestOwner)?.window ?? null;
|
|
181
182
|
}
|
|
182
|
-
return
|
|
183
|
+
return pageWindow(contents);
|
|
183
184
|
},
|
|
184
185
|
/* The window last in front, for what has no sender: a second instance, a notification, a menu command. */
|
|
185
186
|
focused,
|
package/package.json
CHANGED
package/src/theme.ts
CHANGED
|
@@ -36,12 +36,12 @@ export const createTheme = (options: ThemeOptions) => {
|
|
|
36
36
|
apply: (theme: ThemeState): void => {
|
|
37
37
|
current = theme;
|
|
38
38
|
options.nativeTheme.themeSource = theme.followsSystem ? 'system' : theme.resolved;
|
|
39
|
+
const overlay = platform === 'darwin' ? undefined : overlayOf(theme.resolved);
|
|
39
40
|
for (const window of options.windows()) {
|
|
40
41
|
if (window.isDestroyed()) {
|
|
41
42
|
continue;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
if (platform !== 'darwin' && overlay) {
|
|
44
|
+
if (overlay) {
|
|
45
45
|
window.setTitleBarOverlay(overlay);
|
|
46
46
|
}
|
|
47
47
|
window.setBackgroundColor(theme.background);
|
package/src/window-state.ts
CHANGED
|
@@ -199,7 +199,6 @@ export const createWindowState = (options: WindowStateOptions) => {
|
|
|
199
199
|
});
|
|
200
200
|
},
|
|
201
201
|
|
|
202
|
-
/* Whether a key has bounds saved. */
|
|
203
202
|
has: (key: string): boolean => windows.has(key),
|
|
204
203
|
|
|
205
204
|
/* Writes what is pending at once, for the moment the app quits. */
|
package/src/windows.ts
CHANGED
|
@@ -90,6 +90,8 @@ export const createWindows = (options: WindowsOptions) => {
|
|
|
90
90
|
|
|
91
91
|
const holderOf = (key: string): Entry | null => alive().find((entry) => entry.key === key) ?? null;
|
|
92
92
|
|
|
93
|
+
const pageWindow = (contents: WebContents): BrowserWindow | null => alive().find((entry) => entry.window.webContents === contents)?.window ?? null;
|
|
94
|
+
|
|
93
95
|
const raise = (window: BrowserWindow): void => {
|
|
94
96
|
if (window.isMinimized()) {
|
|
95
97
|
window.restore();
|
|
@@ -100,10 +102,10 @@ export const createWindows = (options: WindowsOptions) => {
|
|
|
100
102
|
|
|
101
103
|
const boundsFor = (key: string | null): Partial<Rectangle> & WindowSize => {
|
|
102
104
|
const stateKey = key ?? UNKEYED_STATE;
|
|
103
|
-
const front = focused();
|
|
104
105
|
if (options.state.has(stateKey)) {
|
|
105
106
|
return options.state.bounds(stateKey);
|
|
106
107
|
}
|
|
108
|
+
const front = focused();
|
|
107
109
|
if (!front) {
|
|
108
110
|
return options.state.bounds(options.formerKey !== undefined && options.state.has(options.formerKey) ? options.formerKey : stateKey);
|
|
109
111
|
}
|
|
@@ -200,7 +202,7 @@ export const createWindows = (options: WindowsOptions) => {
|
|
|
200
202
|
* The window whose own page this is, and null for anything else, a `<webview>` inside it included.
|
|
201
203
|
* This is the check for an IPC message that may speak for the app.
|
|
202
204
|
*/
|
|
203
|
-
fromPage:
|
|
205
|
+
fromPage: pageWindow,
|
|
204
206
|
|
|
205
207
|
/*
|
|
206
208
|
* Moves what a window shows into a new window, which comes to the front, and leaves the old one
|
|
@@ -222,7 +224,7 @@ export const createWindows = (options: WindowsOptions) => {
|
|
|
222
224
|
if (guestOwner !== undefined) {
|
|
223
225
|
return entries.get(guestOwner)?.window ?? null;
|
|
224
226
|
}
|
|
225
|
-
return
|
|
227
|
+
return pageWindow(contents);
|
|
226
228
|
},
|
|
227
229
|
|
|
228
230
|
/* The window last in front, for what has no sender: a second instance, a notification, a menu command. */
|