custom-electron-titlebar 4.2.0-beta.0 → 4.2.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/LICENSE +21 -21
- package/README.md +83 -71
- package/package.json +68 -65
- package/dist/base/browser/browser.d.ts +0 -26
- package/dist/base/browser/browser.js +0 -317
- package/dist/base/browser/event.d.ts +0 -12
- package/dist/base/browser/event.js +0 -215
- package/dist/base/browser/keyboardEvent.d.ts +0 -38
- package/dist/base/browser/keyboardEvent.js +0 -466
- package/dist/base/browser/mouseEvent.d.ts +0 -61
- package/dist/base/browser/mouseEvent.js +0 -327
- package/dist/base/common/arrays.d.ts +0 -4
- package/dist/base/common/arrays.js +0 -199
- package/dist/base/common/async.d.ts +0 -35
- package/dist/base/common/async.js +0 -280
- package/dist/base/common/charCode.d.ts +0 -405
- package/dist/base/common/charCode.js +0 -9
- package/dist/base/common/color.d.ts +0 -159
- package/dist/base/common/color.js +0 -708
- package/dist/base/common/dom.d.ts +0 -185
- package/dist/base/common/dom.js +0 -1338
- package/dist/base/common/event.d.ts +0 -213
- package/dist/base/common/event.js +0 -804
- package/dist/base/common/iterator.d.ts +0 -69
- package/dist/base/common/iterator.js +0 -381
- package/dist/base/common/keyCodes.d.ts +0 -273
- package/dist/base/common/keyCodes.js +0 -465
- package/dist/base/common/lifecycle.d.ts +0 -17
- package/dist/base/common/lifecycle.js +0 -258
- package/dist/base/common/linkedList.d.ts +0 -17
- package/dist/base/common/linkedList.js +0 -319
- package/dist/base/common/platform.d.ts +0 -33
- package/dist/base/common/platform.js +0 -302
- package/dist/consts.d.ts +0 -11
- package/dist/consts.js +0 -199
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -211
- package/dist/main/attach-titlebar-to-window.d.ts +0 -3
- package/dist/main/attach-titlebar-to-window.js +0 -207
- package/dist/main/index.d.ts +0 -3
- package/dist/main/index.js +0 -202
- package/dist/main/setup-titlebar.d.ts +0 -2
- package/dist/main/setup-titlebar.js +0 -232
- package/dist/menubar/index.d.ts +0 -16
- package/dist/menubar/index.js +0 -236
- package/dist/menubar/menubar-options.d.ts +0 -33
- package/dist/menubar/menubar-options.js +0 -9
- package/dist/titlebar/index.d.ts +0 -88
- package/dist/titlebar/index.js +0 -601
- package/dist/titlebar/options.d.ts +0 -58
- package/dist/titlebar/options.js +0 -9
- package/dist/titlebar/themebar.d.ts +0 -20
- package/dist/titlebar/themebar.js +0 -267
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Alex Torres
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,71 +1,83 @@
|
|
|
1
|
-
# Custom Electron Titlebar
|
|
2
|
-
|
|
3
|
-
This project is a typescript library for electron that allows you to configure a fully customizable title bar.
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
# Custom Electron Titlebar
|
|
2
|
+
|
|
3
|
+
This project is a typescript library for electron that allows you to configure a fully customizable title bar.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE)
|
|
6
|
+
[](https://npmjs.org/package/custom-electron-titlebar)
|
|
7
|
+
[](https://packagephobia.com/result?p=custom-electron-titlebar)
|
|
8
|
+
|
|
9
|
+
[📄 Visit Documentation](https://cet.alextrs.dev)
|
|
10
|
+
|
|
11
|
+
Standard Title Bar
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
Bottom Menu Bar
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
Menu
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
Custom color
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
# 📦 Installing
|
|
28
|
+
You can install this package with `npm`.
|
|
29
|
+
```sh
|
|
30
|
+
npm install custom-electron-titlebar
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
# 🛠️ Usage
|
|
34
|
+
The implementation is done as follows:
|
|
35
|
+
|
|
36
|
+
In the main application file (main.js or .ts)
|
|
37
|
+
```js
|
|
38
|
+
import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";
|
|
39
|
+
|
|
40
|
+
// setup the titlebar main process
|
|
41
|
+
setupTitlebar();
|
|
42
|
+
|
|
43
|
+
function createWindow() {
|
|
44
|
+
// Create the browser window.
|
|
45
|
+
const mainWindow = new BrowserWindow({
|
|
46
|
+
width: 800,
|
|
47
|
+
height: 600,
|
|
48
|
+
titleBarStyle: 'hidden',
|
|
49
|
+
//frame: false, // needed if process.versions.electron < 14
|
|
50
|
+
webPreferences: {
|
|
51
|
+
sandbox: false,
|
|
52
|
+
preload: path.join(__dirname, 'preload.js')
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
...
|
|
57
|
+
|
|
58
|
+
// attach fullScreen(f11 and not 'maximized') && focus listeners
|
|
59
|
+
attachTitlebarToWindow(mainWindow);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
In the preload file (preload.js or .ts)
|
|
64
|
+
```js
|
|
65
|
+
import { Titlebar } from "custom-electron-titlebar";
|
|
66
|
+
|
|
67
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
68
|
+
// Title bar implementation
|
|
69
|
+
new Titlebar();
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
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
|
+
## 💰 Support
|
|
75
|
+
If you want to support my development, you can do so by donating through [Buy me a coffee](https://www.buymeacoffee.com/AlexTorresDev)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 📝 Collaborators
|
|
79
|
+
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
|
+
## ✅ License
|
|
83
|
+
This project is under the [MIT](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE) license.
|
package/package.json
CHANGED
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "custom-electron-titlebar",
|
|
3
|
-
"version": "4.2.0
|
|
4
|
-
"description": "Library for electron that allows you to configure a fully customizable title bar.",
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
|
-
"typesVersions": {
|
|
7
|
-
"*": {
|
|
8
|
-
"main": [
|
|
9
|
-
"./dist/main/index.d.ts"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"exports": {
|
|
14
|
-
".": "./dist/index.js",
|
|
15
|
-
"./main": "./dist/main/index.js"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"clean": "rimraf ./dist",
|
|
19
|
-
"build": "tsc &&
|
|
20
|
-
"
|
|
21
|
-
"start": "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"babel-plugin-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "custom-electron-titlebar",
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "Library for electron that allows you to configure a fully customizable title bar.",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"typesVersions": {
|
|
7
|
+
"*": {
|
|
8
|
+
"main": [
|
|
9
|
+
"./dist/main/index.d.ts"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/index.js",
|
|
15
|
+
"./main": "./dist/main/index.js"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"clean": "rimraf ./dist",
|
|
19
|
+
"build:package": "tsc && tsc-alias",
|
|
20
|
+
"build:babel": "babel ./dist --out-dir ./dist --extensions \".js\"",
|
|
21
|
+
"start": "electron example/main.js",
|
|
22
|
+
"dev": "npm run build && npm run start",
|
|
23
|
+
"build": "npm run clean && npm run build:package && npm run build:babel"
|
|
24
|
+
},
|
|
25
|
+
"author": "AlexTorresDev <alextorressk@gmail.com>",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/AlexTorresDev/custom-electron-titlebar.git"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"typescript",
|
|
33
|
+
"electron",
|
|
34
|
+
"title bar",
|
|
35
|
+
"menubar",
|
|
36
|
+
"windows",
|
|
37
|
+
"linux"
|
|
38
|
+
],
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/AlexTorresDev/custom-electron-titlebar/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/AlexTorresDev/custom-electron-titlebar#readme",
|
|
43
|
+
"directories": {
|
|
44
|
+
"example": "example",
|
|
45
|
+
"dist": "dist"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"electron": ">20.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@babel/cli": "7.21.5",
|
|
52
|
+
"@babel/core": "7.21.8",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "5.59.2",
|
|
54
|
+
"@typescript-eslint/parser": "5.59.2",
|
|
55
|
+
"babel-plugin-import-require-as-string": "1.0.2",
|
|
56
|
+
"babel-plugin-module-resolver": "5.0.0",
|
|
57
|
+
"babel-plugin-rewire": "1.2.0",
|
|
58
|
+
"electron": "24.2.0",
|
|
59
|
+
"eslint": "8.40.0",
|
|
60
|
+
"eslint-config-prettier": "8.8.0",
|
|
61
|
+
"eslint-config-standard": "17.0.0",
|
|
62
|
+
"eslint-plugin-import": "2.27.5",
|
|
63
|
+
"eslint-plugin-n": "15.7.0",
|
|
64
|
+
"eslint-plugin-promise": "6.1.1",
|
|
65
|
+
"rimraf": "5.0.0",
|
|
66
|
+
"tsc-alias": "1.8.6",
|
|
67
|
+
"typescript": "5.0.4"
|
|
68
|
+
}
|
|
66
69
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Event } from 'base/common/event';
|
|
2
|
-
import { IDisposable } from 'base/common/lifecycle';
|
|
3
|
-
/** A zoom index, e.g. 1, 2, 3 */
|
|
4
|
-
export declare function setZoomLevel(zoomLevel: number, isTrusted: boolean): void;
|
|
5
|
-
export declare function getZoomLevel(): number;
|
|
6
|
-
/** Returns the time (in ms) since the zoom level was changed */
|
|
7
|
-
export declare function getTimeSinceLastZoomLevelChanged(): number;
|
|
8
|
-
export declare function onDidChangeZoomLevel(callback: (zoomLevel: number) => void): IDisposable;
|
|
9
|
-
/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */
|
|
10
|
-
export declare function getZoomFactor(): number;
|
|
11
|
-
export declare function setZoomFactor(zoomFactor: number): void;
|
|
12
|
-
export declare function getPixelRatio(): number;
|
|
13
|
-
export declare function setFullscreen(fullscreen: boolean): void;
|
|
14
|
-
export declare function isFullscreen(): boolean;
|
|
15
|
-
export declare const onDidChangeFullscreen: Event<void>;
|
|
16
|
-
export declare const isIE: boolean;
|
|
17
|
-
export declare const isEdge: boolean;
|
|
18
|
-
export declare const isEdgeOrIE: boolean;
|
|
19
|
-
export declare const isOpera: boolean;
|
|
20
|
-
export declare const isFirefox: boolean;
|
|
21
|
-
export declare const isWebKit: boolean;
|
|
22
|
-
export declare const isChrome: boolean;
|
|
23
|
-
export declare const isSafari: boolean;
|
|
24
|
-
export declare const isWebkitWebView: boolean;
|
|
25
|
-
export declare const isIPad: boolean;
|
|
26
|
-
export declare const isEdgeWebView: boolean;
|