custom-electron-titlebar 3.2.9 → 4.0.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.
Files changed (76) hide show
  1. package/README.md +10 -203
  2. package/{build → dist}/browser/browser.d.ts +0 -0
  3. package/{build → dist}/browser/event.d.ts +0 -0
  4. package/{build → dist}/browser/iframe.d.ts +0 -0
  5. package/{build → dist}/browser/keyboardEvent.d.ts +0 -0
  6. package/{build → dist}/browser/mouseEvent.d.ts +0 -0
  7. package/{build → dist}/common/arrays.d.ts +0 -0
  8. package/{build → dist}/common/async.d.ts +0 -0
  9. package/{build → dist}/common/charCode.d.ts +0 -0
  10. package/{build → dist}/common/color.d.ts +0 -0
  11. package/{build → dist}/common/dom.d.ts +0 -0
  12. package/{build → dist}/common/event.d.ts +0 -0
  13. package/{build → dist}/common/iterator.d.ts +0 -0
  14. package/{build → dist}/common/keyCodes.d.ts +0 -0
  15. package/{build → dist}/common/lifecycle.d.ts +0 -0
  16. package/{build → dist}/common/linkedList.d.ts +0 -0
  17. package/{build → dist}/common/platform.d.ts +0 -0
  18. package/dist/index.d.ts +7 -0
  19. package/dist/index.js +1 -0
  20. package/dist/interfaces.d.ts +95 -0
  21. package/{build → dist}/menu/menu.d.ts +3 -1
  22. package/{build → dist}/menu/menuitem.d.ts +3 -4
  23. package/{build → dist}/menubar.d.ts +1 -24
  24. package/dist/titlebar.d.ts +77 -0
  25. package/package.json +23 -16
  26. package/webpack.config.js +37 -0
  27. package/.github/ISSUE_TEMPLATE/issue-report.md +0 -29
  28. package/.vscode/launch.json +0 -49
  29. package/.vscode/tasks.json +0 -34
  30. package/build/browser/browser.js +0 -157
  31. package/build/browser/browser.js.map +0 -1
  32. package/build/browser/event.js +0 -30
  33. package/build/browser/event.js.map +0 -1
  34. package/build/browser/iframe.js +0 -110
  35. package/build/browser/iframe.js.map +0 -1
  36. package/build/browser/keyboardEvent.js +0 -226
  37. package/build/browser/keyboardEvent.js.map +0 -1
  38. package/build/browser/mouseEvent.js +0 -110
  39. package/build/browser/mouseEvent.js.map +0 -1
  40. package/build/common/arrays.js +0 -18
  41. package/build/common/arrays.js.map +0 -1
  42. package/build/common/async.js +0 -95
  43. package/build/common/async.js.map +0 -1
  44. package/build/common/charCode.js +0 -7
  45. package/build/common/charCode.js.map +0 -1
  46. package/build/common/color.js +0 -494
  47. package/build/common/color.js.map +0 -1
  48. package/build/common/dom.js +0 -984
  49. package/build/common/dom.js.map +0 -1
  50. package/build/common/event.js +0 -611
  51. package/build/common/event.js.map +0 -1
  52. package/build/common/iterator.js +0 -164
  53. package/build/common/iterator.js.map +0 -1
  54. package/build/common/keyCodes.js +0 -268
  55. package/build/common/keyCodes.js.map +0 -1
  56. package/build/common/lifecycle.js +0 -63
  57. package/build/common/lifecycle.js.map +0 -1
  58. package/build/common/linkedList.js +0 -139
  59. package/build/common/linkedList.js.map +0 -1
  60. package/build/common/platform.js +0 -115
  61. package/build/common/platform.js.map +0 -1
  62. package/build/index.d.ts +0 -3
  63. package/build/index.js +0 -20
  64. package/build/index.js.map +0 -1
  65. package/build/menu/menu.js +0 -538
  66. package/build/menu/menu.js.map +0 -1
  67. package/build/menu/menuitem.js +0 -339
  68. package/build/menu/menuitem.js.map +0 -1
  69. package/build/menubar.js +0 -608
  70. package/build/menubar.js.map +0 -1
  71. package/build/themebar.d.ts +0 -20
  72. package/build/themebar.js +0 -568
  73. package/build/themebar.js.map +0 -1
  74. package/build/titlebar.d.ts +0 -135
  75. package/build/titlebar.js +0 -453
  76. package/build/titlebar.js.map +0 -1
@@ -1,135 +0,0 @@
1
- import { Color } from './common/color';
2
- import { MenubarOptions } from './menubar';
3
- import { Theme, Themebar } from './themebar';
4
- export interface TitlebarOptions extends MenubarOptions {
5
- /**
6
- * The background color of titlebar.
7
- */
8
- backgroundColor: Color;
9
- /**
10
- * The icon shown on the left side of titlebar.
11
- */
12
- icon?: string;
13
- /**
14
- * Style of the icons of titlebar.
15
- * You can create your custom style using [`Theme`](https://github.com/AlexTorresSk/custom-electron-titlebar/THEMES.md)
16
- */
17
- iconsTheme?: Theme;
18
- /**
19
- * The shadow color of titlebar.
20
- */
21
- shadow?: boolean;
22
- /**
23
- * Define if the minimize window button is displayed.
24
- * *The default is true*
25
- */
26
- minimizable?: boolean;
27
- /**
28
- * Define if the maximize and restore window buttons are displayed.
29
- * *The default is true*
30
- */
31
- maximizable?: boolean;
32
- /**
33
- * Define if the close window button is displayed.
34
- * *The default is true*
35
- */
36
- closeable?: boolean;
37
- /**
38
- * When the close button is clicked, the window is hidden instead of closed.
39
- * *The default is false*
40
- */
41
- hideWhenClickingClose?: boolean;
42
- /**
43
- * Enables or disables the blur option in titlebar.
44
- * *The default is true*
45
- */
46
- unfocusEffect?: boolean;
47
- /**
48
- * Set the order of the elements on the title bar. You can use `inverted`, `first-buttons` or don't add for.
49
- * *The default is normal*
50
- */
51
- order?: "inverted" | "first-buttons";
52
- /**
53
- * Set horizontal alignment of the window title.
54
- * *The default value is center*
55
- */
56
- titleHorizontalAlignment?: "left" | "center" | "right";
57
- /**
58
- * Sets the value for the overflow of the window.
59
- * *The default value is auto*
60
- */
61
- overflow?: "auto" | "hidden" | "visible";
62
- }
63
- export declare class Titlebar extends Themebar {
64
- private titlebar;
65
- private title;
66
- private dragRegion;
67
- private appIcon;
68
- private menubarContainer;
69
- private windowControls;
70
- private maxRestoreControl;
71
- private container;
72
- private resizer;
73
- private isInactive;
74
- private currentWindow;
75
- private _options;
76
- private menubar;
77
- private events;
78
- constructor(options?: TitlebarOptions);
79
- private closeMenu;
80
- private registerListeners;
81
- private removeListeners;
82
- private createTitlebar;
83
- private onBlur;
84
- private onFocus;
85
- private onMenubarVisibilityChanged;
86
- private onMenubarFocusChanged;
87
- private onDidChangeWindowFocus;
88
- private onDidChangeMaximized;
89
- private onDidChangeFullscreen;
90
- private updateStyles;
91
- /**
92
- * get the options of the titlebar
93
- */
94
- get options(): TitlebarOptions;
95
- /**
96
- * Update the background color of the title bar
97
- * @param backgroundColor The color for the background
98
- */
99
- updateBackground(backgroundColor: Color): void;
100
- /**
101
- * Update the item background color of the menubar
102
- * @param itemBGColor The color for the item background
103
- */
104
- updateItemBGColor(itemBGColor: Color): void;
105
- /**
106
- * Update the title of the title bar.
107
- * You can use this method if change the content of `<title>` tag on your html.
108
- * @param title The title of the title bar and document.
109
- */
110
- updateTitle(title?: string): void;
111
- /**
112
- * It method set new icon to title-bar-icon of title-bar.
113
- * @param path path to icon
114
- */
115
- updateIcon(path: string): void;
116
- /**
117
- * Update the default menu or set a new menu.
118
- * @param menu The menu.
119
- */
120
- updateMenu(menu: Electron.Menu): void;
121
- /**
122
- * Update the position of menubar.
123
- * @param menuPosition The position of the menu `left` or `bottom`.
124
- */
125
- updateMenuPosition(menuPosition: "left" | "bottom"): void;
126
- /**
127
- * Horizontal alignment of the title.
128
- * @param side `left`, `center` or `right`.
129
- */
130
- setHorizontalAlignment(side: "left" | "center" | "right"): void;
131
- /**
132
- * Remove the titlebar, menubar and all methods.
133
- */
134
- dispose(): void;
135
- }
package/build/titlebar.js DELETED
@@ -1,453 +0,0 @@
1
- "use strict";
2
- /*--------------------------------------------------------------------------------------------------------
3
- * This file has been modified by @AlexTorresSk (http://github.com/AlexTorresSk)
4
- * to work in custom-electron-titlebar.
5
- *
6
- * The original copy of this file and its respective license are in https://github.com/Microsoft/vscode/
7
- *
8
- * Copyright (c) 2018 Alex Torres
9
- * Licensed under the MIT License. See License in the project root for license information.
10
- *-------------------------------------------------------------------------------------------------------*/
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Titlebar = void 0;
13
- const platform_1 = require("./common/platform");
14
- const color_1 = require("./common/color");
15
- const dom_1 = require("./common/dom");
16
- const menubar_1 = require("./menubar");
17
- const remote = require("@electron/remote");
18
- const themebar_1 = require("./themebar");
19
- const INACTIVE_FOREGROUND_DARK = color_1.Color.fromHex('#222222');
20
- const ACTIVE_FOREGROUND_DARK = color_1.Color.fromHex('#333333');
21
- const INACTIVE_FOREGROUND = color_1.Color.fromHex('#EEEEEE');
22
- const ACTIVE_FOREGROUND = color_1.Color.fromHex('#FFFFFF');
23
- const IS_MAC_BIGSUR_OR_LATER = platform_1.isMacintosh && parseInt(process.getSystemVersion().split(".")[0]) >= 11;
24
- const BOTTOM_TITLEBAR_HEIGHT = '60px';
25
- const TOP_TITLEBAR_HEIGHT_MAC = IS_MAC_BIGSUR_OR_LATER ? '28px' : '22px';
26
- const TOP_TITLEBAR_HEIGHT_WIN = '30px';
27
- const defaultOptions = {
28
- backgroundColor: color_1.Color.fromHex('#444444'),
29
- iconsTheme: themebar_1.Themebar.win,
30
- shadow: false,
31
- menu: remote.Menu.getApplicationMenu(),
32
- minimizable: true,
33
- maximizable: true,
34
- closeable: true,
35
- enableMnemonics: true,
36
- hideWhenClickingClose: false,
37
- unfocusEffect: true,
38
- overflow: "auto",
39
- };
40
- class Titlebar extends themebar_1.Themebar {
41
- constructor(options) {
42
- super();
43
- this.closeMenu = () => {
44
- if (this.menubar) {
45
- this.menubar.blur();
46
- }
47
- };
48
- this.currentWindow = remote.getCurrentWindow();
49
- this._options = Object.assign(Object.assign({}, defaultOptions), options);
50
- this.registerListeners();
51
- this.createTitlebar();
52
- this.updateStyles();
53
- this.registerTheme(this._options.iconsTheme);
54
- window.addEventListener('beforeunload', () => {
55
- this.removeListeners();
56
- });
57
- }
58
- registerListeners() {
59
- this.events = {};
60
- this.events[dom_1.EventType.FOCUS] = () => this.onDidChangeWindowFocus(true);
61
- this.events[dom_1.EventType.BLUR] = () => this.onDidChangeWindowFocus(false);
62
- this.events[dom_1.EventType.MAXIMIZE] = () => this.onDidChangeMaximized(true);
63
- this.events[dom_1.EventType.UNMAXIMIZE] = () => this.onDidChangeMaximized(false);
64
- this.events[dom_1.EventType.ENTER_FULLSCREEN] = () => this.onDidChangeFullscreen(true);
65
- this.events[dom_1.EventType.LEAVE_FULLSCREEN] = () => this.onDidChangeFullscreen(false);
66
- for (const k in this.events) {
67
- this.currentWindow.on(k, this.events[k]);
68
- }
69
- }
70
- // From https://github.com/panjiang/custom-electron-titlebar/commit/825bff6b15e9223c1160208847b4c5010610bcf7
71
- removeListeners() {
72
- for (const k in this.events) {
73
- this.currentWindow.removeListener(k, this.events[k]);
74
- }
75
- this.events = {};
76
- }
77
- createTitlebar() {
78
- // Content container
79
- this.container = (0, dom_1.$)('div.container-after-titlebar');
80
- if (this._options.menuPosition === 'bottom') {
81
- this.container.style.top = BOTTOM_TITLEBAR_HEIGHT;
82
- this.container.style.bottom = '0px';
83
- }
84
- else {
85
- this.container.style.top = platform_1.isMacintosh ? TOP_TITLEBAR_HEIGHT_MAC : TOP_TITLEBAR_HEIGHT_WIN;
86
- this.container.style.bottom = '0px';
87
- }
88
- this.container.style.right = '0';
89
- this.container.style.left = '0';
90
- this.container.style.position = 'absolute';
91
- this.container.style.overflow = this._options.overflow;
92
- while (document.body.firstChild) {
93
- (0, dom_1.append)(this.container, document.body.firstChild);
94
- }
95
- (0, dom_1.append)(document.body, this.container);
96
- document.body.style.overflow = 'hidden';
97
- document.body.style.margin = '0';
98
- // Titlebar
99
- this.titlebar = (0, dom_1.$)('div.titlebar');
100
- (0, dom_1.addClass)(this.titlebar, platform_1.isWindows ? 'cet-windows' : platform_1.isLinux ? 'cet-linux' : 'cet-mac');
101
- if (this._options.order) {
102
- (0, dom_1.addClass)(this.titlebar, this._options.order);
103
- }
104
- if (this._options.shadow) {
105
- this.titlebar.style.boxShadow = `0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12)`;
106
- }
107
- this.dragRegion = (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.titlebar-drag-region'));
108
- // App Icon (Windows/Linux)
109
- if (!platform_1.isMacintosh && this._options.icon) {
110
- this.appIcon = (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.window-appicon'));
111
- this.updateIcon(this._options.icon);
112
- }
113
- // Menubar
114
- this.menubarContainer = (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.menubar'));
115
- this.menubarContainer.setAttribute('role', 'menubar');
116
- if (this._options.menu) {
117
- this.updateMenu(this._options.menu);
118
- this.updateMenuPosition(this._options.menuPosition);
119
- }
120
- // Title
121
- this.title = (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.window-title'));
122
- if (!platform_1.isMacintosh) {
123
- this.title.style.cursor = 'default';
124
- }
125
- if (IS_MAC_BIGSUR_OR_LATER) {
126
- this.title.style.fontWeight = "600";
127
- this.title.style.fontSize = "13px";
128
- }
129
- this.updateTitle();
130
- this.setHorizontalAlignment(this._options.titleHorizontalAlignment);
131
- // Maximize/Restore on doubleclick
132
- if (platform_1.isMacintosh) {
133
- let isMaximized = this.currentWindow.isMaximized();
134
- this._register((0, dom_1.addDisposableListener)(this.titlebar, dom_1.EventType.DBLCLICK, () => {
135
- isMaximized = !isMaximized;
136
- this.onDidChangeMaximized(isMaximized);
137
- }));
138
- }
139
- // Window Controls (Windows/Linux)
140
- if (!platform_1.isMacintosh) {
141
- this.windowControls = (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.window-controls-container'));
142
- // Minimize
143
- const minimizeIconContainer = (0, dom_1.append)(this.windowControls, (0, dom_1.$)('div.window-icon-bg'));
144
- minimizeIconContainer.title = "Minimize";
145
- const minimizeIcon = (0, dom_1.append)(minimizeIconContainer, (0, dom_1.$)('div.window-icon'));
146
- (0, dom_1.addClass)(minimizeIcon, 'window-minimize');
147
- if (!this._options.minimizable) {
148
- (0, dom_1.addClass)(minimizeIconContainer, 'inactive');
149
- }
150
- else {
151
- this._register((0, dom_1.addDisposableListener)(minimizeIcon, dom_1.EventType.CLICK, e => {
152
- this.currentWindow.minimize();
153
- }));
154
- }
155
- // Restore
156
- const restoreIconContainer = (0, dom_1.append)(this.windowControls, (0, dom_1.$)('div.window-icon-bg'));
157
- this.maxRestoreControl = (0, dom_1.append)(restoreIconContainer, (0, dom_1.$)('div.window-icon'));
158
- (0, dom_1.addClass)(this.maxRestoreControl, 'window-max-restore');
159
- if (!this._options.maximizable) {
160
- (0, dom_1.addClass)(restoreIconContainer, 'inactive');
161
- }
162
- else {
163
- this._register((0, dom_1.addDisposableListener)(this.maxRestoreControl, dom_1.EventType.CLICK, e => {
164
- if (this.currentWindow.isMaximized()) {
165
- this.currentWindow.unmaximize();
166
- this.onDidChangeMaximized(false);
167
- }
168
- else {
169
- this.currentWindow.maximize();
170
- this.onDidChangeMaximized(true);
171
- }
172
- }));
173
- }
174
- // Close
175
- const closeIconContainer = (0, dom_1.append)(this.windowControls, (0, dom_1.$)('div.window-icon-bg'));
176
- closeIconContainer.title = "Close";
177
- (0, dom_1.addClass)(closeIconContainer, 'window-close-bg');
178
- const closeIcon = (0, dom_1.append)(closeIconContainer, (0, dom_1.$)('div.window-icon'));
179
- (0, dom_1.addClass)(closeIcon, 'window-close');
180
- if (!this._options.closeable) {
181
- (0, dom_1.addClass)(closeIconContainer, 'inactive');
182
- }
183
- else {
184
- this._register((0, dom_1.addDisposableListener)(closeIcon, dom_1.EventType.CLICK, e => {
185
- if (this._options.hideWhenClickingClose) {
186
- this.currentWindow.hide();
187
- }
188
- else {
189
- this.currentWindow.close();
190
- }
191
- }));
192
- }
193
- // Resizer
194
- this.resizer = {
195
- top: (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.resizer.top')),
196
- left: (0, dom_1.append)(this.titlebar, (0, dom_1.$)('div.resizer.left'))
197
- };
198
- this.onDidChangeMaximized(this.currentWindow.isMaximized());
199
- }
200
- (0, dom_1.prepend)(document.body, this.titlebar);
201
- }
202
- onBlur() {
203
- this.isInactive = true;
204
- this.updateStyles();
205
- }
206
- onFocus() {
207
- this.isInactive = false;
208
- this.updateStyles();
209
- }
210
- onMenubarVisibilityChanged(visible) {
211
- if (platform_1.isWindows || platform_1.isLinux) {
212
- // Hide title when toggling menu bar
213
- if (visible) {
214
- // Hack to fix issue #52522 with layered webkit-app-region elements appearing under cursor
215
- (0, dom_1.hide)(this.dragRegion);
216
- setTimeout(() => (0, dom_1.show)(this.dragRegion), 50);
217
- }
218
- }
219
- }
220
- onMenubarFocusChanged(focused) {
221
- if (platform_1.isWindows || platform_1.isLinux) {
222
- if (focused) {
223
- (0, dom_1.hide)(this.dragRegion);
224
- }
225
- else {
226
- (0, dom_1.show)(this.dragRegion);
227
- }
228
- }
229
- }
230
- onDidChangeWindowFocus(hasFocus) {
231
- if (this.titlebar) {
232
- if (hasFocus) {
233
- (0, dom_1.removeClass)(this.titlebar, 'inactive');
234
- this.onFocus();
235
- }
236
- else {
237
- (0, dom_1.addClass)(this.titlebar, 'inactive');
238
- this.closeMenu();
239
- this.onBlur();
240
- }
241
- }
242
- }
243
- onDidChangeMaximized(maximized) {
244
- if (this.maxRestoreControl) {
245
- if (maximized) {
246
- (0, dom_1.removeClass)(this.maxRestoreControl, 'window-maximize');
247
- this.maxRestoreControl.title = "Restore Down";
248
- (0, dom_1.addClass)(this.maxRestoreControl, 'window-unmaximize');
249
- }
250
- else {
251
- (0, dom_1.removeClass)(this.maxRestoreControl, 'window-unmaximize');
252
- this.maxRestoreControl.title = "Maximize";
253
- (0, dom_1.addClass)(this.maxRestoreControl, 'window-maximize');
254
- }
255
- }
256
- if (this.resizer) {
257
- if (maximized) {
258
- (0, dom_1.hide)(this.resizer.top, this.resizer.left);
259
- }
260
- else {
261
- (0, dom_1.show)(this.resizer.top, this.resizer.left);
262
- }
263
- }
264
- }
265
- onDidChangeFullscreen(fullscreen) {
266
- if (!platform_1.isMacintosh) {
267
- if (fullscreen) {
268
- (0, dom_1.hide)(this.appIcon, this.title, this.windowControls);
269
- }
270
- else {
271
- (0, dom_1.show)(this.appIcon, this.title, this.windowControls);
272
- }
273
- }
274
- }
275
- updateStyles() {
276
- if (this.titlebar) {
277
- if (this.isInactive) {
278
- (0, dom_1.addClass)(this.titlebar, 'inactive');
279
- }
280
- else {
281
- (0, dom_1.removeClass)(this.titlebar, 'inactive');
282
- }
283
- const titleBackground = this.isInactive && this._options.unfocusEffect
284
- ? this._options.backgroundColor.lighten(.45)
285
- : this._options.backgroundColor;
286
- this.titlebar.style.backgroundColor = titleBackground.toString();
287
- let titleForeground;
288
- if (titleBackground.isLighter()) {
289
- (0, dom_1.addClass)(this.titlebar, 'light');
290
- titleForeground = this.isInactive && this._options.unfocusEffect
291
- ? INACTIVE_FOREGROUND_DARK
292
- : ACTIVE_FOREGROUND_DARK;
293
- }
294
- else {
295
- (0, dom_1.removeClass)(this.titlebar, 'light');
296
- titleForeground = this.isInactive && this._options.unfocusEffect
297
- ? INACTIVE_FOREGROUND
298
- : ACTIVE_FOREGROUND;
299
- }
300
- this.titlebar.style.color = titleForeground.toString();
301
- const backgroundColor = this._options.backgroundColor.darken(.16);
302
- const foregroundColor = backgroundColor.isLighter()
303
- ? INACTIVE_FOREGROUND_DARK
304
- : INACTIVE_FOREGROUND;
305
- const bgColor = !this._options.itemBackgroundColor || this._options.itemBackgroundColor.equals(backgroundColor)
306
- ? new color_1.Color(new color_1.RGBA(0, 0, 0, .14))
307
- : this._options.itemBackgroundColor;
308
- const fgColor = bgColor.isLighter() ? ACTIVE_FOREGROUND_DARK : ACTIVE_FOREGROUND;
309
- if (this.menubar) {
310
- this.menubar.setStyles({
311
- backgroundColor: backgroundColor,
312
- foregroundColor: foregroundColor,
313
- selectionBackgroundColor: bgColor,
314
- selectionForegroundColor: fgColor,
315
- separatorColor: foregroundColor
316
- });
317
- }
318
- }
319
- }
320
- /**
321
- * get the options of the titlebar
322
- */
323
- get options() {
324
- return this._options;
325
- }
326
- /**
327
- * Update the background color of the title bar
328
- * @param backgroundColor The color for the background
329
- */
330
- updateBackground(backgroundColor) {
331
- this._options.backgroundColor = backgroundColor;
332
- this.updateStyles();
333
- }
334
- /**
335
- * Update the item background color of the menubar
336
- * @param itemBGColor The color for the item background
337
- */
338
- updateItemBGColor(itemBGColor) {
339
- this._options.itemBackgroundColor = itemBGColor;
340
- this.updateStyles();
341
- }
342
- /**
343
- * Update the title of the title bar.
344
- * You can use this method if change the content of `<title>` tag on your html.
345
- * @param title The title of the title bar and document.
346
- */
347
- updateTitle(title) {
348
- if (this.title) {
349
- if (title) {
350
- document.title = title;
351
- }
352
- else {
353
- title = document.title;
354
- }
355
- this.title.innerText = title;
356
- }
357
- }
358
- /**
359
- * It method set new icon to title-bar-icon of title-bar.
360
- * @param path path to icon
361
- */
362
- updateIcon(path) {
363
- if (path === null || path === '') {
364
- return;
365
- }
366
- if (this.appIcon) {
367
- this.appIcon.style.backgroundImage = `url("${path}")`;
368
- }
369
- }
370
- /**
371
- * Update the default menu or set a new menu.
372
- * @param menu The menu.
373
- */
374
- // Menu enhancements, moved menu to bottom of window-titlebar. (by @MairwunNx) https://github.com/AlexTorresSk/custom-electron-titlebar/pull/9
375
- updateMenu(menu) {
376
- if (!platform_1.isMacintosh) {
377
- if (this.menubar) {
378
- this.menubar.dispose();
379
- if (!menu) {
380
- return;
381
- }
382
- this._options.menu = menu;
383
- }
384
- this.menubar = new menubar_1.Menubar(this.menubarContainer, this._options, this.closeMenu);
385
- this.menubar.setupMenubar();
386
- this._register(this.menubar.onVisibilityChange(e => this.onMenubarVisibilityChanged(e)));
387
- this._register(this.menubar.onFocusStateChange(e => this.onMenubarFocusChanged(e)));
388
- this.updateStyles();
389
- }
390
- else {
391
- remote.Menu.setApplicationMenu(menu);
392
- }
393
- }
394
- /**
395
- * Update the position of menubar.
396
- * @param menuPosition The position of the menu `left` or `bottom`.
397
- */
398
- updateMenuPosition(menuPosition) {
399
- this._options.menuPosition = menuPosition;
400
- if (platform_1.isMacintosh) {
401
- this.titlebar.style.height = this._options.menuPosition && this._options.menuPosition === 'bottom' ? BOTTOM_TITLEBAR_HEIGHT : TOP_TITLEBAR_HEIGHT_MAC;
402
- this.container.style.top = this._options.menuPosition && this._options.menuPosition === 'bottom' ? BOTTOM_TITLEBAR_HEIGHT : TOP_TITLEBAR_HEIGHT_MAC;
403
- }
404
- else {
405
- this.titlebar.style.height = this._options.menuPosition && this._options.menuPosition === 'bottom' ? BOTTOM_TITLEBAR_HEIGHT : TOP_TITLEBAR_HEIGHT_WIN;
406
- this.container.style.top = this._options.menuPosition && this._options.menuPosition === 'bottom' ? BOTTOM_TITLEBAR_HEIGHT : TOP_TITLEBAR_HEIGHT_WIN;
407
- }
408
- this.titlebar.style.webkitFlexWrap = this._options.menuPosition && this._options.menuPosition === 'bottom' ? 'wrap' : null;
409
- if (this._options.menuPosition === 'bottom') {
410
- (0, dom_1.addClass)(this.menubarContainer, 'bottom');
411
- }
412
- else {
413
- (0, dom_1.removeClass)(this.menubarContainer, 'bottom');
414
- }
415
- }
416
- /**
417
- * Horizontal alignment of the title.
418
- * @param side `left`, `center` or `right`.
419
- */
420
- // Add ability to customize title-bar title. (by @MairwunNx) https://github.com/AlexTorresSk/custom-electron-titlebar/pull/8
421
- setHorizontalAlignment(side) {
422
- if (this.title) {
423
- if (side === 'left' || (side === 'right' && this._options.order === 'inverted')) {
424
- this.title.style.marginLeft = '8px';
425
- this.title.style.marginRight = 'auto';
426
- }
427
- if (side === 'right' || (side === 'left' && this._options.order === 'inverted')) {
428
- this.title.style.marginRight = '8px';
429
- this.title.style.marginLeft = 'auto';
430
- }
431
- if (side === 'center' || side === undefined) {
432
- this.title.style.marginRight = 'auto';
433
- this.title.style.marginLeft = 'auto';
434
- }
435
- }
436
- }
437
- /**
438
- * Remove the titlebar, menubar and all methods.
439
- */
440
- dispose() {
441
- if (this.menubar)
442
- this.menubar.dispose();
443
- (0, dom_1.removeNode)(this.titlebar);
444
- while (this.container.firstChild) {
445
- (0, dom_1.append)(document.body, this.container.firstChild);
446
- }
447
- (0, dom_1.removeNode)(this.container);
448
- this.removeListeners();
449
- super.dispose();
450
- }
451
- }
452
- exports.Titlebar = Titlebar;
453
- //# sourceMappingURL=titlebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"titlebar.js","sourceRoot":"","sources":["../src/titlebar.ts"],"names":[],"mappings":";AAAA;;;;;;;;2GAQ2G;;;AAE3G,gDAA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