custom-electron-titlebar 4.2.0 → 4.2.1
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/dist/base/browser/browser.d.ts +26 -0
- package/dist/base/browser/browser.js +317 -0
- package/dist/base/browser/event.d.ts +12 -0
- package/dist/base/browser/event.js +215 -0
- package/dist/base/browser/keyboardEvent.d.ts +38 -0
- package/dist/base/browser/keyboardEvent.js +466 -0
- package/dist/base/browser/mouseEvent.d.ts +61 -0
- package/dist/base/browser/mouseEvent.js +327 -0
- package/dist/base/browser/touch.d.ts +39 -0
- package/dist/base/browser/touch.js +454 -0
- package/dist/base/common/arrays.d.ts +10 -0
- package/dist/base/common/arrays.js +210 -0
- package/dist/base/common/async.d.ts +35 -0
- package/dist/base/common/async.js +280 -0
- package/dist/base/common/charCode.d.ts +405 -0
- package/dist/base/common/charCode.js +9 -0
- package/dist/base/common/color.d.ts +159 -0
- package/dist/base/common/color.js +709 -0
- package/dist/base/common/decorators.d.ts +6 -0
- package/dist/base/common/decorators.js +300 -0
- package/dist/base/common/dom.d.ts +221 -0
- package/dist/base/common/dom.js +1478 -0
- package/dist/base/common/event.d.ts +213 -0
- package/dist/base/common/event.js +804 -0
- package/dist/base/common/iterator.d.ts +69 -0
- package/dist/base/common/iterator.js +381 -0
- package/dist/base/common/keyCodes.d.ts +478 -0
- package/dist/base/common/keyCodes.js +479 -0
- package/dist/base/common/lifecycle.d.ts +17 -0
- package/dist/base/common/lifecycle.js +258 -0
- package/dist/base/common/linkedList.d.ts +17 -0
- package/dist/base/common/linkedList.js +319 -0
- package/dist/base/common/platform.d.ts +33 -0
- package/dist/base/common/platform.js +302 -0
- package/dist/base/common/strings.d.ts +23 -0
- package/dist/base/common/strings.js +273 -0
- package/dist/consts.d.ts +49 -0
- package/dist/consts.js +303 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +211 -0
- package/dist/main/attach-titlebar-to-window.d.ts +3 -0
- package/dist/main/attach-titlebar-to-window.js +207 -0
- package/dist/main/index.d.ts +3 -0
- package/dist/main/index.js +202 -0
- package/dist/main/setup-titlebar.d.ts +2 -0
- package/dist/main/setup-titlebar.js +242 -0
- package/dist/menubar/index.d.ts +86 -0
- package/dist/menubar/index.js +1118 -0
- package/dist/menubar/menu/index.d.ts +46 -0
- package/dist/menubar/menu/index.js +556 -0
- package/dist/menubar/menu/item.d.ts +67 -0
- package/dist/menubar/menu/item.js +575 -0
- package/dist/menubar/menu/separator.d.ts +11 -0
- package/dist/menubar/menu/separator.js +213 -0
- package/dist/menubar/menu/submenu.d.ts +32 -0
- package/dist/menubar/menu/submenu.js +372 -0
- package/dist/menubar/menubar-options.d.ts +55 -0
- package/dist/menubar/menubar-options.js +9 -0
- package/dist/titlebar/index.d.ts +99 -0
- package/dist/titlebar/index.js +663 -0
- package/dist/titlebar/options.d.ts +84 -0
- package/dist/titlebar/options.js +9 -0
- package/dist/titlebar/themebar.d.ts +20 -0
- package/dist/titlebar/themebar.js +267 -0
- package/package.json +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Color } from '../base/common/color';
|
|
2
|
+
import { TitleBarOptions } from './options';
|
|
3
|
+
import { ThemeBar } from './themebar';
|
|
4
|
+
export declare class CustomTitlebar extends ThemeBar {
|
|
5
|
+
private titlebar;
|
|
6
|
+
private dragRegion;
|
|
7
|
+
private icon;
|
|
8
|
+
private menuBarContainer;
|
|
9
|
+
private title;
|
|
10
|
+
private controlsContainer;
|
|
11
|
+
private container;
|
|
12
|
+
private menuBar?;
|
|
13
|
+
private isInactive;
|
|
14
|
+
private controls;
|
|
15
|
+
private resizer;
|
|
16
|
+
private currentOptions;
|
|
17
|
+
private platformIcons;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new TitleBar instance
|
|
20
|
+
* @param options The options for the title bar
|
|
21
|
+
*/
|
|
22
|
+
constructor(options: TitleBarOptions);
|
|
23
|
+
private loadIcons;
|
|
24
|
+
/**
|
|
25
|
+
* Setup the background color of the title bar
|
|
26
|
+
* By default, it will use the meta theme-color or msapplication-TileColor and if it doesn't exist, it will use white
|
|
27
|
+
*/
|
|
28
|
+
private setupBackgroundColor;
|
|
29
|
+
/**
|
|
30
|
+
* Render the icon of the title bar, if is mac, it will not render
|
|
31
|
+
* By default, it will use the first icon found in the head of the document
|
|
32
|
+
*/
|
|
33
|
+
private createIcon;
|
|
34
|
+
private setIconSize;
|
|
35
|
+
private setupMenubar;
|
|
36
|
+
private setupTitle;
|
|
37
|
+
private createControlButton;
|
|
38
|
+
private setupWindowControls;
|
|
39
|
+
private setupContainer;
|
|
40
|
+
private setupTitleBar;
|
|
41
|
+
private loadEvents;
|
|
42
|
+
private closeMenu;
|
|
43
|
+
private onBlur;
|
|
44
|
+
private onFocus;
|
|
45
|
+
private onMenuBarVisibilityChanged;
|
|
46
|
+
private onMenuBarFocusChanged;
|
|
47
|
+
private onDidChangeMaximized;
|
|
48
|
+
private updateMenu;
|
|
49
|
+
private updateStyles;
|
|
50
|
+
/**
|
|
51
|
+
* Update title bar styles based on focus state.
|
|
52
|
+
* @param hasFocus focus state of the window
|
|
53
|
+
*/
|
|
54
|
+
onWindowFocus(focus: boolean): void;
|
|
55
|
+
/**
|
|
56
|
+
* Update the full screen state and hide or show the title bar.
|
|
57
|
+
* @param fullscreen Fullscreen state of the window
|
|
58
|
+
*/
|
|
59
|
+
onWindowFullScreen(fullscreen: boolean): void;
|
|
60
|
+
/**
|
|
61
|
+
* Update the title of the title bar.
|
|
62
|
+
* You can use this method if change the content of `<title>` tag on your html.
|
|
63
|
+
* @param title The title of the title bar and document.
|
|
64
|
+
*/
|
|
65
|
+
updateTitle(title: string): this;
|
|
66
|
+
/**
|
|
67
|
+
* It method set new icon to title-bar-icon of title-bar.
|
|
68
|
+
* @param path path to icon
|
|
69
|
+
*/
|
|
70
|
+
updateIcon(path: string): this;
|
|
71
|
+
/**
|
|
72
|
+
* Horizontal alignment of the title.
|
|
73
|
+
* @param side `left`, `center` or `right`.
|
|
74
|
+
*/
|
|
75
|
+
updateTitleAlignment(side: 'left' | 'center' | 'right'): this;
|
|
76
|
+
/**
|
|
77
|
+
* Update the background color of the title bar
|
|
78
|
+
* @param backgroundColor The color for the background
|
|
79
|
+
*/
|
|
80
|
+
updateBackground(backgroundColor: Color): this;
|
|
81
|
+
/**
|
|
82
|
+
* Update the item background color of the menubar
|
|
83
|
+
* @param itemBGColor The color for the item background
|
|
84
|
+
*/
|
|
85
|
+
updateItemBGColor(itemBGColor: Color): this;
|
|
86
|
+
/**
|
|
87
|
+
* Update the menu from Menu.getApplicationMenu()
|
|
88
|
+
*/
|
|
89
|
+
refreshMenu(): Promise<this>;
|
|
90
|
+
/**
|
|
91
|
+
* Update the position of menubar.
|
|
92
|
+
* @param menuPosition The position of the menu `left` or `bottom`.
|
|
93
|
+
*/
|
|
94
|
+
updateMenuPosition(menuPosition: 'left' | 'bottom'): this;
|
|
95
|
+
/**
|
|
96
|
+
* Remove the titlebar, menubar and all methods.
|
|
97
|
+
*/
|
|
98
|
+
dispose(): void;
|
|
99
|
+
}
|