custom-electron-titlebar 4.2.7 → 4.2.8
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/README.md +8 -8
- package/base/browser/keyboardEvent.js +0 -2
- package/base/common/charCode.d.ts +180 -180
- package/base/common/dom.js +0 -2
- package/base/common/iterator.d.ts +1 -1
- package/base/common/iterator.js +0 -1
- package/base/common/keyCodes.d.ts +18 -18
- package/base/common/keyCodes.js +0 -2
- package/menubar/index.js +3 -5
- package/menubar/menu/index.js +0 -1
- package/package.json +23 -23
- package/titlebar/index.d.ts +1 -0
- package/titlebar/index.js +14 -7
- package/titlebar/options.d.ts +5 -0
package/README.md
CHANGED
|
@@ -9,21 +9,21 @@ This project is a typescript library for electron that allows you to configure a
|
|
|
9
9
|
|
|
10
10
|
[📄 Documentation](https://github.com/AlexTorresDev/custom-electron-titlebar/wiki)
|
|
11
11
|
|
|
12
|
-
Standard Title Bar
|
|
12
|
+
### Standard Title Bar
|
|
13
13
|
|
|
14
|
-

|
|
15
15
|
|
|
16
|
-
Bottom Menu Bar
|
|
16
|
+
### Bottom Menu Bar
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
|
-
Menu
|
|
20
|
+
### Menu
|
|
21
21
|
|
|
22
|
-

|
|
23
23
|
|
|
24
|
-
Custom color
|
|
24
|
+
### Custom color
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
28
|
# 📦 Installing
|
|
29
29
|
You can install this package with `npm`, `pnpm` or `yarn`.
|
|
@@ -174,7 +174,6 @@ const INVERSE_KEY_CODE_MAP = new Array(112 /* KeyCode.MAX_VALUE */);
|
|
|
174
174
|
define(92, 57 /* KeyCode.Meta */);
|
|
175
175
|
}
|
|
176
176
|
})();
|
|
177
|
-
|
|
178
177
|
function extractKeyCode(e) {
|
|
179
178
|
if (e.charCode) {
|
|
180
179
|
// "keypress" events mostly
|
|
@@ -183,7 +182,6 @@ function extractKeyCode(e) {
|
|
|
183
182
|
}
|
|
184
183
|
return _get__("KEY_CODE_MAP")[e.keyCode] || 0 /* KeyCode.Unknown */;
|
|
185
184
|
}
|
|
186
|
-
|
|
187
185
|
function getCodeForKeyCode(keyCode) {
|
|
188
186
|
return _get__("INVERSE_KEY_CODE_MAP")[keyCode];
|
|
189
187
|
}
|
|
@@ -211,191 +211,191 @@ export declare const enum CharCode {
|
|
|
211
211
|
* The `~` character.
|
|
212
212
|
*/
|
|
213
213
|
Tilde = 126,
|
|
214
|
-
U_Combining_Grave_Accent = 768
|
|
215
|
-
U_Combining_Acute_Accent = 769
|
|
216
|
-
U_Combining_Circumflex_Accent = 770
|
|
217
|
-
U_Combining_Tilde = 771
|
|
218
|
-
U_Combining_Macron = 772
|
|
219
|
-
U_Combining_Overline = 773
|
|
220
|
-
U_Combining_Breve = 774
|
|
221
|
-
U_Combining_Dot_Above = 775
|
|
222
|
-
U_Combining_Diaeresis = 776
|
|
223
|
-
U_Combining_Hook_Above = 777
|
|
224
|
-
U_Combining_Ring_Above = 778
|
|
225
|
-
U_Combining_Double_Acute_Accent = 779
|
|
226
|
-
U_Combining_Caron = 780
|
|
227
|
-
U_Combining_Vertical_Line_Above = 781
|
|
228
|
-
U_Combining_Double_Vertical_Line_Above = 782
|
|
229
|
-
U_Combining_Double_Grave_Accent = 783
|
|
230
|
-
U_Combining_Candrabindu = 784
|
|
231
|
-
U_Combining_Inverted_Breve = 785
|
|
232
|
-
U_Combining_Turned_Comma_Above = 786
|
|
233
|
-
U_Combining_Comma_Above = 787
|
|
234
|
-
U_Combining_Reversed_Comma_Above = 788
|
|
235
|
-
U_Combining_Comma_Above_Right = 789
|
|
236
|
-
U_Combining_Grave_Accent_Below = 790
|
|
237
|
-
U_Combining_Acute_Accent_Below = 791
|
|
238
|
-
U_Combining_Left_Tack_Below = 792
|
|
239
|
-
U_Combining_Right_Tack_Below = 793
|
|
240
|
-
U_Combining_Left_Angle_Above = 794
|
|
241
|
-
U_Combining_Horn = 795
|
|
242
|
-
U_Combining_Left_Half_Ring_Below = 796
|
|
243
|
-
U_Combining_Up_Tack_Below = 797
|
|
244
|
-
U_Combining_Down_Tack_Below = 798
|
|
245
|
-
U_Combining_Plus_Sign_Below = 799
|
|
246
|
-
U_Combining_Minus_Sign_Below = 800
|
|
247
|
-
U_Combining_Palatalized_Hook_Below = 801
|
|
248
|
-
U_Combining_Retroflex_Hook_Below = 802
|
|
249
|
-
U_Combining_Dot_Below = 803
|
|
250
|
-
U_Combining_Diaeresis_Below = 804
|
|
251
|
-
U_Combining_Ring_Below = 805
|
|
252
|
-
U_Combining_Comma_Below = 806
|
|
253
|
-
U_Combining_Cedilla = 807
|
|
254
|
-
U_Combining_Ogonek = 808
|
|
255
|
-
U_Combining_Vertical_Line_Below = 809
|
|
256
|
-
U_Combining_Bridge_Below = 810
|
|
257
|
-
U_Combining_Inverted_Double_Arch_Below = 811
|
|
258
|
-
U_Combining_Caron_Below = 812
|
|
259
|
-
U_Combining_Circumflex_Accent_Below = 813
|
|
260
|
-
U_Combining_Breve_Below = 814
|
|
261
|
-
U_Combining_Inverted_Breve_Below = 815
|
|
262
|
-
U_Combining_Tilde_Below = 816
|
|
263
|
-
U_Combining_Macron_Below = 817
|
|
264
|
-
U_Combining_Low_Line = 818
|
|
265
|
-
U_Combining_Double_Low_Line = 819
|
|
266
|
-
U_Combining_Tilde_Overlay = 820
|
|
267
|
-
U_Combining_Short_Stroke_Overlay = 821
|
|
268
|
-
U_Combining_Long_Stroke_Overlay = 822
|
|
269
|
-
U_Combining_Short_Solidus_Overlay = 823
|
|
270
|
-
U_Combining_Long_Solidus_Overlay = 824
|
|
271
|
-
U_Combining_Right_Half_Ring_Below = 825
|
|
272
|
-
U_Combining_Inverted_Bridge_Below = 826
|
|
273
|
-
U_Combining_Square_Below = 827
|
|
274
|
-
U_Combining_Seagull_Below = 828
|
|
275
|
-
U_Combining_X_Above = 829
|
|
276
|
-
U_Combining_Vertical_Tilde = 830
|
|
277
|
-
U_Combining_Double_Overline = 831
|
|
278
|
-
U_Combining_Grave_Tone_Mark = 832
|
|
279
|
-
U_Combining_Acute_Tone_Mark = 833
|
|
280
|
-
U_Combining_Greek_Perispomeni = 834
|
|
281
|
-
U_Combining_Greek_Koronis = 835
|
|
282
|
-
U_Combining_Greek_Dialytika_Tonos = 836
|
|
283
|
-
U_Combining_Greek_Ypogegrammeni = 837
|
|
284
|
-
U_Combining_Bridge_Above = 838
|
|
285
|
-
U_Combining_Equals_Sign_Below = 839
|
|
286
|
-
U_Combining_Double_Vertical_Line_Below = 840
|
|
287
|
-
U_Combining_Left_Angle_Below = 841
|
|
288
|
-
U_Combining_Not_Tilde_Above = 842
|
|
289
|
-
U_Combining_Homothetic_Above = 843
|
|
290
|
-
U_Combining_Almost_Equal_To_Above = 844
|
|
291
|
-
U_Combining_Left_Right_Arrow_Below = 845
|
|
292
|
-
U_Combining_Upwards_Arrow_Below = 846
|
|
293
|
-
U_Combining_Grapheme_Joiner = 847
|
|
294
|
-
U_Combining_Right_Arrowhead_Above = 848
|
|
295
|
-
U_Combining_Left_Half_Ring_Above = 849
|
|
296
|
-
U_Combining_Fermata = 850
|
|
297
|
-
U_Combining_X_Below = 851
|
|
298
|
-
U_Combining_Left_Arrowhead_Below = 852
|
|
299
|
-
U_Combining_Right_Arrowhead_Below = 853
|
|
300
|
-
U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below = 854
|
|
301
|
-
U_Combining_Right_Half_Ring_Above = 855
|
|
302
|
-
U_Combining_Dot_Above_Right = 856
|
|
303
|
-
U_Combining_Asterisk_Below = 857
|
|
304
|
-
U_Combining_Double_Ring_Below = 858
|
|
305
|
-
U_Combining_Zigzag_Above = 859
|
|
306
|
-
U_Combining_Double_Breve_Below = 860
|
|
307
|
-
U_Combining_Double_Breve = 861
|
|
308
|
-
U_Combining_Double_Macron = 862
|
|
309
|
-
U_Combining_Double_Macron_Below = 863
|
|
310
|
-
U_Combining_Double_Tilde = 864
|
|
311
|
-
U_Combining_Double_Inverted_Breve = 865
|
|
312
|
-
U_Combining_Double_Rightwards_Arrow_Below = 866
|
|
313
|
-
U_Combining_Latin_Small_Letter_A = 867
|
|
314
|
-
U_Combining_Latin_Small_Letter_E = 868
|
|
315
|
-
U_Combining_Latin_Small_Letter_I = 869
|
|
316
|
-
U_Combining_Latin_Small_Letter_O = 870
|
|
317
|
-
U_Combining_Latin_Small_Letter_U = 871
|
|
318
|
-
U_Combining_Latin_Small_Letter_C = 872
|
|
319
|
-
U_Combining_Latin_Small_Letter_D = 873
|
|
320
|
-
U_Combining_Latin_Small_Letter_H = 874
|
|
321
|
-
U_Combining_Latin_Small_Letter_M = 875
|
|
322
|
-
U_Combining_Latin_Small_Letter_R = 876
|
|
323
|
-
U_Combining_Latin_Small_Letter_T = 877
|
|
324
|
-
U_Combining_Latin_Small_Letter_V = 878
|
|
325
|
-
U_Combining_Latin_Small_Letter_X = 879
|
|
214
|
+
U_Combining_Grave_Accent = 768,// U+0300 Combining Grave Accent
|
|
215
|
+
U_Combining_Acute_Accent = 769,// U+0301 Combining Acute Accent
|
|
216
|
+
U_Combining_Circumflex_Accent = 770,// U+0302 Combining Circumflex Accent
|
|
217
|
+
U_Combining_Tilde = 771,// U+0303 Combining Tilde
|
|
218
|
+
U_Combining_Macron = 772,// U+0304 Combining Macron
|
|
219
|
+
U_Combining_Overline = 773,// U+0305 Combining Overline
|
|
220
|
+
U_Combining_Breve = 774,// U+0306 Combining Breve
|
|
221
|
+
U_Combining_Dot_Above = 775,// U+0307 Combining Dot Above
|
|
222
|
+
U_Combining_Diaeresis = 776,// U+0308 Combining Diaeresis
|
|
223
|
+
U_Combining_Hook_Above = 777,// U+0309 Combining Hook Above
|
|
224
|
+
U_Combining_Ring_Above = 778,// U+030A Combining Ring Above
|
|
225
|
+
U_Combining_Double_Acute_Accent = 779,// U+030B Combining Double Acute Accent
|
|
226
|
+
U_Combining_Caron = 780,// U+030C Combining Caron
|
|
227
|
+
U_Combining_Vertical_Line_Above = 781,// U+030D Combining Vertical Line Above
|
|
228
|
+
U_Combining_Double_Vertical_Line_Above = 782,// U+030E Combining Double Vertical Line Above
|
|
229
|
+
U_Combining_Double_Grave_Accent = 783,// U+030F Combining Double Grave Accent
|
|
230
|
+
U_Combining_Candrabindu = 784,// U+0310 Combining Candrabindu
|
|
231
|
+
U_Combining_Inverted_Breve = 785,// U+0311 Combining Inverted Breve
|
|
232
|
+
U_Combining_Turned_Comma_Above = 786,// U+0312 Combining Turned Comma Above
|
|
233
|
+
U_Combining_Comma_Above = 787,// U+0313 Combining Comma Above
|
|
234
|
+
U_Combining_Reversed_Comma_Above = 788,// U+0314 Combining Reversed Comma Above
|
|
235
|
+
U_Combining_Comma_Above_Right = 789,// U+0315 Combining Comma Above Right
|
|
236
|
+
U_Combining_Grave_Accent_Below = 790,// U+0316 Combining Grave Accent Below
|
|
237
|
+
U_Combining_Acute_Accent_Below = 791,// U+0317 Combining Acute Accent Below
|
|
238
|
+
U_Combining_Left_Tack_Below = 792,// U+0318 Combining Left Tack Below
|
|
239
|
+
U_Combining_Right_Tack_Below = 793,// U+0319 Combining Right Tack Below
|
|
240
|
+
U_Combining_Left_Angle_Above = 794,// U+031A Combining Left Angle Above
|
|
241
|
+
U_Combining_Horn = 795,// U+031B Combining Horn
|
|
242
|
+
U_Combining_Left_Half_Ring_Below = 796,// U+031C Combining Left Half Ring Below
|
|
243
|
+
U_Combining_Up_Tack_Below = 797,// U+031D Combining Up Tack Below
|
|
244
|
+
U_Combining_Down_Tack_Below = 798,// U+031E Combining Down Tack Below
|
|
245
|
+
U_Combining_Plus_Sign_Below = 799,// U+031F Combining Plus Sign Below
|
|
246
|
+
U_Combining_Minus_Sign_Below = 800,// U+0320 Combining Minus Sign Below
|
|
247
|
+
U_Combining_Palatalized_Hook_Below = 801,// U+0321 Combining Palatalized Hook Below
|
|
248
|
+
U_Combining_Retroflex_Hook_Below = 802,// U+0322 Combining Retroflex Hook Below
|
|
249
|
+
U_Combining_Dot_Below = 803,// U+0323 Combining Dot Below
|
|
250
|
+
U_Combining_Diaeresis_Below = 804,// U+0324 Combining Diaeresis Below
|
|
251
|
+
U_Combining_Ring_Below = 805,// U+0325 Combining Ring Below
|
|
252
|
+
U_Combining_Comma_Below = 806,// U+0326 Combining Comma Below
|
|
253
|
+
U_Combining_Cedilla = 807,// U+0327 Combining Cedilla
|
|
254
|
+
U_Combining_Ogonek = 808,// U+0328 Combining Ogonek
|
|
255
|
+
U_Combining_Vertical_Line_Below = 809,// U+0329 Combining Vertical Line Below
|
|
256
|
+
U_Combining_Bridge_Below = 810,// U+032A Combining Bridge Below
|
|
257
|
+
U_Combining_Inverted_Double_Arch_Below = 811,// U+032B Combining Inverted Double Arch Below
|
|
258
|
+
U_Combining_Caron_Below = 812,// U+032C Combining Caron Below
|
|
259
|
+
U_Combining_Circumflex_Accent_Below = 813,// U+032D Combining Circumflex Accent Below
|
|
260
|
+
U_Combining_Breve_Below = 814,// U+032E Combining Breve Below
|
|
261
|
+
U_Combining_Inverted_Breve_Below = 815,// U+032F Combining Inverted Breve Below
|
|
262
|
+
U_Combining_Tilde_Below = 816,// U+0330 Combining Tilde Below
|
|
263
|
+
U_Combining_Macron_Below = 817,// U+0331 Combining Macron Below
|
|
264
|
+
U_Combining_Low_Line = 818,// U+0332 Combining Low Line
|
|
265
|
+
U_Combining_Double_Low_Line = 819,// U+0333 Combining Double Low Line
|
|
266
|
+
U_Combining_Tilde_Overlay = 820,// U+0334 Combining Tilde Overlay
|
|
267
|
+
U_Combining_Short_Stroke_Overlay = 821,// U+0335 Combining Short Stroke Overlay
|
|
268
|
+
U_Combining_Long_Stroke_Overlay = 822,// U+0336 Combining Long Stroke Overlay
|
|
269
|
+
U_Combining_Short_Solidus_Overlay = 823,// U+0337 Combining Short Solidus Overlay
|
|
270
|
+
U_Combining_Long_Solidus_Overlay = 824,// U+0338 Combining Long Solidus Overlay
|
|
271
|
+
U_Combining_Right_Half_Ring_Below = 825,// U+0339 Combining Right Half Ring Below
|
|
272
|
+
U_Combining_Inverted_Bridge_Below = 826,// U+033A Combining Inverted Bridge Below
|
|
273
|
+
U_Combining_Square_Below = 827,// U+033B Combining Square Below
|
|
274
|
+
U_Combining_Seagull_Below = 828,// U+033C Combining Seagull Below
|
|
275
|
+
U_Combining_X_Above = 829,// U+033D Combining X Above
|
|
276
|
+
U_Combining_Vertical_Tilde = 830,// U+033E Combining Vertical Tilde
|
|
277
|
+
U_Combining_Double_Overline = 831,// U+033F Combining Double Overline
|
|
278
|
+
U_Combining_Grave_Tone_Mark = 832,// U+0340 Combining Grave Tone Mark
|
|
279
|
+
U_Combining_Acute_Tone_Mark = 833,// U+0341 Combining Acute Tone Mark
|
|
280
|
+
U_Combining_Greek_Perispomeni = 834,// U+0342 Combining Greek Perispomeni
|
|
281
|
+
U_Combining_Greek_Koronis = 835,// U+0343 Combining Greek Koronis
|
|
282
|
+
U_Combining_Greek_Dialytika_Tonos = 836,// U+0344 Combining Greek Dialytika Tonos
|
|
283
|
+
U_Combining_Greek_Ypogegrammeni = 837,// U+0345 Combining Greek Ypogegrammeni
|
|
284
|
+
U_Combining_Bridge_Above = 838,// U+0346 Combining Bridge Above
|
|
285
|
+
U_Combining_Equals_Sign_Below = 839,// U+0347 Combining Equals Sign Below
|
|
286
|
+
U_Combining_Double_Vertical_Line_Below = 840,// U+0348 Combining Double Vertical Line Below
|
|
287
|
+
U_Combining_Left_Angle_Below = 841,// U+0349 Combining Left Angle Below
|
|
288
|
+
U_Combining_Not_Tilde_Above = 842,// U+034A Combining Not Tilde Above
|
|
289
|
+
U_Combining_Homothetic_Above = 843,// U+034B Combining Homothetic Above
|
|
290
|
+
U_Combining_Almost_Equal_To_Above = 844,// U+034C Combining Almost Equal To Above
|
|
291
|
+
U_Combining_Left_Right_Arrow_Below = 845,// U+034D Combining Left Right Arrow Below
|
|
292
|
+
U_Combining_Upwards_Arrow_Below = 846,// U+034E Combining Upwards Arrow Below
|
|
293
|
+
U_Combining_Grapheme_Joiner = 847,// U+034F Combining Grapheme Joiner
|
|
294
|
+
U_Combining_Right_Arrowhead_Above = 848,// U+0350 Combining Right Arrowhead Above
|
|
295
|
+
U_Combining_Left_Half_Ring_Above = 849,// U+0351 Combining Left Half Ring Above
|
|
296
|
+
U_Combining_Fermata = 850,// U+0352 Combining Fermata
|
|
297
|
+
U_Combining_X_Below = 851,// U+0353 Combining X Below
|
|
298
|
+
U_Combining_Left_Arrowhead_Below = 852,// U+0354 Combining Left Arrowhead Below
|
|
299
|
+
U_Combining_Right_Arrowhead_Below = 853,// U+0355 Combining Right Arrowhead Below
|
|
300
|
+
U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below = 854,// U+0356 Combining Right Arrowhead And Up Arrowhead Below
|
|
301
|
+
U_Combining_Right_Half_Ring_Above = 855,// U+0357 Combining Right Half Ring Above
|
|
302
|
+
U_Combining_Dot_Above_Right = 856,// U+0358 Combining Dot Above Right
|
|
303
|
+
U_Combining_Asterisk_Below = 857,// U+0359 Combining Asterisk Below
|
|
304
|
+
U_Combining_Double_Ring_Below = 858,// U+035A Combining Double Ring Below
|
|
305
|
+
U_Combining_Zigzag_Above = 859,// U+035B Combining Zigzag Above
|
|
306
|
+
U_Combining_Double_Breve_Below = 860,// U+035C Combining Double Breve Below
|
|
307
|
+
U_Combining_Double_Breve = 861,// U+035D Combining Double Breve
|
|
308
|
+
U_Combining_Double_Macron = 862,// U+035E Combining Double Macron
|
|
309
|
+
U_Combining_Double_Macron_Below = 863,// U+035F Combining Double Macron Below
|
|
310
|
+
U_Combining_Double_Tilde = 864,// U+0360 Combining Double Tilde
|
|
311
|
+
U_Combining_Double_Inverted_Breve = 865,// U+0361 Combining Double Inverted Breve
|
|
312
|
+
U_Combining_Double_Rightwards_Arrow_Below = 866,// U+0362 Combining Double Rightwards Arrow Below
|
|
313
|
+
U_Combining_Latin_Small_Letter_A = 867,// U+0363 Combining Latin Small Letter A
|
|
314
|
+
U_Combining_Latin_Small_Letter_E = 868,// U+0364 Combining Latin Small Letter E
|
|
315
|
+
U_Combining_Latin_Small_Letter_I = 869,// U+0365 Combining Latin Small Letter I
|
|
316
|
+
U_Combining_Latin_Small_Letter_O = 870,// U+0366 Combining Latin Small Letter O
|
|
317
|
+
U_Combining_Latin_Small_Letter_U = 871,// U+0367 Combining Latin Small Letter U
|
|
318
|
+
U_Combining_Latin_Small_Letter_C = 872,// U+0368 Combining Latin Small Letter C
|
|
319
|
+
U_Combining_Latin_Small_Letter_D = 873,// U+0369 Combining Latin Small Letter D
|
|
320
|
+
U_Combining_Latin_Small_Letter_H = 874,// U+036A Combining Latin Small Letter H
|
|
321
|
+
U_Combining_Latin_Small_Letter_M = 875,// U+036B Combining Latin Small Letter M
|
|
322
|
+
U_Combining_Latin_Small_Letter_R = 876,// U+036C Combining Latin Small Letter R
|
|
323
|
+
U_Combining_Latin_Small_Letter_T = 877,// U+036D Combining Latin Small Letter T
|
|
324
|
+
U_Combining_Latin_Small_Letter_V = 878,// U+036E Combining Latin Small Letter V
|
|
325
|
+
U_Combining_Latin_Small_Letter_X = 879,// U+036F Combining Latin Small Letter X
|
|
326
326
|
/**
|
|
327
327
|
* Unicode Character 'LINE SEPARATOR' (U+2028)
|
|
328
328
|
* http://www.fileformat.info/info/unicode/char/2028/index.htm
|
|
329
329
|
*/
|
|
330
330
|
LINE_SEPARATOR_2028 = 8232,
|
|
331
|
-
U_CIRCUMFLEX = 94
|
|
332
|
-
U_GRAVE_ACCENT = 96
|
|
333
|
-
U_DIAERESIS = 168
|
|
334
|
-
U_MACRON = 175
|
|
335
|
-
U_ACUTE_ACCENT = 180
|
|
336
|
-
U_CEDILLA = 184
|
|
337
|
-
U_MODIFIER_LETTER_LEFT_ARROWHEAD = 706
|
|
338
|
-
U_MODIFIER_LETTER_RIGHT_ARROWHEAD = 707
|
|
339
|
-
U_MODIFIER_LETTER_UP_ARROWHEAD = 708
|
|
340
|
-
U_MODIFIER_LETTER_DOWN_ARROWHEAD = 709
|
|
341
|
-
U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING = 722
|
|
342
|
-
U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING = 723
|
|
343
|
-
U_MODIFIER_LETTER_UP_TACK = 724
|
|
344
|
-
U_MODIFIER_LETTER_DOWN_TACK = 725
|
|
345
|
-
U_MODIFIER_LETTER_PLUS_SIGN = 726
|
|
346
|
-
U_MODIFIER_LETTER_MINUS_SIGN = 727
|
|
347
|
-
U_BREVE = 728
|
|
348
|
-
U_DOT_ABOVE = 729
|
|
349
|
-
U_RING_ABOVE = 730
|
|
350
|
-
U_OGONEK = 731
|
|
351
|
-
U_SMALL_TILDE = 732
|
|
352
|
-
U_DOUBLE_ACUTE_ACCENT = 733
|
|
353
|
-
U_MODIFIER_LETTER_RHOTIC_HOOK = 734
|
|
354
|
-
U_MODIFIER_LETTER_CROSS_ACCENT = 735
|
|
355
|
-
U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR = 741
|
|
356
|
-
U_MODIFIER_LETTER_HIGH_TONE_BAR = 742
|
|
357
|
-
U_MODIFIER_LETTER_MID_TONE_BAR = 743
|
|
358
|
-
U_MODIFIER_LETTER_LOW_TONE_BAR = 744
|
|
359
|
-
U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR = 745
|
|
360
|
-
U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK = 746
|
|
361
|
-
U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK = 747
|
|
362
|
-
U_MODIFIER_LETTER_UNASPIRATED = 749
|
|
363
|
-
U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD = 751
|
|
364
|
-
U_MODIFIER_LETTER_LOW_UP_ARROWHEAD = 752
|
|
365
|
-
U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD = 753
|
|
366
|
-
U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD = 754
|
|
367
|
-
U_MODIFIER_LETTER_LOW_RING = 755
|
|
368
|
-
U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT = 756
|
|
369
|
-
U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT = 757
|
|
370
|
-
U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT = 758
|
|
371
|
-
U_MODIFIER_LETTER_LOW_TILDE = 759
|
|
372
|
-
U_MODIFIER_LETTER_RAISED_COLON = 760
|
|
373
|
-
U_MODIFIER_LETTER_BEGIN_HIGH_TONE = 761
|
|
374
|
-
U_MODIFIER_LETTER_END_HIGH_TONE = 762
|
|
375
|
-
U_MODIFIER_LETTER_BEGIN_LOW_TONE = 763
|
|
376
|
-
U_MODIFIER_LETTER_END_LOW_TONE = 764
|
|
377
|
-
U_MODIFIER_LETTER_SHELF = 765
|
|
378
|
-
U_MODIFIER_LETTER_OPEN_SHELF = 766
|
|
379
|
-
U_MODIFIER_LETTER_LOW_LEFT_ARROW = 767
|
|
380
|
-
U_GREEK_LOWER_NUMERAL_SIGN = 885
|
|
381
|
-
U_GREEK_TONOS = 900
|
|
382
|
-
U_GREEK_DIALYTIKA_TONOS = 901
|
|
383
|
-
U_GREEK_KORONIS = 8125
|
|
384
|
-
U_GREEK_PSILI = 8127
|
|
385
|
-
U_GREEK_PERISPOMENI = 8128
|
|
386
|
-
U_GREEK_DIALYTIKA_AND_PERISPOMENI = 8129
|
|
387
|
-
U_GREEK_PSILI_AND_VARIA = 8141
|
|
388
|
-
U_GREEK_PSILI_AND_OXIA = 8142
|
|
389
|
-
U_GREEK_PSILI_AND_PERISPOMENI = 8143
|
|
390
|
-
U_GREEK_DASIA_AND_VARIA = 8157
|
|
391
|
-
U_GREEK_DASIA_AND_OXIA = 8158
|
|
392
|
-
U_GREEK_DASIA_AND_PERISPOMENI = 8159
|
|
393
|
-
U_GREEK_DIALYTIKA_AND_VARIA = 8173
|
|
394
|
-
U_GREEK_DIALYTIKA_AND_OXIA = 8174
|
|
395
|
-
U_GREEK_VARIA = 8175
|
|
396
|
-
U_GREEK_OXIA = 8189
|
|
397
|
-
U_GREEK_DASIA = 8190
|
|
398
|
-
U_OVERLINE = 8254
|
|
331
|
+
U_CIRCUMFLEX = 94,// U+005E CIRCUMFLEX
|
|
332
|
+
U_GRAVE_ACCENT = 96,// U+0060 GRAVE ACCENT
|
|
333
|
+
U_DIAERESIS = 168,// U+00A8 DIAERESIS
|
|
334
|
+
U_MACRON = 175,// U+00AF MACRON
|
|
335
|
+
U_ACUTE_ACCENT = 180,// U+00B4 ACUTE ACCENT
|
|
336
|
+
U_CEDILLA = 184,// U+00B8 CEDILLA
|
|
337
|
+
U_MODIFIER_LETTER_LEFT_ARROWHEAD = 706,// U+02C2 MODIFIER LETTER LEFT ARROWHEAD
|
|
338
|
+
U_MODIFIER_LETTER_RIGHT_ARROWHEAD = 707,// U+02C3 MODIFIER LETTER RIGHT ARROWHEAD
|
|
339
|
+
U_MODIFIER_LETTER_UP_ARROWHEAD = 708,// U+02C4 MODIFIER LETTER UP ARROWHEAD
|
|
340
|
+
U_MODIFIER_LETTER_DOWN_ARROWHEAD = 709,// U+02C5 MODIFIER LETTER DOWN ARROWHEAD
|
|
341
|
+
U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING = 722,// U+02D2 MODIFIER LETTER CENTRED RIGHT HALF RING
|
|
342
|
+
U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING = 723,// U+02D3 MODIFIER LETTER CENTRED LEFT HALF RING
|
|
343
|
+
U_MODIFIER_LETTER_UP_TACK = 724,// U+02D4 MODIFIER LETTER UP TACK
|
|
344
|
+
U_MODIFIER_LETTER_DOWN_TACK = 725,// U+02D5 MODIFIER LETTER DOWN TACK
|
|
345
|
+
U_MODIFIER_LETTER_PLUS_SIGN = 726,// U+02D6 MODIFIER LETTER PLUS SIGN
|
|
346
|
+
U_MODIFIER_LETTER_MINUS_SIGN = 727,// U+02D7 MODIFIER LETTER MINUS SIGN
|
|
347
|
+
U_BREVE = 728,// U+02D8 BREVE
|
|
348
|
+
U_DOT_ABOVE = 729,// U+02D9 DOT ABOVE
|
|
349
|
+
U_RING_ABOVE = 730,// U+02DA RING ABOVE
|
|
350
|
+
U_OGONEK = 731,// U+02DB OGONEK
|
|
351
|
+
U_SMALL_TILDE = 732,// U+02DC SMALL TILDE
|
|
352
|
+
U_DOUBLE_ACUTE_ACCENT = 733,// U+02DD DOUBLE ACUTE ACCENT
|
|
353
|
+
U_MODIFIER_LETTER_RHOTIC_HOOK = 734,// U+02DE MODIFIER LETTER RHOTIC HOOK
|
|
354
|
+
U_MODIFIER_LETTER_CROSS_ACCENT = 735,// U+02DF MODIFIER LETTER CROSS ACCENT
|
|
355
|
+
U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR = 741,// U+02E5 MODIFIER LETTER EXTRA-HIGH TONE BAR
|
|
356
|
+
U_MODIFIER_LETTER_HIGH_TONE_BAR = 742,// U+02E6 MODIFIER LETTER HIGH TONE BAR
|
|
357
|
+
U_MODIFIER_LETTER_MID_TONE_BAR = 743,// U+02E7 MODIFIER LETTER MID TONE BAR
|
|
358
|
+
U_MODIFIER_LETTER_LOW_TONE_BAR = 744,// U+02E8 MODIFIER LETTER LOW TONE BAR
|
|
359
|
+
U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR = 745,// U+02E9 MODIFIER LETTER EXTRA-LOW TONE BAR
|
|
360
|
+
U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK = 746,// U+02EA MODIFIER LETTER YIN DEPARTING TONE MARK
|
|
361
|
+
U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK = 747,// U+02EB MODIFIER LETTER YANG DEPARTING TONE MARK
|
|
362
|
+
U_MODIFIER_LETTER_UNASPIRATED = 749,// U+02ED MODIFIER LETTER UNASPIRATED
|
|
363
|
+
U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD = 751,// U+02EF MODIFIER LETTER LOW DOWN ARROWHEAD
|
|
364
|
+
U_MODIFIER_LETTER_LOW_UP_ARROWHEAD = 752,// U+02F0 MODIFIER LETTER LOW UP ARROWHEAD
|
|
365
|
+
U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD = 753,// U+02F1 MODIFIER LETTER LOW LEFT ARROWHEAD
|
|
366
|
+
U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD = 754,// U+02F2 MODIFIER LETTER LOW RIGHT ARROWHEAD
|
|
367
|
+
U_MODIFIER_LETTER_LOW_RING = 755,// U+02F3 MODIFIER LETTER LOW RING
|
|
368
|
+
U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT = 756,// U+02F4 MODIFIER LETTER MIDDLE GRAVE ACCENT
|
|
369
|
+
U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT = 757,// U+02F5 MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT
|
|
370
|
+
U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT = 758,// U+02F6 MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT
|
|
371
|
+
U_MODIFIER_LETTER_LOW_TILDE = 759,// U+02F7 MODIFIER LETTER LOW TILDE
|
|
372
|
+
U_MODIFIER_LETTER_RAISED_COLON = 760,// U+02F8 MODIFIER LETTER RAISED COLON
|
|
373
|
+
U_MODIFIER_LETTER_BEGIN_HIGH_TONE = 761,// U+02F9 MODIFIER LETTER BEGIN HIGH TONE
|
|
374
|
+
U_MODIFIER_LETTER_END_HIGH_TONE = 762,// U+02FA MODIFIER LETTER END HIGH TONE
|
|
375
|
+
U_MODIFIER_LETTER_BEGIN_LOW_TONE = 763,// U+02FB MODIFIER LETTER BEGIN LOW TONE
|
|
376
|
+
U_MODIFIER_LETTER_END_LOW_TONE = 764,// U+02FC MODIFIER LETTER END LOW TONE
|
|
377
|
+
U_MODIFIER_LETTER_SHELF = 765,// U+02FD MODIFIER LETTER SHELF
|
|
378
|
+
U_MODIFIER_LETTER_OPEN_SHELF = 766,// U+02FE MODIFIER LETTER OPEN SHELF
|
|
379
|
+
U_MODIFIER_LETTER_LOW_LEFT_ARROW = 767,// U+02FF MODIFIER LETTER LOW LEFT ARROW
|
|
380
|
+
U_GREEK_LOWER_NUMERAL_SIGN = 885,// U+0375 GREEK LOWER NUMERAL SIGN
|
|
381
|
+
U_GREEK_TONOS = 900,// U+0384 GREEK TONOS
|
|
382
|
+
U_GREEK_DIALYTIKA_TONOS = 901,// U+0385 GREEK DIALYTIKA TONOS
|
|
383
|
+
U_GREEK_KORONIS = 8125,// U+1FBD GREEK KORONIS
|
|
384
|
+
U_GREEK_PSILI = 8127,// U+1FBF GREEK PSILI
|
|
385
|
+
U_GREEK_PERISPOMENI = 8128,// U+1FC0 GREEK PERISPOMENI
|
|
386
|
+
U_GREEK_DIALYTIKA_AND_PERISPOMENI = 8129,// U+1FC1 GREEK DIALYTIKA AND PERISPOMENI
|
|
387
|
+
U_GREEK_PSILI_AND_VARIA = 8141,// U+1FCD GREEK PSILI AND VARIA
|
|
388
|
+
U_GREEK_PSILI_AND_OXIA = 8142,// U+1FCE GREEK PSILI AND OXIA
|
|
389
|
+
U_GREEK_PSILI_AND_PERISPOMENI = 8143,// U+1FCF GREEK PSILI AND PERISPOMENI
|
|
390
|
+
U_GREEK_DASIA_AND_VARIA = 8157,// U+1FDD GREEK DASIA AND VARIA
|
|
391
|
+
U_GREEK_DASIA_AND_OXIA = 8158,// U+1FDE GREEK DASIA AND OXIA
|
|
392
|
+
U_GREEK_DASIA_AND_PERISPOMENI = 8159,// U+1FDF GREEK DASIA AND PERISPOMENI
|
|
393
|
+
U_GREEK_DIALYTIKA_AND_VARIA = 8173,// U+1FED GREEK DIALYTIKA AND VARIA
|
|
394
|
+
U_GREEK_DIALYTIKA_AND_OXIA = 8174,// U+1FEE GREEK DIALYTIKA AND OXIA
|
|
395
|
+
U_GREEK_VARIA = 8175,// U+1FEF GREEK VARIA
|
|
396
|
+
U_GREEK_OXIA = 8189,// U+1FFD GREEK OXIA
|
|
397
|
+
U_GREEK_DASIA = 8190,// U+1FFE GREEK DASIA
|
|
398
|
+
U_OVERLINE = 8254,// Unicode Character 'OVERLINE'
|
|
399
399
|
/**
|
|
400
400
|
* UTF-8 BOM
|
|
401
401
|
* Unicode Character 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF)
|
package/base/common/dom.js
CHANGED
|
@@ -450,12 +450,10 @@ class AnimationFrameQueueItem {
|
|
|
450
450
|
function measure(callback) {
|
|
451
451
|
return (0, exports.scheduleAtNextAnimationFrame)(callback, 10000 /* must be early */);
|
|
452
452
|
}
|
|
453
|
-
|
|
454
453
|
exports.measure = _get__("measure");
|
|
455
454
|
function modify(callback) {
|
|
456
455
|
return (0, exports.scheduleAtNextAnimationFrame)(callback, -10000 /* must be late */);
|
|
457
456
|
}
|
|
458
|
-
|
|
459
457
|
exports.modify = _get__("modify");
|
|
460
458
|
const MINIMUM_TIME_MS = 16;
|
|
461
459
|
const DEFAULT_EVENT_MERGER = function (lastEvent, currentEvent) {
|
|
@@ -11,7 +11,7 @@ export type IteratorResult<T> = IteratorDefinedResult<T> | IteratorUndefinedResu
|
|
|
11
11
|
export interface Iterator<T> {
|
|
12
12
|
next(): IteratorResult<T>;
|
|
13
13
|
}
|
|
14
|
-
export declare
|
|
14
|
+
export declare namespace Iterator {
|
|
15
15
|
function empty<T>(): Iterator<T>;
|
|
16
16
|
function fromArray<T>(array: T[], index?: number, length?: number): Iterator<T>;
|
|
17
17
|
function from<T>(elements: Iterator<T> | T[] | undefined): Iterator<T>;
|
package/base/common/iterator.js
CHANGED
|
@@ -151,28 +151,28 @@ export declare const enum KeyCode {
|
|
|
151
151
|
* Either the angle bracket key or the backslash key on the RT 102-key keyboard.
|
|
152
152
|
*/
|
|
153
153
|
OEM_102 = 92,
|
|
154
|
-
NUMPAD_0 = 93,
|
|
155
|
-
NUMPAD_1 = 94,
|
|
156
|
-
NUMPAD_2 = 95,
|
|
157
|
-
NUMPAD_3 = 96,
|
|
158
|
-
NUMPAD_4 = 97,
|
|
159
|
-
NUMPAD_5 = 98,
|
|
160
|
-
NUMPAD_6 = 99,
|
|
161
|
-
NUMPAD_7 = 100,
|
|
162
|
-
NUMPAD_8 = 101,
|
|
163
|
-
NUMPAD_9 = 102,
|
|
164
|
-
NUMPAD_MULTIPLY = 103,
|
|
165
|
-
NUMPAD_ADD = 104,
|
|
166
|
-
NUMPAD_SEPARATOR = 105,
|
|
167
|
-
NUMPAD_SUBTRACT = 106,
|
|
168
|
-
NUMPAD_DECIMAL = 107,
|
|
169
|
-
NUMPAD_DIVIDE = 108,
|
|
154
|
+
NUMPAD_0 = 93,// VK_NUMPAD0, 0x60, Numeric keypad 0 key
|
|
155
|
+
NUMPAD_1 = 94,// VK_NUMPAD1, 0x61, Numeric keypad 1 key
|
|
156
|
+
NUMPAD_2 = 95,// VK_NUMPAD2, 0x62, Numeric keypad 2 key
|
|
157
|
+
NUMPAD_3 = 96,// VK_NUMPAD3, 0x63, Numeric keypad 3 key
|
|
158
|
+
NUMPAD_4 = 97,// VK_NUMPAD4, 0x64, Numeric keypad 4 key
|
|
159
|
+
NUMPAD_5 = 98,// VK_NUMPAD5, 0x65, Numeric keypad 5 key
|
|
160
|
+
NUMPAD_6 = 99,// VK_NUMPAD6, 0x66, Numeric keypad 6 key
|
|
161
|
+
NUMPAD_7 = 100,// VK_NUMPAD7, 0x67, Numeric keypad 7 key
|
|
162
|
+
NUMPAD_8 = 101,// VK_NUMPAD8, 0x68, Numeric keypad 8 key
|
|
163
|
+
NUMPAD_9 = 102,// VK_NUMPAD9, 0x69, Numeric keypad 9 key
|
|
164
|
+
NUMPAD_MULTIPLY = 103,// VK_MULTIPLY, 0x6A, Multiply key
|
|
165
|
+
NUMPAD_ADD = 104,// VK_ADD, 0x6B, Add key
|
|
166
|
+
NUMPAD_SEPARATOR = 105,// VK_SEPARATOR, 0x6C, Separator key
|
|
167
|
+
NUMPAD_SUBTRACT = 106,// VK_SUBTRACT, 0x6D, Subtract key
|
|
168
|
+
NUMPAD_DECIMAL = 107,// VK_DECIMAL, 0x6E, Decimal key
|
|
169
|
+
NUMPAD_DIVIDE = 108,// VK_DIVIDE, 0x6F,
|
|
170
170
|
/**
|
|
171
171
|
* Cover all key codes when IME is processing input.
|
|
172
172
|
*/
|
|
173
173
|
KEY_IN_COMPOSITION = 109,
|
|
174
|
-
ABNT_C1 = 110
|
|
175
|
-
ABNT_C2 = 111
|
|
174
|
+
ABNT_C1 = 110,// Brazilian (ABNT) Keyboard
|
|
175
|
+
ABNT_C2 = 111,// Brazilian (ABNT) Keyboard
|
|
176
176
|
/**
|
|
177
177
|
* Placed last to cover the length of the enum.
|
|
178
178
|
* Please do not depend on this value!
|
package/base/common/keyCodes.js
CHANGED
|
@@ -24,7 +24,6 @@ class KeyCodeStrMap {
|
|
|
24
24
|
return this._strToKeyCode[str.toLowerCase()] || 0 /* KeyCode.Unknown */;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
const scanCodeIntToStr = [];
|
|
29
28
|
const scanCodeStrToInt = Object.create(null);
|
|
30
29
|
const scanCodeLowerCaseStrToInt = Object.create(null);
|
|
@@ -215,7 +214,6 @@ class SimpleKeybinding {
|
|
|
215
214
|
return this.ctrlKey && this.keyCode === 5 /* KeyCode.Ctrl */ || this.shiftKey && this.keyCode === 4 /* KeyCode.Shift */ || this.altKey && this.keyCode === 6 /* KeyCode.Alt */ || this.metaKey && this.keyCode === 57 /* KeyCode.Meta */;
|
|
216
215
|
}
|
|
217
216
|
}
|
|
218
|
-
|
|
219
217
|
exports.SimpleKeybinding = _get__("SimpleKeybinding");
|
|
220
218
|
class ChordKeybinding {
|
|
221
219
|
constructor(firstPart, chordPart) {
|
package/menubar/index.js
CHANGED
|
@@ -301,7 +301,6 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
|
|
|
301
301
|
triggerKeys.push(15 /* KeyCode.LeftArrow */);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
|
|
305
304
|
if (triggerKeys.some(k => event.equals(k)) && !this.isOpen) {
|
|
306
305
|
this.focusedMenu = {
|
|
307
306
|
index: _get__("MenuBar").OVERFLOW_INDEX
|
|
@@ -851,15 +850,15 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
|
|
|
851
850
|
showMenu(menuIndex, selectFirst = true) {
|
|
852
851
|
const actualMenuIndex = menuIndex >= this.numMenusShown ? _get__("MenuBar").OVERFLOW_INDEX : menuIndex;
|
|
853
852
|
const customMenu = actualMenuIndex === _get__("MenuBar").OVERFLOW_INDEX ? this.overflowMenu : this.menus[actualMenuIndex];
|
|
854
|
-
if (!customMenu.actions || !customMenu.buttonElement
|
|
853
|
+
if (!customMenu.actions || !customMenu.buttonElement) {
|
|
855
854
|
return;
|
|
856
855
|
}
|
|
857
856
|
const menuHolder = _get__("$")('.cet-menubar-menu-container', {
|
|
858
857
|
title: ''
|
|
859
858
|
});
|
|
860
859
|
customMenu.buttonElement.classList.add('open');
|
|
861
|
-
const titleBoundingRect = customMenu.
|
|
862
|
-
const titleBoundingRectZoom = _get__("DOM").getDomNodeZoomLevel(customMenu.
|
|
860
|
+
const titleBoundingRect = customMenu.buttonElement.getBoundingClientRect();
|
|
861
|
+
const titleBoundingRectZoom = _get__("DOM").getDomNodeZoomLevel(customMenu.buttonElement);
|
|
863
862
|
if (this.options.compactMode === _get__("menu_1").Direction.Right) {
|
|
864
863
|
menuHolder.style.top = `${titleBoundingRect.top}px`;
|
|
865
864
|
menuHolder.style.left = `${titleBoundingRect.left + this.container.clientWidth}px`;
|
|
@@ -880,7 +879,6 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
|
|
|
880
879
|
// expandDirection: this.isCompact ? this.options.compactMode : Direction.Right,
|
|
881
880
|
// useEventAsContext: true
|
|
882
881
|
};
|
|
883
|
-
|
|
884
882
|
const menuWidget = this._register(new (_get__("menu_1").CETMenu)(menuHolder, this.menuIcons, this.currentOptions, menuOptions, this.closeMenu));
|
|
885
883
|
menuWidget.createMenu(customMenu.actions?.items ?? []);
|
|
886
884
|
menuWidget.applyStyle(this.menuStyle);
|
package/menubar/menu/index.js
CHANGED
|
@@ -318,7 +318,6 @@ class CETMenu extends _get__("lifecycle_1").Disposable {
|
|
|
318
318
|
if (document.activeElement instanceof HTMLElement) {
|
|
319
319
|
document.activeElement.blur(); // remove focus from focused action
|
|
320
320
|
}
|
|
321
|
-
|
|
322
321
|
this._onDidCancel.fire();
|
|
323
322
|
}
|
|
324
323
|
focusItemByElement(element) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "custom-electron-titlebar",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.8",
|
|
4
4
|
"description": "Library for electron that allows you to configure a fully customizable title bar.",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -47,28 +47,28 @@
|
|
|
47
47
|
"electron": ">20.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/cli": "7.
|
|
51
|
-
"@babel/core": "7.
|
|
52
|
-
"@jest/globals": "29.
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
54
|
-
"@typescript-eslint/parser": "6.
|
|
55
|
-
"babel-plugin-import-require-as-string": "1.0.2",
|
|
56
|
-
"babel-plugin-module-resolver": "5.0.0",
|
|
57
|
-
"babel-plugin-rewire": "1.2.0",
|
|
58
|
-
"electron": "
|
|
59
|
-
"eslint": "8.
|
|
60
|
-
"eslint-config-prettier": "9.
|
|
61
|
-
"eslint-config-standard": "17.1.0",
|
|
62
|
-
"eslint-plugin-import": "2.
|
|
63
|
-
"eslint-plugin-n": "16.
|
|
64
|
-
"eslint-plugin-promise": "6.1.1",
|
|
65
|
-
"jest": "^29.
|
|
66
|
-
"jest-environment-jsdom": "29.
|
|
67
|
-
"rimraf": "5.0.
|
|
68
|
-
"standard": "17.1.0",
|
|
69
|
-
"ts-jest": "29.1.1",
|
|
70
|
-
"tsc-alias": "1.8.
|
|
71
|
-
"typescript": "5.
|
|
50
|
+
"@babel/cli": "^7.23.4",
|
|
51
|
+
"@babel/core": "^7.23.7",
|
|
52
|
+
"@jest/globals": "^29.7.0",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
54
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
55
|
+
"babel-plugin-import-require-as-string": "^1.0.2",
|
|
56
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
57
|
+
"babel-plugin-rewire": "^1.2.0",
|
|
58
|
+
"electron": "^28.1.3",
|
|
59
|
+
"eslint": "^8.56.0",
|
|
60
|
+
"eslint-config-prettier": "^9.1.0",
|
|
61
|
+
"eslint-config-standard": "^17.1.0",
|
|
62
|
+
"eslint-plugin-import": "^2.29.1",
|
|
63
|
+
"eslint-plugin-n": "^16.6.2",
|
|
64
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
65
|
+
"jest": "^29.7.0",
|
|
66
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
67
|
+
"rimraf": "^5.0.5",
|
|
68
|
+
"standard": "^17.1.0",
|
|
69
|
+
"ts-jest": "^29.1.1",
|
|
70
|
+
"tsc-alias": "^1.8.8",
|
|
71
|
+
"typescript": "^5.3.3"
|
|
72
72
|
},
|
|
73
73
|
"eslintConfig": {
|
|
74
74
|
"extends": "./node_modules/standard/eslintrc.json"
|
package/titlebar/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare class CustomTitlebar extends ThemeBar {
|
|
|
48
48
|
private onDidChangeMaximized;
|
|
49
49
|
private updateMenu;
|
|
50
50
|
private updateStyles;
|
|
51
|
+
private canCenterTitle;
|
|
51
52
|
/**
|
|
52
53
|
* Update title bar styles based on focus state.
|
|
53
54
|
* @param hasFocus focus state of the window
|
package/titlebar/index.js
CHANGED
|
@@ -41,7 +41,8 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
41
41
|
maximize: 'Maximize',
|
|
42
42
|
minimize: 'Minimize',
|
|
43
43
|
restoreDown: 'Restore Down'
|
|
44
|
-
}
|
|
44
|
+
},
|
|
45
|
+
unfocusEffect: true
|
|
45
46
|
};
|
|
46
47
|
// TODO: Refactor, verify if is possible use into menubar
|
|
47
48
|
this.closeMenu = () => {
|
|
@@ -85,7 +86,6 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
85
86
|
this.loadEvents();
|
|
86
87
|
// this.registerTheme(ThemeBar.win)
|
|
87
88
|
}
|
|
88
|
-
|
|
89
89
|
loadIcons() {
|
|
90
90
|
const icons = this.currentOptions.icons;
|
|
91
91
|
if (icons) {
|
|
@@ -283,17 +283,17 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
283
283
|
} else {
|
|
284
284
|
(0, _get__("dom_1").removeClass)(this.titlebar, 'inactive');
|
|
285
285
|
}
|
|
286
|
-
const backgroundColor = this.isInactive ? this.currentOptions.backgroundColor?.lighten(0.12) : this.currentOptions.backgroundColor;
|
|
286
|
+
const backgroundColor = this.isInactive && this.currentOptions.unfocusEffect ? this.currentOptions.backgroundColor?.lighten(0.12) : this.currentOptions.backgroundColor;
|
|
287
287
|
if (backgroundColor) {
|
|
288
288
|
this.titlebar.style.backgroundColor = backgroundColor?.toString();
|
|
289
289
|
}
|
|
290
290
|
let foregroundColor;
|
|
291
291
|
if (backgroundColor?.isLighter()) {
|
|
292
292
|
(0, _get__("dom_1").addClass)(this.titlebar, 'light');
|
|
293
|
-
foregroundColor = this.isInactive ? _get__("consts_1").INACTIVE_FOREGROUND_DARK : _get__("consts_1").ACTIVE_FOREGROUND_DARK;
|
|
293
|
+
foregroundColor = this.isInactive && this.currentOptions.unfocusEffect ? _get__("consts_1").INACTIVE_FOREGROUND_DARK : _get__("consts_1").ACTIVE_FOREGROUND_DARK;
|
|
294
294
|
} else {
|
|
295
295
|
(0, _get__("dom_1").removeClass)(this.titlebar, 'light');
|
|
296
|
-
foregroundColor = this.isInactive ? _get__("consts_1").INACTIVE_FOREGROUND : _get__("consts_1").ACTIVE_FOREGROUND;
|
|
296
|
+
foregroundColor = this.isInactive && this.currentOptions.unfocusEffect ? _get__("consts_1").INACTIVE_FOREGROUND : _get__("consts_1").ACTIVE_FOREGROUND;
|
|
297
297
|
}
|
|
298
298
|
this.titlebar.style.color = foregroundColor?.toString();
|
|
299
299
|
const updatedWindowControls = _get__("electron_1").ipcRenderer.sendSync('update-window-controls', {
|
|
@@ -326,6 +326,11 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
+
canCenterTitle() {
|
|
330
|
+
const menuBarContainerMargin = 20;
|
|
331
|
+
const menuSpaceLimit = window.innerWidth / 2 - this.menuBarContainer.getBoundingClientRect().right - menuBarContainerMargin;
|
|
332
|
+
return this.title.getBoundingClientRect().width / 2 <= menuSpaceLimit;
|
|
333
|
+
}
|
|
329
334
|
/// Public methods
|
|
330
335
|
/**
|
|
331
336
|
* Update title bar styles based on focus state.
|
|
@@ -413,13 +418,15 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
|
|
|
413
418
|
(0, _get__("dom_1").removeClass)(this.title, 'cet-title-center');
|
|
414
419
|
if (menuPosition !== 'bottom') {
|
|
415
420
|
(0, _get__("dom_1").addDisposableListener)(window, 'resize', () => {
|
|
416
|
-
if (
|
|
421
|
+
if (this.canCenterTitle()) {
|
|
417
422
|
(0, _get__("dom_1").addClass)(this.title, 'cet-title-center');
|
|
418
423
|
} else {
|
|
419
424
|
(0, _get__("dom_1").removeClass)(this.title, 'cet-title-center');
|
|
420
425
|
}
|
|
421
426
|
});
|
|
422
|
-
|
|
427
|
+
if (this.canCenterTitle()) {
|
|
428
|
+
(0, _get__("dom_1").addClass)(this.title, 'cet-title-center');
|
|
429
|
+
}
|
|
423
430
|
}
|
|
424
431
|
if (!_get__("platform_1").isMacintosh && order === 'first-buttons') {
|
|
425
432
|
this.controlsContainer.style.marginLeft = 'auto';
|