custom-electron-titlebar 4.2.4 → 4.2.6
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/README.md +8 -5
- package/base/browser/touch.js +2 -2
- package/base/common/color.js +2 -3
- package/base/common/event.js +2 -2
- package/base/common/iterator.js +1 -1
- package/base/common/keyCodes.js +1 -1
- package/base/common/lifecycle.js +1 -1
- package/base/common/platform.d.ts +7 -4
- package/base/common/platform.js +16 -4
- package/consts.d.ts +8 -0
- package/consts.js +8 -0
- package/menubar/index.js +3 -3
- package/menubar/menu/index.js +15 -1
- package/menubar/menubar-options.d.ts +0 -8
- package/package.json +22 -17
- package/titlebar/index.d.ts +5 -0
- package/titlebar/index.js +32 -17
- package/titlebar/themebar.js +1 -1
package/README.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This project is a typescript library for electron that allows you to configure a fully customizable title bar.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/AlexTorresDev/custom-electron-titlebar/actions/workflows/build-release.yml)
|
|
6
|
+
[](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE)
|
|
7
|
+
[](https://npmjs.org/package/custom-electron-titlebar)
|
|
8
|
+
[](https://packagephobia.com/result?p=custom-electron-titlebar)
|
|
8
9
|
|
|
9
10
|
[📄 Visit Documentation](https://cet.alextrs.dev)
|
|
10
11
|
|
|
@@ -72,12 +73,14 @@ window.addEventListener('DOMContentLoaded', () => {
|
|
|
72
73
|
To see the options you can include in the Title Bar constructor, such as color of elements, icons, menu position, and much more, and the methods you can use, go to the [wiki](https://github.com/AlexTorresDev/custom-electron-titlebar/wiki)
|
|
73
74
|
|
|
74
75
|
## 💰 Support
|
|
75
|
-
If you want to support my development, you can do so by donating through [
|
|
76
|
+
If you want to support my development, you can do so by donating through [💖 Sponsor](https://github.com/sponsors/AlexTorresDev)
|
|
76
77
|
|
|
77
78
|
|
|
78
|
-
## 📝
|
|
79
|
+
## 📝 Contributors
|
|
79
80
|
I would like to express my sincere gratitude to all the people who have collaborated in the development and advancement of this project. I appreciate your contributions.
|
|
80
81
|
|
|
82
|
+
[](https://github.com/AlexTorresDev/custom-electron-titlebar/graphs/contributors)
|
|
83
|
+
|
|
81
84
|
|
|
82
85
|
## ✅ License
|
|
83
86
|
This project is under the [MIT](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE) license.
|
package/base/browser/touch.js
CHANGED
|
@@ -50,7 +50,7 @@ var EventType;
|
|
|
50
50
|
EventType.Start = '-monaco-gesturestart';
|
|
51
51
|
EventType.End = '-monaco-gesturesend';
|
|
52
52
|
EventType.Contextmenu = '-monaco-gesturecontextmenu';
|
|
53
|
-
})(
|
|
53
|
+
})(_get__("EventType") || (exports.EventType = _assign__("EventType", {})));
|
|
54
54
|
class Gesture extends _get__("lifecycle_1").Disposable {
|
|
55
55
|
constructor() {
|
|
56
56
|
super();
|
|
@@ -250,10 +250,10 @@ class Gesture extends _get__("lifecycle_1").Disposable {
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
+
exports.Gesture = _get__("Gesture");
|
|
253
254
|
_get__("Gesture").SCROLL_FRICTION = -0.005;
|
|
254
255
|
_get__("Gesture").HOLD_DELAY = 700;
|
|
255
256
|
_get__("Gesture").CLEAR_TAP_COUNT_TIME = 400; // ms
|
|
256
|
-
exports.Gesture = _get__("Gesture");
|
|
257
257
|
function _getGlobalObject() {
|
|
258
258
|
try {
|
|
259
259
|
if (!!global) {
|
package/base/common/color.js
CHANGED
|
@@ -340,6 +340,7 @@ class Color {
|
|
|
340
340
|
return of.darken(factor);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
+
exports.Color = _get__("Color");
|
|
343
344
|
_get__("Color").WHITE = new (_get__("Color"))(new (_get__("RGBA"))(255, 255, 255, 1));
|
|
344
345
|
_get__("Color").BLACK = new (_get__("Color"))(new (_get__("RGBA"))(0, 0, 0, 1));
|
|
345
346
|
_get__("Color").RED = new (_get__("Color"))(new (_get__("RGBA"))(255, 0, 0, 1));
|
|
@@ -348,7 +349,6 @@ _get__("Color").GREEN = new (_get__("Color"))(new (_get__("RGBA"))(0, 255, 0, 1)
|
|
|
348
349
|
_get__("Color").CYAN = new (_get__("Color"))(new (_get__("RGBA"))(0, 255, 255, 1));
|
|
349
350
|
_get__("Color").LIGHTGREY = new (_get__("Color"))(new (_get__("RGBA"))(211, 211, 211, 1));
|
|
350
351
|
_get__("Color").TRANSPARENT = new (_get__("Color"))(new (_get__("RGBA"))(0, 0, 0, 0));
|
|
351
|
-
exports.Color = _get__("Color");
|
|
352
352
|
(function (Color) {
|
|
353
353
|
let Format;
|
|
354
354
|
(function (Format) {
|
|
@@ -515,8 +515,7 @@ exports.Color = _get__("Color");
|
|
|
515
515
|
}
|
|
516
516
|
})(CSS = Format.CSS || (Format.CSS = {}));
|
|
517
517
|
})(Format = Color.Format || (Color.Format = {}));
|
|
518
|
-
})(
|
|
519
|
-
exports.Color = _get__("Color");
|
|
518
|
+
})(_get__("Color") || (exports.Color = _assign__("Color", {})));
|
|
520
519
|
function _getGlobalObject() {
|
|
521
520
|
try {
|
|
522
521
|
if (!!global) {
|
package/base/common/event.js
CHANGED
|
@@ -298,7 +298,7 @@ var Event;
|
|
|
298
298
|
return new Promise(c => once(event)(c));
|
|
299
299
|
}
|
|
300
300
|
Event.toPromise = toPromise;
|
|
301
|
-
})(
|
|
301
|
+
})(_get__("Event") || (exports.Event = _assign__("Event", {})));
|
|
302
302
|
let _globalLeakWarningThreshold = -1;
|
|
303
303
|
function setGlobalLeakWarningThreshold(n) {
|
|
304
304
|
const oldValue = _get__("_globalLeakWarningThreshold");
|
|
@@ -479,8 +479,8 @@ class Emitter {
|
|
|
479
479
|
this._disposed = true;
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
_get__("Emitter")._noop = function () {};
|
|
483
482
|
exports.Emitter = _get__("Emitter");
|
|
483
|
+
_get__("Emitter")._noop = function () {};
|
|
484
484
|
class AsyncEmitter extends _get__("Emitter") {
|
|
485
485
|
async fireAsync(eventFn) {
|
|
486
486
|
if (!this._listeners) {
|
package/base/common/iterator.js
CHANGED
|
@@ -94,7 +94,7 @@ var Iterator;
|
|
|
94
94
|
return result;
|
|
95
95
|
}
|
|
96
96
|
Iterator.collect = collect;
|
|
97
|
-
})(
|
|
97
|
+
})(_get__("Iterator") || (exports.Iterator = _assign__("Iterator", {})));
|
|
98
98
|
function getSequenceIterator(arg) {
|
|
99
99
|
if (Array.isArray(arg)) {
|
|
100
100
|
return _get__("Iterator").fromArray(arg);
|
package/base/common/keyCodes.js
CHANGED
|
@@ -176,7 +176,7 @@ var KeyCodeUtils;
|
|
|
176
176
|
return _get__("userSettingsUSMap").strToKeyCode(key) || _get__("userSettingsGeneralMap").strToKeyCode(key);
|
|
177
177
|
}
|
|
178
178
|
KeyCodeUtils.fromUserSettings = fromUserSettings;
|
|
179
|
-
})(
|
|
179
|
+
})(_get__("KeyCodeUtils") || (exports.KeyCodeUtils = _assign__("KeyCodeUtils", {})));
|
|
180
180
|
function KeyChord(firstPart, secondPart) {
|
|
181
181
|
const chordPart = (secondPart & 0x0000FFFF) << 16 >>> 0;
|
|
182
182
|
return (firstPart | chordPart) >>> 0;
|
package/base/common/lifecycle.js
CHANGED
|
@@ -65,10 +65,10 @@ class Disposable {
|
|
|
65
65
|
return t;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
exports.Disposable = _get__("Disposable");
|
|
68
69
|
_get__("Disposable").None = Object.freeze({
|
|
69
70
|
dispose() {}
|
|
70
71
|
});
|
|
71
|
-
exports.Disposable = _get__("Disposable");
|
|
72
72
|
function _getGlobalObject() {
|
|
73
73
|
try {
|
|
74
74
|
if (!!global) {
|
|
@@ -5,12 +5,14 @@ export declare const enum Platform {
|
|
|
5
5
|
Web = 0,
|
|
6
6
|
Mac = 1,
|
|
7
7
|
Linux = 2,
|
|
8
|
-
|
|
8
|
+
FreeBSD = 3,
|
|
9
|
+
Windows = 4
|
|
9
10
|
}
|
|
10
|
-
export declare function PlatformToString(platform: Platform): "Windows" | "Linux" | "Web" | "Mac";
|
|
11
|
+
export declare function PlatformToString(platform: Platform): "Windows" | "Linux" | "FreeBSD" | "Web" | "Mac";
|
|
11
12
|
export declare const isWindows: boolean;
|
|
12
13
|
export declare const isMacintosh: boolean;
|
|
13
14
|
export declare const isLinux: boolean;
|
|
15
|
+
export declare const isFreeBSD: boolean;
|
|
14
16
|
export declare const isNative: boolean;
|
|
15
17
|
export declare const isWeb: boolean;
|
|
16
18
|
export declare const platform: Platform;
|
|
@@ -20,9 +22,10 @@ export declare function setImmediate(callback: (...args: any[]) => void): number
|
|
|
20
22
|
export declare const enum OperatingSystem {
|
|
21
23
|
Windows = 1,
|
|
22
24
|
Macintosh = 2,
|
|
23
|
-
Linux = 3
|
|
25
|
+
Linux = 3,
|
|
26
|
+
FreeBSD = 4
|
|
24
27
|
}
|
|
25
|
-
export declare const OS:
|
|
28
|
+
export declare const OS: number;
|
|
26
29
|
export declare const enum AccessibilitySupport {
|
|
27
30
|
/**
|
|
28
31
|
* This should be the browser case where it is not known if a screen reader is attached or no.
|
package/base/common/platform.js
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
-
exports.OS = exports.setImmediate = exports.globals = exports.isRootUser = exports.platform = exports.isWeb = exports.isNative = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.PlatformToString = void 0;
|
|
11
|
+
exports.OS = exports.setImmediate = exports.globals = exports.isRootUser = exports.platform = exports.isWeb = exports.isNative = exports.isFreeBSD = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.PlatformToString = void 0;
|
|
12
12
|
let _isWindows = false;
|
|
13
13
|
let _isMacintosh = false;
|
|
14
14
|
let _isLinux = false;
|
|
15
|
+
let _isFreeBSD = false;
|
|
15
16
|
let _isNative = false;
|
|
16
17
|
let _isWeb = false;
|
|
17
18
|
const isElectronRenderer = typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer';
|
|
@@ -21,11 +22,13 @@ if (typeof navigator === 'object' && !_get__("isElectronRenderer")) {
|
|
|
21
22
|
_assign__("_isWindows", userAgent.indexOf('Windows') >= 0);
|
|
22
23
|
_assign__("_isMacintosh", userAgent.indexOf('Macintosh') >= 0);
|
|
23
24
|
_assign__("_isLinux", userAgent.indexOf('Linux') >= 0);
|
|
25
|
+
_assign__("_isFreeBSD", userAgent.indexOf('FreeBSD') >= 0);
|
|
24
26
|
_assign__("_isWeb", true);
|
|
25
27
|
} else if (typeof process === 'object') {
|
|
26
28
|
_assign__("_isWindows", process.platform === 'win32');
|
|
27
29
|
_assign__("_isMacintosh", process.platform === 'darwin');
|
|
28
30
|
_assign__("_isLinux", process.platform === 'linux');
|
|
31
|
+
_assign__("_isFreeBSD", process.platform === 'freebsd');
|
|
29
32
|
_assign__("_isNative", true);
|
|
30
33
|
}
|
|
31
34
|
function PlatformToString(platform) {
|
|
@@ -36,7 +39,9 @@ function PlatformToString(platform) {
|
|
|
36
39
|
return 'Mac';
|
|
37
40
|
case 2 /* Platform.Linux */:
|
|
38
41
|
return 'Linux';
|
|
39
|
-
case 3 /* Platform.
|
|
42
|
+
case 3 /* Platform.FreeBSD */:
|
|
43
|
+
return 'FreeBSD';
|
|
44
|
+
case 4 /* Platform.Windows */:
|
|
40
45
|
return 'Windows';
|
|
41
46
|
}
|
|
42
47
|
}
|
|
@@ -46,14 +51,17 @@ if (_get__("_isNative")) {
|
|
|
46
51
|
if (_get__("_isMacintosh")) {
|
|
47
52
|
_assign__("_platform", 1) /* Platform.Mac */;
|
|
48
53
|
} else if (_get__("_isWindows")) {
|
|
49
|
-
_assign__("_platform",
|
|
54
|
+
_assign__("_platform", 4) /* Platform.Windows */;
|
|
50
55
|
} else if (_get__("_isLinux")) {
|
|
51
56
|
_assign__("_platform", 2) /* Platform.Linux */;
|
|
57
|
+
} else if (_get__("_isFreeBSD")) {
|
|
58
|
+
_assign__("_platform", 3) /* Platform.FreeBSD */;
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
exports.isWindows = _get__("_isWindows");
|
|
55
62
|
exports.isMacintosh = _get__("_isMacintosh");
|
|
56
63
|
exports.isLinux = _get__("_isLinux");
|
|
64
|
+
exports.isFreeBSD = _get__("_isFreeBSD");
|
|
57
65
|
exports.isNative = _get__("_isNative");
|
|
58
66
|
exports.isWeb = _get__("_isWeb");
|
|
59
67
|
exports.platform = _get__("_platform");
|
|
@@ -78,7 +86,7 @@ function setImmediate(callback) {
|
|
|
78
86
|
return _get__("_setImmediate")(callback);
|
|
79
87
|
}
|
|
80
88
|
exports.setImmediate = _get__("setImmediate");
|
|
81
|
-
const _wl = _get__("_isWindows") ? 1 /* OperatingSystem.Windows */ : 3 /* OperatingSystem.Linux */;
|
|
89
|
+
const _wl = _get__("_isWindows") ? 1 /* OperatingSystem.Windows */ : 3 /* OperatingSystem.Linux */ | 4 /* OperatingSystem.FreeBSD */;
|
|
82
90
|
exports.OS = _get__("_isMacintosh") ? 2 /* OperatingSystem.Macintosh */ : _get__("_wl");
|
|
83
91
|
function _getGlobalObject() {
|
|
84
92
|
try {
|
|
@@ -173,6 +181,8 @@ function _get_original__(variableName) {
|
|
|
173
181
|
return _isMacintosh;
|
|
174
182
|
case "_isLinux":
|
|
175
183
|
return _isLinux;
|
|
184
|
+
case "_isFreeBSD":
|
|
185
|
+
return _isFreeBSD;
|
|
176
186
|
case "_isWeb":
|
|
177
187
|
return _isWeb;
|
|
178
188
|
case "_isNative":
|
|
@@ -212,6 +222,8 @@ function _set_original__(variableName, _value) {
|
|
|
212
222
|
return _isMacintosh = _value;
|
|
213
223
|
case "_isLinux":
|
|
214
224
|
return _isLinux = _value;
|
|
225
|
+
case "_isFreeBSD":
|
|
226
|
+
return _isFreeBSD = _value;
|
|
215
227
|
case "_isWeb":
|
|
216
228
|
return _isWeb = _value;
|
|
217
229
|
case "_isNative":
|
package/consts.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ interface ITitlebarIcons extends IMenuIcons {
|
|
|
20
20
|
restore: string;
|
|
21
21
|
close: string;
|
|
22
22
|
};
|
|
23
|
+
freebsd: {
|
|
24
|
+
minimize: string;
|
|
25
|
+
maximize: string;
|
|
26
|
+
restore: string;
|
|
27
|
+
close: string;
|
|
28
|
+
};
|
|
23
29
|
windows: {
|
|
24
30
|
minimize: string;
|
|
25
31
|
maximize: string;
|
|
@@ -32,6 +38,7 @@ export declare const menuIcons: ITitlebarIcons;
|
|
|
32
38
|
* Handles mnemonics for menu items. Depending on OS:
|
|
33
39
|
* - Windows: Supported via & character (replace && with &)
|
|
34
40
|
* - Linux: Supported via & character (replace && with &)
|
|
41
|
+
* - FreeBSD: Supported via & character (replace && with &)
|
|
35
42
|
* - macOS: Unsupported (replace && with empty string)
|
|
36
43
|
*/
|
|
37
44
|
export declare function mnemonicMenuLabel(label: string, forceDisableMnemonics?: boolean): string;
|
|
@@ -39,6 +46,7 @@ export declare function mnemonicMenuLabel(label: string, forceDisableMnemonics?:
|
|
|
39
46
|
* Handles mnemonics for buttons. Depending on OS:
|
|
40
47
|
* - Windows: Supported via & character (replace && with & and & with && for escaping)
|
|
41
48
|
* - Linux: Supported via _ character (replace && with _)
|
|
49
|
+
* - FreeBSD: Supported via _ character (replace && with _)
|
|
42
50
|
* - macOS: Unsupported (replace && with empty string)
|
|
43
51
|
*/
|
|
44
52
|
export declare function mnemonicButtonLabel(label: string, forceDisableMnemonics?: boolean): string;
|
package/consts.js
CHANGED
|
@@ -34,6 +34,12 @@ exports.menuIcons = {
|
|
|
34
34
|
restore: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M7.9,2.2h-7C0.4,2.2,0,2.6,0,3.1v7C0,10.6,0.4,11,0.9,11h7c0.5,0,0.9-0.4,0.9-0.9v-7C8.8,2.6,8.4,2.2,7.9,2.2z M7.7,9.6 c0,0.2-0.1,0.3-0.3,0.3h-6c-0.2,0-0.3-0.1-0.3-0.3v-6c0-0.2,0.1-0.3,0.3-0.3h6c0.2,0,0.3,0.1,0.3,0.3V9.6z M10,0.9 c0,0.5-0.4,0.9-0.9,0.9h-2.1 c-0.5,0-0.9-0.4-0.9-0.9V0.9c0-0.5,0.4-0.9,0.9-0.9h2.1C9.6,0,10,0.4,10,0.9z"/></svg>',
|
|
35
35
|
close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z"/></svg>'
|
|
36
36
|
},
|
|
37
|
+
freebsd: {
|
|
38
|
+
minimize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M11,4.9v1.1H0V4.399h11z"/></svg>',
|
|
39
|
+
maximize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M0,1.7v7.6C0,10.2,0.8,11,1.7,11h7.6c0.9,0,1.7-0.8,1.7-1.7V1.7C11,0.8,10.2,0,9.3,0H1.7C0.8,0,0,0.8,0,1.7z M8.8,9.9H2.2c-0.6,0-1.1-0.5-1.1-1.1V2.2c0-0.6,0.5-1.1,1.1-1.1h6.7c0.6,0,1.1,0.5,1.1,1.1v6.7C9.9,9.4,9.4,9.9,8.8,9.9z"/></svg>',
|
|
40
|
+
restore: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M7.9,2.2h-7C0.4,2.2,0,2.6,0,3.1v7C0,10.6,0.4,11,0.9,11h7c0.5,0,0.9-0.4,0.9-0.9v-7C8.8,2.6,8.4,2.2,7.9,2.2z M7.7,9.6 c0,0.2-0.1,0.3-0.3,0.3h-6c-0.2,0-0.3-0.1-0.3-0.3v-6c0-0.2,0.1-0.3,0.3-0.3h6c0.2,0,0.3,0.1,0.3,0.3V9.6z M10,0.9 c0,0.5-0.4,0.9-0.9,0.9h-2.1 c-0.5,0-0.9-0.4-0.9-0.9V0.9c0-0.5,0.4-0.9,0.9-0.9h2.1C9.6,0,10,0.4,10,0.9z"/></svg>',
|
|
41
|
+
close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z"/></svg>'
|
|
42
|
+
},
|
|
37
43
|
windows: {
|
|
38
44
|
minimize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M11,4.9v1.1H0V4.399h11z"/></svg>',
|
|
39
45
|
maximize: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11"><path d="M0,1.7v7.6C0,10.2,0.8,11,1.7,11h7.6c0.9,0,1.7-0.8,1.7-1.7V1.7C11,0.8,10.2,0,9.3,0H1.7C0.8,0,0,0.8,0,1.7z M8.8,9.9H2.2c-0.6,0-1.1-0.5-1.1-1.1V2.2c0-0.6,0.5-1.1,1.1-1.1h6.7c0.6,0,1.1,0.5,1.1,1.1v6.7C9.9,9.4,9.4,9.9,8.8,9.9z"/></svg>',
|
|
@@ -45,6 +51,7 @@ exports.menuIcons = {
|
|
|
45
51
|
* Handles mnemonics for menu items. Depending on OS:
|
|
46
52
|
* - Windows: Supported via & character (replace && with &)
|
|
47
53
|
* - Linux: Supported via & character (replace && with &)
|
|
54
|
+
* - FreeBSD: Supported via & character (replace && with &)
|
|
48
55
|
* - macOS: Unsupported (replace && with empty string)
|
|
49
56
|
*/
|
|
50
57
|
function mnemonicMenuLabel(label, forceDisableMnemonics) {
|
|
@@ -58,6 +65,7 @@ exports.mnemonicMenuLabel = _get__("mnemonicMenuLabel");
|
|
|
58
65
|
* Handles mnemonics for buttons. Depending on OS:
|
|
59
66
|
* - Windows: Supported via & character (replace && with & and & with && for escaping)
|
|
60
67
|
* - Linux: Supported via _ character (replace && with _)
|
|
68
|
+
* - FreeBSD: Supported via _ character (replace && with _)
|
|
61
69
|
* - macOS: Unsupported (replace && with empty string)
|
|
62
70
|
*/
|
|
63
71
|
function mnemonicButtonLabel(label, forceDisableMnemonics) {
|
package/menubar/index.js
CHANGED
|
@@ -510,9 +510,9 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
|
|
|
510
510
|
const replaceDoubleEscapes = str => str.replace(/&&/g, '&');
|
|
511
511
|
if (escMatch) {
|
|
512
512
|
titleElement.innerText = '';
|
|
513
|
-
titleElement.append(_get__("strings").ltrim(replaceDoubleEscapes(cleanLabel.
|
|
513
|
+
titleElement.append(_get__("strings").ltrim(replaceDoubleEscapes(cleanLabel.substring(0, escMatch.index)), ' '), _get__("$")('mnemonic', {
|
|
514
514
|
'aria-hidden': 'true'
|
|
515
|
-
}, escMatch[3]), _get__("strings").rtrim(replaceDoubleEscapes(cleanLabel.
|
|
515
|
+
}, escMatch[3]), _get__("strings").rtrim(replaceDoubleEscapes(cleanLabel.substring(escMatch.index + escMatch[0].length)), ' '));
|
|
516
516
|
} else {
|
|
517
517
|
titleElement.innerText = replaceDoubleEscapes(cleanLabel).trim();
|
|
518
518
|
}
|
|
@@ -899,8 +899,8 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
|
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
_get__("MenuBar").OVERFLOW_INDEX = -1;
|
|
903
902
|
exports.MenuBar = _get__("MenuBar");
|
|
903
|
+
_get__("MenuBar").OVERFLOW_INDEX = -1;
|
|
904
904
|
function _getGlobalObject() {
|
|
905
905
|
try {
|
|
906
906
|
if (!!global) {
|
package/menubar/menu/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var Direction;
|
|
|
22
22
|
(function (Direction) {
|
|
23
23
|
Direction[Direction["Right"] = 0] = "Right";
|
|
24
24
|
Direction[Direction["Left"] = 1] = "Left";
|
|
25
|
-
})(
|
|
25
|
+
})(_get__("Direction") || (exports.Direction = _assign__("Direction", {})));
|
|
26
26
|
class CETMenu extends _get__("lifecycle_1").Disposable {
|
|
27
27
|
constructor(menuContainer, menuIcons, parentOptions, currentOptions, closeSubMenu = () => {}) {
|
|
28
28
|
super();
|
|
@@ -114,6 +114,20 @@ class CETMenu extends _get__("lifecycle_1").Disposable {
|
|
|
114
114
|
}
|
|
115
115
|
}));
|
|
116
116
|
}
|
|
117
|
+
if (_get__("platform_1").isFreeBSD) {
|
|
118
|
+
this._register((0, _get__("dom_1").addDisposableListener)(this.menuContainer, _get__("dom_1").EventType.KEY_DOWN, e => {
|
|
119
|
+
const event = new (_get__("keyboardEvent_1").StandardKeyboardEvent)(e);
|
|
120
|
+
if (event.equals(14 /* KeyCode.Home */) || event.equals(11 /* KeyCode.PageUp */)) {
|
|
121
|
+
this.focusedItem = this.items.length - 1;
|
|
122
|
+
this.focusNext();
|
|
123
|
+
_get__("dom_1").EventHelper.stop(e, true);
|
|
124
|
+
} else if (event.equals(13 /* KeyCode.End */) || event.equals(12 /* KeyCode.PageDown */)) {
|
|
125
|
+
this.focusedItem = 0;
|
|
126
|
+
this.focusPrevious();
|
|
127
|
+
_get__("dom_1").EventHelper.stop(e, true);
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
117
131
|
this._register((0, _get__("dom_1").addDisposableListener)(this.menuContainer, _get__("dom_1").EventType.MOUSE_OUT, e => {
|
|
118
132
|
const relatedTarget = e.relatedTarget;
|
|
119
133
|
if (!(0, _get__("dom_1").isAncestor)(relatedTarget, this.menuContainer)) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Menu } from 'electron';
|
|
2
1
|
import { Color } from '../base/common/color';
|
|
3
2
|
export interface MenuBarOptions {
|
|
4
3
|
/**
|
|
@@ -15,13 +14,6 @@ export interface MenuBarOptions {
|
|
|
15
14
|
* **The default is undefined**
|
|
16
15
|
*/
|
|
17
16
|
itemBackgroundColor?: Color;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Use `setupTitlebar` method instead.
|
|
20
|
-
* The menu to show in the title bar.
|
|
21
|
-
* You can use `Menu` or not add this option and the menu created in the main process will be taken.
|
|
22
|
-
* **The default menu is undefined**
|
|
23
|
-
*/
|
|
24
|
-
menu?: Menu;
|
|
25
17
|
/**
|
|
26
18
|
* The background color of the menu.
|
|
27
19
|
* **The default is automatic**
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "custom-electron-titlebar",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.6",
|
|
4
4
|
"description": "Library for electron that allows you to configure a fully customizable title bar.",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
|
-
"main": "./index.
|
|
6
|
+
"main": "./index.ts",
|
|
7
7
|
"typesVersions": {
|
|
8
8
|
"*": {
|
|
9
9
|
"main": [
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"./main": "./main/index.js"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"clean": "rimraf
|
|
19
|
+
"clean": "rimraf dist",
|
|
20
20
|
"build:package": "tsc && tsc-alias",
|
|
21
|
-
"build:babel": "babel
|
|
21
|
+
"build:babel": "babel dist --out-dir dist --extensions \".js\"",
|
|
22
22
|
"start": "electron example/main.js",
|
|
23
23
|
"dev": "npm run build && npm run start",
|
|
24
24
|
"build": "npm run clean && npm run build:package && npm run build:babel",
|
|
25
|
-
"test": ""
|
|
25
|
+
"test": "jest"
|
|
26
26
|
},
|
|
27
27
|
"author": "AlexTorresDev <alextorressk@gmail.com>",
|
|
28
28
|
"license": "MIT",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"title bar",
|
|
37
37
|
"menubar",
|
|
38
38
|
"windows",
|
|
39
|
-
"linux"
|
|
39
|
+
"linux",
|
|
40
|
+
"freebsd"
|
|
40
41
|
],
|
|
41
42
|
"bugs": {
|
|
42
43
|
"url": "https://github.com/AlexTorresDev/custom-electron-titlebar/issues"
|
|
@@ -46,24 +47,28 @@
|
|
|
46
47
|
"electron": ">20.0.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@babel/cli": "7.
|
|
50
|
-
"@babel/core": "7.
|
|
51
|
-
"@
|
|
52
|
-
"@typescript-eslint/
|
|
50
|
+
"@babel/cli": "7.22.9",
|
|
51
|
+
"@babel/core": "7.22.9",
|
|
52
|
+
"@jest/globals": "29.6.1",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "6.1.0",
|
|
54
|
+
"@typescript-eslint/parser": "6.1.0",
|
|
53
55
|
"babel-plugin-import-require-as-string": "1.0.2",
|
|
54
56
|
"babel-plugin-module-resolver": "5.0.0",
|
|
55
57
|
"babel-plugin-rewire": "1.2.0",
|
|
56
|
-
"electron": "
|
|
57
|
-
"eslint": "8.
|
|
58
|
+
"electron": "25.3.1",
|
|
59
|
+
"eslint": "8.45.0",
|
|
58
60
|
"eslint-config-prettier": "8.8.0",
|
|
59
|
-
"eslint-config-standard": "17.
|
|
61
|
+
"eslint-config-standard": "17.1.0",
|
|
60
62
|
"eslint-plugin-import": "2.27.5",
|
|
61
|
-
"eslint-plugin-n": "
|
|
63
|
+
"eslint-plugin-n": "16.0.1",
|
|
62
64
|
"eslint-plugin-promise": "6.1.1",
|
|
63
|
-
"
|
|
65
|
+
"jest": "^29.6.1",
|
|
66
|
+
"jest-environment-jsdom": "29.6.1",
|
|
67
|
+
"rimraf": "5.0.1",
|
|
64
68
|
"standard": "17.1.0",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
69
|
+
"ts-jest": "29.1.1",
|
|
70
|
+
"tsc-alias": "1.8.7",
|
|
71
|
+
"typescript": "5.1.6"
|
|
67
72
|
},
|
|
68
73
|
"eslintConfig": {
|
|
69
74
|
"extends": "./node_modules/standard/eslintrc.json"
|
package/titlebar/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Color } from '../base/common/color';
|
|
2
|
+
import { MenuBar } from '../menubar';
|
|
2
3
|
import { TitleBarOptions } from './options';
|
|
3
4
|
import { ThemeBar } from './themebar';
|
|
4
5
|
export declare class CustomTitlebar extends ThemeBar {
|
|
@@ -96,4 +97,8 @@ export declare class CustomTitlebar extends ThemeBar {
|
|
|
96
97
|
* Remove the titlebar, menubar and all methods.
|
|
97
98
|
*/
|
|
98
99
|
dispose(): void;
|
|
100
|
+
get titlebarElement(): HTMLElement;
|
|
101
|
+
get menubarElement(): MenuBar | undefined;
|
|
102
|
+
get containerElement(): HTMLElement;
|
|
103
|
+
get titleElement(): HTMLElement;
|
|
99
104
|
}
|
package/titlebar/index.js
CHANGED
|
@@ -24,6 +24,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
24
24
|
super();
|
|
25
25
|
this.isInactive = false;
|
|
26
26
|
this.currentOptions = {
|
|
27
|
+
backgroundColor: _get__("color_1").Color.WHITE,
|
|
27
28
|
closeable: true,
|
|
28
29
|
enableMnemonics: true,
|
|
29
30
|
// hideWhenClickingClose: false,
|
|
@@ -53,7 +54,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
53
54
|
...this.currentOptions,
|
|
54
55
|
...options
|
|
55
56
|
};
|
|
56
|
-
const jWindowIcons = _get__("consts_1").menuIcons[(0, _get__("platform_1").PlatformToString)(_get__("platform_1").platform)
|
|
57
|
+
const jWindowIcons = _get__("consts_1").menuIcons[(0, _get__("platform_1").PlatformToString)(_get__("platform_1").platform)?.toLocaleLowerCase()];
|
|
57
58
|
this.platformIcons = jWindowIcons;
|
|
58
59
|
this.titlebar = (0, _get__("dom_1").$)('.cet-titlebar');
|
|
59
60
|
this.dragRegion = (0, _get__("dom_1").$)('.cet-drag-region');
|
|
@@ -145,7 +146,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
145
146
|
this.icon.firstElementChild.setAttribute('style', `height: ${size}px`);
|
|
146
147
|
}
|
|
147
148
|
setupMenubar() {
|
|
148
|
-
_get__("electron_1").ipcRenderer.invoke('request-application-menu')
|
|
149
|
+
_get__("electron_1").ipcRenderer.invoke('request-application-menu')?.then(menu => this.updateMenu(menu));
|
|
149
150
|
const menuPosition = this.currentOptions.menuPosition;
|
|
150
151
|
if (menuPosition) {
|
|
151
152
|
this.updateMenuPosition(menuPosition);
|
|
@@ -172,9 +173,9 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
172
173
|
const onlyRendererMenuBar = this.currentOptions.onlyShowMenuBar;
|
|
173
174
|
const tooltips = this.currentOptions.tooltips;
|
|
174
175
|
if (_get__("platform_1").isMacintosh || onlyRendererMenuBar) return;
|
|
175
|
-
this.createControlButton(this.controls.minimize, this.platformIcons
|
|
176
|
-
this.createControlButton(this.controls.maximize, this.platformIcons
|
|
177
|
-
this.createControlButton(this.controls.close, this.platformIcons
|
|
176
|
+
this.createControlButton(this.controls.minimize, this.platformIcons?.minimize, tooltips.minimize, this.currentOptions.minimizable);
|
|
177
|
+
this.createControlButton(this.controls.maximize, this.platformIcons?.maximize, tooltips.maximize, this.currentOptions.maximizable);
|
|
178
|
+
this.createControlButton(this.controls.close, this.platformIcons?.close, tooltips.close, this.currentOptions.closeable);
|
|
178
179
|
(0, _get__("dom_1").append)(this.titlebar, this.controlsContainer);
|
|
179
180
|
}
|
|
180
181
|
setupContainer() {
|
|
@@ -190,7 +191,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
190
191
|
setupTitleBar() {
|
|
191
192
|
const order = this.currentOptions.order;
|
|
192
193
|
const hasShadow = this.currentOptions.shadow;
|
|
193
|
-
(0, _get__("dom_1").addClass)(this.titlebar, `cet-${(0, _get__("platform_1").PlatformToString)(_get__("platform_1").platform)
|
|
194
|
+
(0, _get__("dom_1").addClass)(this.titlebar, `cet-${(0, _get__("platform_1").PlatformToString)(_get__("platform_1").platform)?.toLocaleLowerCase()}`);
|
|
194
195
|
if (order) {
|
|
195
196
|
(0, _get__("dom_1").addClass)(this.titlebar, `cet-${order}`);
|
|
196
197
|
}
|
|
@@ -241,7 +242,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
241
242
|
this.updateStyles();
|
|
242
243
|
}
|
|
243
244
|
onMenuBarVisibilityChanged(visible) {
|
|
244
|
-
if (_get__("platform_1").isWindows || _get__("platform_1").isLinux) {
|
|
245
|
+
if (_get__("platform_1").isWindows || _get__("platform_1").isLinux || _get__("platform_1").isFreeBSD) {
|
|
245
246
|
if (visible) {
|
|
246
247
|
// Hack to fix issue #52522 with layered webkit-app-region elements appearing under cursor
|
|
247
248
|
(0, _get__("dom_1").hide)(this.dragRegion);
|
|
@@ -250,7 +251,7 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
253
|
onMenuBarFocusChanged(focused) {
|
|
253
|
-
if (_get__("platform_1").isWindows || _get__("platform_1").isLinux) {
|
|
254
|
+
if (_get__("platform_1").isWindows || _get__("platform_1").isLinux || _get__("platform_1").isFreeBSD) {
|
|
254
255
|
if (focused) (0, _get__("dom_1").hide)(this.dragRegion);else (0, _get__("dom_1").show)(this.dragRegion);
|
|
255
256
|
}
|
|
256
257
|
}
|
|
@@ -294,16 +295,16 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
294
295
|
(0, _get__("dom_1").removeClass)(this.titlebar, 'light');
|
|
295
296
|
foregroundColor = this.isInactive ? _get__("consts_1").INACTIVE_FOREGROUND : _get__("consts_1").ACTIVE_FOREGROUND;
|
|
296
297
|
}
|
|
297
|
-
this.titlebar.style.color = foregroundColor
|
|
298
|
+
this.titlebar.style.color = foregroundColor?.toString();
|
|
298
299
|
if (this.menuBar) {
|
|
299
300
|
let fgColor;
|
|
300
|
-
const backgroundColor = this.currentOptions.menuBarBackgroundColor
|
|
301
|
+
const backgroundColor = this.currentOptions.menuBarBackgroundColor || this.currentOptions.backgroundColor.darken(0.12);
|
|
301
302
|
const foregroundColor = backgroundColor?.isLighter() ? _get__("consts_1").INACTIVE_FOREGROUND_DARK : _get__("consts_1").INACTIVE_FOREGROUND;
|
|
302
|
-
const bgColor =
|
|
303
|
-
if (bgColor
|
|
303
|
+
const bgColor = this.currentOptions.itemBackgroundColor && !this.currentOptions.itemBackgroundColor.equals(backgroundColor) ? this.currentOptions.itemBackgroundColor : _get__("consts_1").DEFAULT_ITEM_SELECTOR;
|
|
304
|
+
if (bgColor?.equals(_get__("consts_1").DEFAULT_ITEM_SELECTOR)) {
|
|
304
305
|
fgColor = backgroundColor?.isLighter() ? _get__("consts_1").ACTIVE_FOREGROUND_DARK : _get__("consts_1").ACTIVE_FOREGROUND;
|
|
305
306
|
} else {
|
|
306
|
-
fgColor = bgColor
|
|
307
|
+
fgColor = bgColor?.isLighter() ? _get__("consts_1").ACTIVE_FOREGROUND_DARK : _get__("consts_1").ACTIVE_FOREGROUND;
|
|
307
308
|
}
|
|
308
309
|
this.menuBar.setStyles({
|
|
309
310
|
backgroundColor,
|
|
@@ -420,8 +421,9 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
420
421
|
* @param backgroundColor The color for the background
|
|
421
422
|
*/
|
|
422
423
|
updateBackground(backgroundColor) {
|
|
424
|
+
if (typeof backgroundColor === 'string') backgroundColor = _get__("color_1").Color.fromHex(backgroundColor);
|
|
423
425
|
this.currentOptions.backgroundColor = backgroundColor;
|
|
424
|
-
|
|
426
|
+
this.updateStyles();
|
|
425
427
|
return this;
|
|
426
428
|
}
|
|
427
429
|
/**
|
|
@@ -429,8 +431,9 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
429
431
|
* @param itemBGColor The color for the item background
|
|
430
432
|
*/
|
|
431
433
|
updateItemBGColor(itemBGColor) {
|
|
434
|
+
if (typeof itemBGColor === 'string') itemBGColor = _get__("color_1").Color.fromHex(itemBGColor);
|
|
432
435
|
this.currentOptions.itemBackgroundColor = itemBGColor;
|
|
433
|
-
|
|
436
|
+
this.updateStyles();
|
|
434
437
|
return this;
|
|
435
438
|
}
|
|
436
439
|
/**
|
|
@@ -471,6 +474,18 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
471
474
|
while (this.container.firstChild) (0, _get__("dom_1").append)(document.body, this.container.firstChild);
|
|
472
475
|
this.container.remove();
|
|
473
476
|
}
|
|
477
|
+
get titlebarElement() {
|
|
478
|
+
return this.titlebar;
|
|
479
|
+
}
|
|
480
|
+
get menubarElement() {
|
|
481
|
+
return this.menuBar;
|
|
482
|
+
}
|
|
483
|
+
get containerElement() {
|
|
484
|
+
return this.container;
|
|
485
|
+
}
|
|
486
|
+
get titleElement() {
|
|
487
|
+
return this.title;
|
|
488
|
+
}
|
|
474
489
|
}
|
|
475
490
|
exports.CustomTitlebar = _get__("CustomTitlebar");
|
|
476
491
|
function _getGlobalObject() {
|
|
@@ -558,14 +573,14 @@ function _get__(variableName) {
|
|
|
558
573
|
}
|
|
559
574
|
function _get_original__(variableName) {
|
|
560
575
|
switch (variableName) {
|
|
576
|
+
case "color_1":
|
|
577
|
+
return color_1;
|
|
561
578
|
case "consts_1":
|
|
562
579
|
return consts_1;
|
|
563
580
|
case "platform_1":
|
|
564
581
|
return platform_1;
|
|
565
582
|
case "dom_1":
|
|
566
583
|
return dom_1;
|
|
567
|
-
case "color_1":
|
|
568
|
-
return color_1;
|
|
569
584
|
case "electron_1":
|
|
570
585
|
return electron_1;
|
|
571
586
|
case "menubar_1":
|
package/titlebar/themebar.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.ThemeBar = void 0;
|
|
11
11
|
const lifecycle_1 = require("../base/common/lifecycle");
|
|
12
|
-
const baseTheme = "body {\n margin: 0 !important;\n overflow: hidden !important;\n}\n\n/* Titlebar */\n.cet-titlebar {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n flex-wrap: wrap;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n font-size: 13px;\n font-family: Arial, Helvetica, sans-serif;\n box-sizing: border-box;\n padding: 0 16px;\n overflow: hidden;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n zoom: 1;\n width: 100%;\n height: 31px;\n line-height: 31px;\n z-index: 99999;\n}\n\n.cet-titlebar *,\n.cet-titlebar *:before,\n.cet-titlebar *:after {\n box-sizing: border-box;\n}\n\n.cet-titlebar.cet-windows,\n.cet-titlebar.cet-linux {\n padding: 0;\n height: 30px;\n line-height: 30px;\n justify-content: left;\n overflow: visible;\n}\n\n/* Inverted */\n.cet-titlebar.cet-inverted {\n flex-direction: row-reverse;\n}\n\n.cet-titlebar.cet-inverted .cet-menubar,\n.cet-titlebar.cet-inverted .cet-window-controls {\n flex-direction: row-reverse;\n margin-left: 20px;\n margin-right: 0;\n}\n\n/* First buttons */\n.cet-titlebar.cet-first-buttons .cet-window-controls {\n order: -1;\n margin: 0 5px 0 0;\n}\n\n.cet-titlebar.cet-inverted .cet-window-controls {\n margin: 0 5px 0 0;\n}\n\n/* Shadow */\n.cet-titlebar.cet-shadow {\n box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);\n}\n\n/* Drag region */\n.cet-drag-region {\n top: 0;\n left: 0;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: -1;\n -webkit-app-region: drag;\n}\n\n/* Icon */\n.cet-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 30px;\n z-index: 99;\n overflow: hidden;\n}\n\n/* Title */\n.cet-title {\n flex: 0 1 auto;\n font-size: 12px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n zoom: 1;\n}\n\n/* Title alignment */\n.cet-title.cet-title-left {\n margin-left: 8px;\n margin-right: auto;\n}\n\n.cet-title.cet-title-right {\n margin-left: auto;\n margin-right: 8px;\n}\n\n.cet-title.cet-title-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.cet-title.cet-bigsur {\n font-size: 13px;\n font-weight: 600;\n}\n\n/* Window controls */\n.cet-window-controls {\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n text-align: center;\n position: relative;\n z-index: 99;\n -webkit-app-region: no-drag;\n height: 30px;\n font-family: initial !important;\n margin-left: auto;\n}\n\n.cet-control-icon {\n width: 46px;\n}\n\n.cet-control-icon:not(.inactive):hover {\n background-color: rgb(255 255 255 / 12%);\n}\n\n.light .cet-control-icon:not(.inactive):hover {\n background-color: rgb(0 0 0 / 12%);\n}\n\n.cet-control-icon.inactive svg {\n opacity: 0.4;\n}\n\n.cet-control-icon svg {\n width: 10px;\n height: -webkit-fill-available;\n fill: #fff;\n display: initial !important;\n vertical-align: unset !important;\n}\n\n.cet-titlebar.light .cet-control-icon svg {\n fill: #222222 !important;\n}\n\n.cet-control-close:not(.inactive):hover {\n background-color: rgb(232 17 35 / 90%) !important;\n}\n\n.cet-control-close:not(.inactive):hover svg {\n fill: #fff !important;\n}\n\n/* Resizer */\n.cet-resizer {\n -webkit-app-region: no-drag;\n position: absolute;\n}\n\n.cet-resizer.left {\n top: 0;\n left: 0;\n width: 6px;\n height: 100%;\n}\n\n.cet-resizer.top {\n top: 0;\n width: 100%;\n height: 6px;\n}\n\n/* Container */\n.cet-container {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n z-index: 1;\n}\n\n/* MenuBar */\n.cet-menubar {\n display: flex;\n flex-shrink: 1;\n box-sizing: border-box;\n overflow: hidden;\n flex-wrap: wrap;\n margin-right: 20px;\n}\n\n.cet-menubar.bottom {\n order: 1;\n width: 100%;\n padding: 0 5px 5px;\n margin-right: 0;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button {\n border-radius: 4px;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button .cet-menubar-menu-title {\n line-height: 26px;\n}\n\n.cet-menubar .cet-menubar-menu-button {\n box-sizing: border-box;\n padding: 0px 8px;\n height: 100%;\n cursor: default;\n zoom: 1;\n white-space: nowrap;\n -webkit-app-region: no-drag;\n outline: 0;\n}\n\n.cet-menubar .cet-menubar-menu-button .cet-menubar-menu-title {\n font-size: 12px;\n}\n\n.cet-menubar .cet-menubar-menu-button.disabled {\n opacity: 0.4;\n}\n\n.cet-menubar .cet-menubar-menu-button:not(.disabled):
|
|
12
|
+
const baseTheme = "body {\n margin: 0 !important;\n overflow: hidden !important;\n}\n\n/* Titlebar */\n.cet-titlebar {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n flex-wrap: wrap;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n font-size: 13px;\n font-family: Arial, Helvetica, sans-serif;\n box-sizing: border-box;\n padding: 0 16px;\n overflow: hidden;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n zoom: 1;\n width: 100%;\n height: 31px;\n line-height: 31px;\n z-index: 99999;\n}\n\n.cet-titlebar *,\n.cet-titlebar *:before,\n.cet-titlebar *:after {\n box-sizing: border-box;\n}\n\n.cet-titlebar.cet-windows,\n.cet-titlebar.cet-linux,\n.cet-titlebar.cet-freebsd {\n padding: 0;\n height: 30px;\n line-height: 30px;\n justify-content: left;\n overflow: visible;\n}\n\n/* Inverted */\n.cet-titlebar.cet-inverted {\n flex-direction: row-reverse;\n}\n\n.cet-titlebar.cet-inverted .cet-menubar,\n.cet-titlebar.cet-inverted .cet-window-controls {\n flex-direction: row-reverse;\n margin-left: 20px;\n margin-right: 0;\n}\n\n/* First buttons */\n.cet-titlebar.cet-first-buttons .cet-window-controls {\n order: -1;\n margin: 0 5px 0 0;\n}\n\n.cet-titlebar.cet-inverted .cet-window-controls {\n margin: 0 5px 0 0;\n}\n\n/* Shadow */\n.cet-titlebar.cet-shadow {\n box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);\n}\n\n/* Drag region */\n.cet-drag-region {\n top: 0;\n left: 0;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: -1;\n -webkit-app-region: drag;\n}\n\n/* Icon */\n.cet-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 30px;\n z-index: 99;\n overflow: hidden;\n}\n\n/* Title */\n.cet-title {\n flex: 0 1 auto;\n font-size: 12px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n zoom: 1;\n}\n\n/* Title alignment */\n.cet-title.cet-title-left {\n margin-left: 8px;\n margin-right: auto;\n}\n\n.cet-title.cet-title-right {\n margin-left: auto;\n margin-right: 8px;\n}\n\n.cet-title.cet-title-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.cet-title.cet-bigsur {\n font-size: 13px;\n font-weight: 600;\n}\n\n/* Window controls */\n.cet-window-controls {\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n text-align: center;\n position: relative;\n z-index: 99;\n -webkit-app-region: no-drag;\n height: 30px;\n font-family: initial !important;\n margin-left: auto;\n}\n\n.cet-control-icon {\n width: 46px;\n}\n\n.cet-control-icon:not(.inactive):hover {\n background-color: rgb(255 255 255 / 12%);\n}\n\n.light .cet-control-icon:not(.inactive):hover {\n background-color: rgb(0 0 0 / 12%);\n}\n\n.cet-control-icon.inactive svg {\n opacity: 0.4;\n}\n\n.cet-control-icon svg {\n width: 10px;\n height: -webkit-fill-available;\n fill: #fff;\n display: initial !important;\n vertical-align: unset !important;\n}\n\n.cet-titlebar.light .cet-control-icon svg {\n fill: #222222 !important;\n}\n\n.cet-control-close:not(.inactive):hover {\n background-color: rgb(232 17 35 / 90%) !important;\n}\n\n.cet-control-close:not(.inactive):hover svg {\n fill: #fff !important;\n}\n\n/* Resizer */\n.cet-resizer {\n -webkit-app-region: no-drag;\n position: absolute;\n}\n\n.cet-resizer.left {\n top: 0;\n left: 0;\n width: 6px;\n height: 100%;\n}\n\n.cet-resizer.top {\n top: 0;\n width: 100%;\n height: 6px;\n}\n\n/* Container */\n.cet-container {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n z-index: 1;\n}\n\n/* MenuBar */\n.cet-menubar {\n display: flex;\n flex-shrink: 1;\n box-sizing: border-box;\n overflow: hidden;\n flex-wrap: wrap;\n margin-right: 20px;\n}\n\n.cet-menubar.bottom {\n order: 1;\n width: 100%;\n padding: 0 5px 5px;\n margin-right: 0;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button {\n border-radius: 4px;\n}\n\n.cet-menubar.bottom .cet-menubar-menu-button .cet-menubar-menu-title {\n line-height: 26px;\n}\n\n.cet-menubar .cet-menubar-menu-button {\n box-sizing: border-box;\n padding: 0px 8px;\n height: 100%;\n cursor: default;\n zoom: 1;\n white-space: nowrap;\n -webkit-app-region: no-drag;\n outline: 0;\n}\n\n.cet-menubar .cet-menubar-menu-button .cet-menubar-menu-title {\n font-size: 12px;\n}\n\n.cet-menubar .cet-menubar-menu-button.disabled {\n opacity: 0.4;\n}\n\n.cet-menubar .cet-menubar-menu-button:not(.disabled):hover,\n.cet-menubar .cet-menubar-menu-button:not(.disabled).open {\n background-color: rgb(255 255 255 / 12%);\n}\n\n.cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled):hover,\n.cet-titlebar.light .cet-menubar .cet-menubar-menu-button:not(.disabled).open {\n background-color: rgb(0 0 0 / 12%);\n}\n\n.cet-menubar-menu-container {\n position: absolute;\n display: block;\n left: 0px;\n opacity: 1;\n outline: 0;\n border: none;\n text-align: left;\n margin: 0 auto;\n margin-left: 0;\n font-size: inherit;\n overflow-x: visible;\n overflow-y: visible;\n -webkit-overflow-scrolling: touch;\n justify-content: flex-end;\n white-space: nowrap;\n border-radius: 7px;\n backdrop-filter: blur(5px);\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\n z-index: 99999;\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar {\n width: 8px;\n height: 4px;\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar-track {\n border: none;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.cet-menubar-menu-container::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background-color: rgba(110, 110, 110, 0.2);\n}\n\n.cet-menubar-menu-container:focus {\n outline: 0;\n}\n\n.cet-menubar-menu-container .cet-action-item {\n padding: 0;\n margin: 0;\n transform: none;\n display: -ms-flexbox;\n display: flex;\n outline: none;\n}\n\n.cet-menubar-menu-container .cet-action-item.active {\n transform: none;\n}\n\n.cet-menubar-menu-container .cet-action-item.disabled .cet-action-menu-item {\n opacity: 0.4;\n}\n\n.cet-menubar-menu-container .cet-action-item .cet-submenu {\n position: absolute;\n}\n\n.cet-menubar-menu-container .cet-action-menu-item {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -ms-flexbox;\n display: flex;\n height: 2.231em;\n margin: 4px 3px;\n align-items: center;\n position: relative;\n border-radius: 4px;\n text-decoration: none;\n}\n\n.cet-menubar-menu-container .cet-action-label {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n text-decoration: none;\n padding: 0 1em;\n background: none;\n font-size: 12px;\n line-height: 1;\n}\n\n.cet-menubar-menu-container .cet-action-label:not(.separator) {\n display: inline-block;\n -webkit-box-sizing: border-box;\n -o-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0 2em 0 0.8em;\n}\n\n.cet-menubar-menu-container .cet-action-label.separator {\n opacity: 0.1;\n font-size: inherit;\n width: 100%;\n border-bottom: 1px solid transparent;\n}\n\n.cet-menubar-menu-container .cet-action-label.separator.text {\n padding: 0.7em 1em 0.1em 1em;\n font-weight: bold;\n opacity: 1;\n}\n\n.cet-menubar-menu-container .cet-action-label:hover {\n color: inherit;\n}\n\n.cet-menubar-menu-container .keybinding,\n.cet-menubar-menu-container .cet-submenu-indicator {\n display: inline-block;\n -ms-flex: 2 1 auto;\n flex: 2 1 auto;\n padding: 0 2em 0 1em;\n text-align: right;\n font-size: 11px;\n line-height: 1;\n}\n\n.cet-menubar-menu-container .cet-submenu-indicator {\n position: absolute;\n right: 4px;\n height: 12px;\n width: 12px;\n padding: 0;\n}\n\n.cet-menubar-menu-container .cet-submenu-indicator img,\n.cet-menubar-menu-container .cet-menu-item-icon .icon,\n.cet-menubar-menu-container .cet-submenu-indicator svg,\n.cet-menubar-menu-container .cet-menu-item-icon svg {\n display: inherit;\n width: 100%;\n height: 100%;\n}\n\n.cet-menubar-menu-container .cet-action-menu-item.checked>.cet-menu-item-icon.checkbox {\n visibility: visible;\n}\n\n.cet-menubar-menu-container .cet-menu-item-icon {\n width: 14px;\n height: 14px;\n margin: 0 0 0 12px;\n}\n\n.cet-menubar-menu-container .cet-menu-item-icon.checkbox {\n visibility: hidden;\n}";
|
|
13
13
|
const macTheme = "";
|
|
14
14
|
const winTheme = "";
|
|
15
15
|
class ThemingRegistry extends _get__("lifecycle_1").Disposable {
|