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.
Files changed (65) hide show
  1. package/dist/base/browser/browser.d.ts +26 -0
  2. package/dist/base/browser/browser.js +317 -0
  3. package/dist/base/browser/event.d.ts +12 -0
  4. package/dist/base/browser/event.js +215 -0
  5. package/dist/base/browser/keyboardEvent.d.ts +38 -0
  6. package/dist/base/browser/keyboardEvent.js +466 -0
  7. package/dist/base/browser/mouseEvent.d.ts +61 -0
  8. package/dist/base/browser/mouseEvent.js +327 -0
  9. package/dist/base/browser/touch.d.ts +39 -0
  10. package/dist/base/browser/touch.js +454 -0
  11. package/dist/base/common/arrays.d.ts +10 -0
  12. package/dist/base/common/arrays.js +210 -0
  13. package/dist/base/common/async.d.ts +35 -0
  14. package/dist/base/common/async.js +280 -0
  15. package/dist/base/common/charCode.d.ts +405 -0
  16. package/dist/base/common/charCode.js +9 -0
  17. package/dist/base/common/color.d.ts +159 -0
  18. package/dist/base/common/color.js +709 -0
  19. package/dist/base/common/decorators.d.ts +6 -0
  20. package/dist/base/common/decorators.js +300 -0
  21. package/dist/base/common/dom.d.ts +221 -0
  22. package/dist/base/common/dom.js +1478 -0
  23. package/dist/base/common/event.d.ts +213 -0
  24. package/dist/base/common/event.js +804 -0
  25. package/dist/base/common/iterator.d.ts +69 -0
  26. package/dist/base/common/iterator.js +381 -0
  27. package/dist/base/common/keyCodes.d.ts +478 -0
  28. package/dist/base/common/keyCodes.js +479 -0
  29. package/dist/base/common/lifecycle.d.ts +17 -0
  30. package/dist/base/common/lifecycle.js +258 -0
  31. package/dist/base/common/linkedList.d.ts +17 -0
  32. package/dist/base/common/linkedList.js +319 -0
  33. package/dist/base/common/platform.d.ts +33 -0
  34. package/dist/base/common/platform.js +302 -0
  35. package/dist/base/common/strings.d.ts +23 -0
  36. package/dist/base/common/strings.js +273 -0
  37. package/dist/consts.d.ts +49 -0
  38. package/dist/consts.js +303 -0
  39. package/dist/index.d.ts +3 -0
  40. package/dist/index.js +211 -0
  41. package/dist/main/attach-titlebar-to-window.d.ts +3 -0
  42. package/dist/main/attach-titlebar-to-window.js +207 -0
  43. package/dist/main/index.d.ts +3 -0
  44. package/dist/main/index.js +202 -0
  45. package/dist/main/setup-titlebar.d.ts +2 -0
  46. package/dist/main/setup-titlebar.js +242 -0
  47. package/dist/menubar/index.d.ts +86 -0
  48. package/dist/menubar/index.js +1118 -0
  49. package/dist/menubar/menu/index.d.ts +46 -0
  50. package/dist/menubar/menu/index.js +556 -0
  51. package/dist/menubar/menu/item.d.ts +67 -0
  52. package/dist/menubar/menu/item.js +575 -0
  53. package/dist/menubar/menu/separator.d.ts +11 -0
  54. package/dist/menubar/menu/separator.js +213 -0
  55. package/dist/menubar/menu/submenu.d.ts +32 -0
  56. package/dist/menubar/menu/submenu.js +372 -0
  57. package/dist/menubar/menubar-options.d.ts +55 -0
  58. package/dist/menubar/menubar-options.js +9 -0
  59. package/dist/titlebar/index.d.ts +99 -0
  60. package/dist/titlebar/index.js +663 -0
  61. package/dist/titlebar/options.d.ts +84 -0
  62. package/dist/titlebar/options.js +9 -0
  63. package/dist/titlebar/themebar.d.ts +20 -0
  64. package/dist/titlebar/themebar.js +267 -0
  65. 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
+ }