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

Commit e0e35ad

Browse files
committed
Update readme
1 parent 533ea3d commit e0e35ad

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

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.

0 commit comments

Comments
 (0)