You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 13, 2024. It is now read-only.
| backgroundColor **(required)**| Color | The background color of the titlebar. |#444444|
66
-
| icon | string | The icon shown on the left side of the title bar. | null |
67
-
| iconsTheme | Theme | Style of the icons. | Themebar.win |
68
-
| shadow | boolean | The shadow of the titlebar. | false |
69
-
| drag | boolean | Define whether or not you can drag the window by holding the click on the title bar. | true |
70
-
| minimizable | boolean | Enables or disables the option to minimize the window by clicking on the corresponding button in the title bar. | true |
71
-
| maximizable | boolean | Enables or disables the option to maximize and un-maximize the window by clicking on the corresponding button in the title bar. | true |
72
-
| closeable | boolean | Enables or disables the option of the close window by clicking on the corresponding button in the title bar. | true |
73
-
| order | string | Set the order of the elements on the title bar. (`inverted`, `first-buttons`) | null |
74
-
| titleHorizontalAlignment | string | Set horizontal alignment of the window title. (`left`, `center`, `right`) | center |
75
-
| menu | Electron.Menu | The menu to show in the title bar. | Menu.getApplicationMenu() |
76
-
| menuPosition | string | The position of menubar on titlebar. | left |
77
-
| enableMnemonics | boolean | Enable the mnemonics on menubar and menu items. | true |
78
-
| itemBackgroundColor | Color | The background color when the mouse is over the item. | rgba(0, 0, 0, .14) |
79
-
| hideWhenClickingClose | boolean | When the close button is clicked, the window is hidden instead of closed. | false |
80
-
| overflow | string | The overflow of the container (`auto`, `visible`, `hidden`) | auto |
81
-
| unfocusEffect | boolean | Enables or disables the blur option in the title bar. | false |
| backgroundColor **(required)**| Color | The background color of the titlebar. |#444444|
67
+
| icon | string | The icon shown on the left side of the title bar. | null |
68
+
| shadow | boolean | The shadow of the titlebar. | false |
69
+
| drag | boolean | Define whether or not you can drag the window by holding the click on the title bar. | true |
70
+
| onMinimize | Funtion | Enables or disables the option to minimize the window by clicking on the corresponding button in the title bar. | undefined |
71
+
| onMaximize | Funtion | Enables or disables the option to maximize and un-maximize the window by clicking on the corresponding button in the title bar. | undefined |
72
+
| onClose | Funtion | Enables or disables the option of the close window by clicking on the corresponding button in the title bar. | undefined |
73
+
| isMaximized | Funtion | Check if window is maximized. | undefined |
74
+
| onMenuItemClick | Funtion(commandId: number)| Fires when any menu option is pressed. | undefined |
75
+
| order | string | Set the order of the elements on the title bar. (`inverted`, `first-buttons`) | null |
76
+
| titleHorizontalAlignment | string | Set horizontal alignment of the window title. (`left`, `center`, `right`) | center |
77
+
| menuPosition | string | The position of menubar on titlebar. | left |
78
+
| enableMnemonics | boolean | Enable the mnemonics on menubar and menu items. | true |
79
+
| hideWhenClickingClose | boolean | When the close button is clicked, the window is hidden instead of closed. | false |
80
+
| overflow | string | The overflow of the container (`auto`, `visible`, `hidden`) | auto |
81
+
| unfocusEffect | boolean | Enables or disables the blur option in the title bar. | false |
82
82
83
83
## Methods
84
84
@@ -124,51 +124,6 @@ With this method you can update the icon. This method receives the url of the im
124
124
titlebar.updateIcon('./images/my-icon.svg');
125
125
```
126
126
127
-
### Update Menu
128
-
129
-
This method updates or creates the menu, to create the menu use remote.Menu and remote.MenuItem.
130
-
131
-
```js
132
-
constmenu=newMenu();
133
-
menu.append(newMenuItem({
134
-
label:'Item 1',
135
-
submenu: [
136
-
{
137
-
label:'Subitem 1',
138
-
click: () =>console.log('Click on subitem 1')
139
-
},
140
-
{
141
-
type:'separator'
142
-
}
143
-
]
144
-
}));
145
-
146
-
menu.append(newMenuItem({
147
-
label:'Item 2',
148
-
submenu: [
149
-
{
150
-
label:'Subitem checkbox',
151
-
type:'checkbox',
152
-
checked:true
153
-
},
154
-
{
155
-
type:'separator'
156
-
},
157
-
{
158
-
label:'Subitem with submenu',
159
-
submenu: [
160
-
{
161
-
label:'Submenu &item 1',
162
-
accelerator:'Ctrl+T'
163
-
}
164
-
]
165
-
}
166
-
]
167
-
}));
168
-
169
-
titlebar.updateMenu(menu);
170
-
```
171
-
172
127
### Update Menu Position
173
128
174
129
You can change the position of the menu bar. `left` and `bottom` are allowed.
0 commit comments