Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit 3a14c4e

Browse files
Merge pull request #178 from AlexTorresSk/develop
v4.1.0
2 parents 4d7c6ae + a3cc6e0 commit 3a14c4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+572
-199
lines changed

.github/workflows/npm-publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: NPM Publish
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
npm-publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: "16.x"
14+
registry-url: "https://registry.npmjs.org"
15+
16+
- name: 📦 Install dependencies
17+
run: npm ci
18+
19+
- name: 🚀 Publish package to NPM
20+
run: npm publish --access public
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,48 @@ This project is a typescript library for electron that allows you to configure a
1010
![Screenshot 2](screenshots/cet-002.jpg)
1111

1212
![Screenshot 3](screenshots/cet-003.jpg)
13+
<br><br>
1314

14-
## 🟢 Install
15-
```
15+
# 📦 Intalling
16+
You can install this package with `npm`.
17+
```sh
1618
npm install custom-electron-titlebar
1719
```
20+
<br>
1821

19-
## 🚀 Usage
20-
To see the documentation on how to use the title bar, visit the [Wiki](https://github.com/AlexTorresSk/custom-electron-titlebar/wiki)
22+
# 🛠️ Usage
23+
The implementation is done as follows:
2124

22-
## ✅ License
23-
This project is under the [MIT](https://github.com/AlexTorresSk/custom-electron-titlebar/blob/master/LICENSE) license.
25+
In the main application file (main.js or .ts)
26+
```js
27+
import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";
28+
29+
// setup the titlebar main process
30+
setupTitlebar();
31+
32+
function createWindow() {
33+
...
34+
35+
// attach fullscreen(f11 and not 'maximized') && focus listeners
36+
attachTitlebarToWindow(mainWindow);
37+
}
38+
```
39+
40+
In the preload file (preload.js or .ts)
41+
```js
42+
import { Titlebar } from "custom-electron-titlebar";
43+
44+
window.addEventListener('DOMContentLoaded', () => {
45+
// Title bar implemenation
46+
new Titlebar();
47+
});
48+
```
49+
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/AlexTorresSk/custom-electron-titlebar/wiki)
50+
<br><br>
2451

2552
## 💰 Support
26-
If you want to support my development, you can do so by donating through [Buy me a coffee](https://www.buymeacoffee.com/AlexTorresSk), [Paypal](https://www.paypal.com/paypalme/hapovedat) or [Patreon](https://www.patreon.com/AlexTorresSk)
53+
If you want to support my development, you can do so by donating through [Buy me a coffee](https://www.buymeacoffee.com/AlexTorresSk) or [Patreon](https://www.patreon.com/AlexTorresSk)
54+
<br><br>
55+
56+
## ✅ License
57+
This project is under the [MIT](https://github.com/AlexTorresSk/custom-electron-titlebar/blob/master/LICENSE) license.

example/assets/icons.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"check": "<svg viewBox='0 0 11 11'><path d='M3.8,9.3c-0.1,0-0.2,0-0.3-0.1L0.2,5.8C0,5.6,0,5.4,0.2,5.2C0.4,5,0.7,5,0.9,5.2l3,3l6.3-6.3c0.2-0.2,0.5-0.2,0.7,0C11,2,11,2.3,10.8,2.5L4.2,9.1C4.1,9.2,4,9.3,3.8,9.3z'/></svg>",
3+
"arrow": "<svg viewBox='0 0 11 11'><path d='M3.1,10.7c-0.1,0-0.2,0-0.3-0.1c-0.2-0.2-0.2-0.5,0-0.7l4.4-4.4L2.8,1.1c-0.2-0.2-0.2-0.5,0-0.7c0.2-0.2,0.5-0.2,0.7,0l4.8,4.8c0.2,0.2,0.2,0.5,0,0.7l-4.8,4.8C3.4,10.7,3.2,10.7,3.1,10.7z'/></svg>",
4+
"win": {
5+
"minimize": "<svg viewBox='0 0 11 11'><path d='M11,4.9v1.1H0V4.399h11z'/></svg>",
6+
"maximize": "<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>",
7+
"restore": "<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'/><path d='M10,0H3.5v1.1h6.1c0.2,0,0.3,0.1,0.3,0.3v6.1H11V1C11,0.4,10.6,0,10,0z'/></svg>",
8+
"close": "<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>"
9+
}
10+
}
8.92 KB
Loading
10.5 KB
Loading
2.28 KB
Loading
2.99 KB
Loading
4.31 KB
Loading
5.79 KB
Loading
6.87 KB
Loading

0 commit comments

Comments
 (0)