@lvce-editor/title-bar-worker 3.4.0 → 3.7.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.
- package/dist/titleBarWorkerMain.js +276 -287
- package/package.json +1 -1
|
@@ -1236,6 +1236,26 @@ const {
|
|
|
1236
1236
|
invoke,
|
|
1237
1237
|
set: set$1
|
|
1238
1238
|
} = create$2(RendererWorker);
|
|
1239
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1240
|
+
number(uid);
|
|
1241
|
+
number(menuId);
|
|
1242
|
+
number(x);
|
|
1243
|
+
number(y);
|
|
1244
|
+
// @ts-ignore
|
|
1245
|
+
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1246
|
+
};
|
|
1247
|
+
const minimizeWindow = async () => {
|
|
1248
|
+
// @ts-ignore
|
|
1249
|
+
return invoke('ElectronWindow.minimize');
|
|
1250
|
+
};
|
|
1251
|
+
const maximizeWindow = async () => {
|
|
1252
|
+
// @ts-ignore
|
|
1253
|
+
return invoke('ElectronWindow.maximize');
|
|
1254
|
+
};
|
|
1255
|
+
const closeWindow = async () => {
|
|
1256
|
+
// @ts-ignore
|
|
1257
|
+
return invoke('ElectronWindow.close');
|
|
1258
|
+
};
|
|
1239
1259
|
|
|
1240
1260
|
const toCommandId = key => {
|
|
1241
1261
|
const dotIndex = key.indexOf('.');
|
|
@@ -1629,23 +1649,42 @@ const diff3 = uid => {
|
|
|
1629
1649
|
return diffResult;
|
|
1630
1650
|
};
|
|
1631
1651
|
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
}
|
|
1641
|
-
return map;
|
|
1642
|
-
};
|
|
1652
|
+
const Separator$2 = 1;
|
|
1653
|
+
const None$1 = 0;
|
|
1654
|
+
const SubMenu$1 = 4;
|
|
1655
|
+
const Checked = 2;
|
|
1656
|
+
const Unchecked = 3;
|
|
1657
|
+
const Disabled = 5;
|
|
1658
|
+
const RestoreFocus = 6;
|
|
1659
|
+
const Ignore = 7;
|
|
1643
1660
|
|
|
1644
|
-
|
|
1661
|
+
const getMenuEntriesTitleBarContextMenu = async state => {
|
|
1662
|
+
const {
|
|
1663
|
+
commandCenterEnabled,
|
|
1664
|
+
titleBarMenuBarEnabled
|
|
1665
|
+
} = state;
|
|
1666
|
+
// TODO checked state should be depending on whether or not that feature is currently visible or not
|
|
1667
|
+
return [{
|
|
1668
|
+
command: titleBarMenuBarEnabled ? 'TitleBar.hideMenuBar' : 'TitleBar.showMenuBar',
|
|
1669
|
+
flags: titleBarMenuBarEnabled ? Checked : Unchecked,
|
|
1670
|
+
id: 'MenuBar',
|
|
1671
|
+
label: menuBar()
|
|
1672
|
+
}, {
|
|
1673
|
+
command: commandCenterEnabled ? 'TitleBar.hideCommandCenter' : 'TitleBar.showCommandCenter',
|
|
1674
|
+
flags: commandCenterEnabled ? Checked : Unchecked,
|
|
1675
|
+
id: 'Command center',
|
|
1676
|
+
label: commandCenter()
|
|
1677
|
+
}, {
|
|
1678
|
+
command: '',
|
|
1679
|
+
flags: Checked,
|
|
1680
|
+
id: 'layout controls',
|
|
1681
|
+
label: 'layout controls'
|
|
1682
|
+
}];
|
|
1683
|
+
};
|
|
1645
1684
|
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
return
|
|
1685
|
+
const MenuIdTitleBarContextMenu = 50;
|
|
1686
|
+
const getMenuIds = () => {
|
|
1687
|
+
return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$1, View$2, MenuIdTitleBarContextMenu, TitleBarContextMenu];
|
|
1649
1688
|
};
|
|
1650
1689
|
|
|
1651
1690
|
const cut = () => {
|
|
@@ -1712,15 +1751,6 @@ const selectAllOccurrences = () => {
|
|
|
1712
1751
|
return i18nString(SelectAllOccurrences);
|
|
1713
1752
|
};
|
|
1714
1753
|
|
|
1715
|
-
const Separator$2 = 1;
|
|
1716
|
-
const None$1 = 0;
|
|
1717
|
-
const SubMenu$1 = 4;
|
|
1718
|
-
const Checked = 2;
|
|
1719
|
-
const Unchecked = 3;
|
|
1720
|
-
const Disabled = 5;
|
|
1721
|
-
const RestoreFocus = 6;
|
|
1722
|
-
const Ignore = 7;
|
|
1723
|
-
|
|
1724
1754
|
const menuEntrySeparator = {
|
|
1725
1755
|
command: '',
|
|
1726
1756
|
flags: Separator$2,
|
|
@@ -1767,11 +1797,6 @@ const getMenuEntries$c = () => {
|
|
|
1767
1797
|
}];
|
|
1768
1798
|
};
|
|
1769
1799
|
|
|
1770
|
-
const MenuEntriesEdit = {
|
|
1771
|
-
__proto__: null,
|
|
1772
|
-
getMenuEntries: getMenuEntries$c
|
|
1773
|
-
};
|
|
1774
|
-
|
|
1775
1800
|
/**
|
|
1776
1801
|
* @enum {string}
|
|
1777
1802
|
*/
|
|
@@ -1868,20 +1893,10 @@ const getMenuEntries$b = platform => {
|
|
|
1868
1893
|
return entries;
|
|
1869
1894
|
};
|
|
1870
1895
|
|
|
1871
|
-
const MenuEntriesFile = {
|
|
1872
|
-
__proto__: null,
|
|
1873
|
-
getMenuEntries: getMenuEntries$b
|
|
1874
|
-
};
|
|
1875
|
-
|
|
1876
1896
|
const getMenuEntries$a = () => {
|
|
1877
1897
|
return [];
|
|
1878
1898
|
};
|
|
1879
1899
|
|
|
1880
|
-
const MenuEntriesGo = {
|
|
1881
|
-
__proto__: null,
|
|
1882
|
-
getMenuEntries: getMenuEntries$a
|
|
1883
|
-
};
|
|
1884
|
-
|
|
1885
1900
|
const toggleDeveloperTools = () => {
|
|
1886
1901
|
return i18nString(ToggleDeveloperTools);
|
|
1887
1902
|
};
|
|
@@ -1938,21 +1953,70 @@ const getMenuEntries$9 = async platform => {
|
|
|
1938
1953
|
return entries;
|
|
1939
1954
|
};
|
|
1940
1955
|
|
|
1941
|
-
const
|
|
1942
|
-
|
|
1943
|
-
getMenuEntries: getMenuEntries$9
|
|
1956
|
+
const getRecentlyOpened = () => {
|
|
1957
|
+
return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1944
1958
|
};
|
|
1945
1959
|
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1960
|
+
const File = 'file://';
|
|
1961
|
+
|
|
1962
|
+
const getTitle$1 = (homeDir, uri) => {
|
|
1963
|
+
if (!uri) {
|
|
1964
|
+
return '';
|
|
1965
|
+
}
|
|
1966
|
+
if (uri.startsWith(File)) {
|
|
1967
|
+
return uri.slice(File.length);
|
|
1968
|
+
}
|
|
1969
|
+
return uri;
|
|
1948
1970
|
};
|
|
1949
1971
|
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1952
|
-
|
|
1972
|
+
const moreDot = () => {
|
|
1973
|
+
return i18nString(MoreDot);
|
|
1974
|
+
};
|
|
1975
|
+
const clearRecentlyOpened = () => {
|
|
1976
|
+
return i18nString(ClearRecentlyOpened);
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
const getHomeDir = () => {
|
|
1980
|
+
return '';
|
|
1981
|
+
};
|
|
1982
|
+
|
|
1983
|
+
const MAX_MENU_RECENT_ENTRIES = 10;
|
|
1984
|
+
const toMenuItem = folder => {
|
|
1985
|
+
const homeDir = getHomeDir();
|
|
1986
|
+
const label = getTitle$1(homeDir, folder);
|
|
1987
|
+
return {
|
|
1988
|
+
args: [folder],
|
|
1989
|
+
command: 'Workspace.setPath',
|
|
1990
|
+
flags: None$1,
|
|
1991
|
+
label
|
|
1992
|
+
};
|
|
1993
|
+
};
|
|
1994
|
+
const getMenuEntries$8 = async () => {
|
|
1995
|
+
const allItems = await getRecentlyOpened();
|
|
1996
|
+
const itemsToShow = allItems.slice(0, MAX_MENU_RECENT_ENTRIES);
|
|
1997
|
+
const items = [];
|
|
1998
|
+
if (itemsToShow.length > 0) {
|
|
1999
|
+
items.push(...itemsToShow.map(toMenuItem), menuEntrySeparator);
|
|
2000
|
+
}
|
|
2001
|
+
items.push({
|
|
2002
|
+
command: 'QuickPick.showRecent',
|
|
2003
|
+
flags: None$1,
|
|
2004
|
+
id: 'more',
|
|
2005
|
+
label: moreDot()
|
|
2006
|
+
}, menuEntrySeparator, {
|
|
2007
|
+
command: 'RecentlyOpened.clearRecentlyOpened',
|
|
2008
|
+
flags: None$1,
|
|
2009
|
+
id: 'clearRecentlyOpened',
|
|
2010
|
+
label: clearRecentlyOpened()
|
|
2011
|
+
});
|
|
2012
|
+
return items;
|
|
1953
2013
|
};
|
|
1954
2014
|
|
|
1955
2015
|
const getMenuEntries$7 = () => {
|
|
2016
|
+
return [];
|
|
2017
|
+
};
|
|
2018
|
+
|
|
2019
|
+
const getMenuEntries$6 = () => {
|
|
1956
2020
|
return [{
|
|
1957
2021
|
command: 'Editor.selectAll',
|
|
1958
2022
|
flags: None$1,
|
|
@@ -2026,12 +2090,7 @@ const getMenuEntries$7 = () => {
|
|
|
2026
2090
|
}];
|
|
2027
2091
|
};
|
|
2028
2092
|
|
|
2029
|
-
const
|
|
2030
|
-
__proto__: null,
|
|
2031
|
-
getMenuEntries: getMenuEntries$7
|
|
2032
|
-
};
|
|
2033
|
-
|
|
2034
|
-
const getMenuEntries$6 = () => {
|
|
2093
|
+
const getMenuEntries$5 = () => {
|
|
2035
2094
|
return [{
|
|
2036
2095
|
args: ['Terminal'],
|
|
2037
2096
|
command: 'Layout.togglePanel',
|
|
@@ -2041,18 +2100,151 @@ const getMenuEntries$6 = () => {
|
|
|
2041
2100
|
}];
|
|
2042
2101
|
};
|
|
2043
2102
|
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
|
|
2103
|
+
const getMenuEntries$4 = () => {
|
|
2104
|
+
return [{
|
|
2105
|
+
command: '',
|
|
2106
|
+
flags: SubMenu$1,
|
|
2107
|
+
id: File$1,
|
|
2108
|
+
label: file()
|
|
2109
|
+
}, {
|
|
2110
|
+
command: '',
|
|
2111
|
+
flags: SubMenu$1,
|
|
2112
|
+
id: Edit,
|
|
2113
|
+
label: edit()
|
|
2114
|
+
}, {
|
|
2115
|
+
command: '',
|
|
2116
|
+
flags: SubMenu$1,
|
|
2117
|
+
id: Selection,
|
|
2118
|
+
label: selection()
|
|
2119
|
+
}, {
|
|
2120
|
+
command: '',
|
|
2121
|
+
flags: SubMenu$1,
|
|
2122
|
+
id: View,
|
|
2123
|
+
label: view()
|
|
2124
|
+
}, {
|
|
2125
|
+
command: '',
|
|
2126
|
+
flags: SubMenu$1,
|
|
2127
|
+
id: Go,
|
|
2128
|
+
label: go()
|
|
2129
|
+
}, {
|
|
2130
|
+
command: '',
|
|
2131
|
+
flags: SubMenu$1,
|
|
2132
|
+
id: Run,
|
|
2133
|
+
keyboardShortCut: 'Alt+r',
|
|
2134
|
+
label: run()
|
|
2135
|
+
}, {
|
|
2136
|
+
command: '',
|
|
2137
|
+
flags: SubMenu$1,
|
|
2138
|
+
id: Terminal,
|
|
2139
|
+
keyboardShortCut: 'Alt+t',
|
|
2140
|
+
label: terminal()
|
|
2141
|
+
}, {
|
|
2142
|
+
command: '',
|
|
2143
|
+
flags: SubMenu$1,
|
|
2144
|
+
id: Help$1,
|
|
2145
|
+
keyboardShortCut: 'Alt+h',
|
|
2146
|
+
label: help()
|
|
2147
|
+
}];
|
|
2047
2148
|
};
|
|
2048
2149
|
|
|
2049
|
-
const getMenuEntries$
|
|
2150
|
+
const getMenuEntries$3 = () => {
|
|
2151
|
+
return [{
|
|
2152
|
+
command: '',
|
|
2153
|
+
flags: None$1,
|
|
2154
|
+
id: File$1,
|
|
2155
|
+
label: file()
|
|
2156
|
+
}, {
|
|
2157
|
+
command: '',
|
|
2158
|
+
flags: None$1,
|
|
2159
|
+
id: Edit,
|
|
2160
|
+
label: edit()
|
|
2161
|
+
}, {
|
|
2162
|
+
command: '',
|
|
2163
|
+
flags: None$1,
|
|
2164
|
+
id: Selection,
|
|
2165
|
+
label: selection()
|
|
2166
|
+
}, {
|
|
2167
|
+
command: '',
|
|
2168
|
+
flags: None$1,
|
|
2169
|
+
id: View,
|
|
2170
|
+
label: view()
|
|
2171
|
+
}, {
|
|
2172
|
+
command: '',
|
|
2173
|
+
flags: None$1,
|
|
2174
|
+
id: Go,
|
|
2175
|
+
label: go()
|
|
2176
|
+
}, {
|
|
2177
|
+
command: '',
|
|
2178
|
+
flags: None$1,
|
|
2179
|
+
id: Help$1,
|
|
2180
|
+
label: help()
|
|
2181
|
+
}];
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
const getFn$1 = platform => {
|
|
2185
|
+
switch (platform) {
|
|
2186
|
+
case Web:
|
|
2187
|
+
return getMenuEntries$3;
|
|
2188
|
+
default:
|
|
2189
|
+
return getMenuEntries$4;
|
|
2190
|
+
}
|
|
2191
|
+
};
|
|
2192
|
+
const getMenuEntries$2 = async platform => {
|
|
2193
|
+
const fn = getFn$1(platform);
|
|
2194
|
+
return fn();
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
const getMenuEntries$1 = () => {
|
|
2050
2198
|
return [];
|
|
2051
2199
|
};
|
|
2052
2200
|
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2055
|
-
|
|
2201
|
+
const getMenuEntries2 = async (state, props) => {
|
|
2202
|
+
switch (props.menuId) {
|
|
2203
|
+
case Edit$2:
|
|
2204
|
+
return getMenuEntries$c();
|
|
2205
|
+
case File$3:
|
|
2206
|
+
return getMenuEntries$b(props.platform);
|
|
2207
|
+
case Go$2:
|
|
2208
|
+
return getMenuEntries$a();
|
|
2209
|
+
case Help$3:
|
|
2210
|
+
return getMenuEntries$9(props.platform);
|
|
2211
|
+
case OpenRecent$1:
|
|
2212
|
+
return getMenuEntries$8();
|
|
2213
|
+
case Run$2:
|
|
2214
|
+
return getMenuEntries$7();
|
|
2215
|
+
case Selection$2:
|
|
2216
|
+
return getMenuEntries$6();
|
|
2217
|
+
case Terminal$2:
|
|
2218
|
+
return getMenuEntries$5();
|
|
2219
|
+
case TitleBar$1:
|
|
2220
|
+
return getMenuEntries$2(props.platform);
|
|
2221
|
+
case TitleBarContextMenu:
|
|
2222
|
+
case MenuIdTitleBarContextMenu:
|
|
2223
|
+
return getMenuEntriesTitleBarContextMenu(state);
|
|
2224
|
+
case View$2:
|
|
2225
|
+
return getMenuEntries$1();
|
|
2226
|
+
default:
|
|
2227
|
+
return [];
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
const getEntryMap = async (state, menuIds) => {
|
|
2232
|
+
const map = Object.create(null);
|
|
2233
|
+
for (const id of menuIds) {
|
|
2234
|
+
const entries = await getMenuEntries2(state, {
|
|
2235
|
+
// @ts-ignore
|
|
2236
|
+
menuId: id
|
|
2237
|
+
});
|
|
2238
|
+
map[id] = entries;
|
|
2239
|
+
}
|
|
2240
|
+
return map;
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2243
|
+
// TODO cache window id
|
|
2244
|
+
|
|
2245
|
+
const getWindowId = async () => {
|
|
2246
|
+
const windowId = await invoke('GetWindowId.getWindowId');
|
|
2247
|
+
return windowId;
|
|
2056
2248
|
};
|
|
2057
2249
|
|
|
2058
2250
|
// based on https://www.electronjs.org/docs/latest/api/menu-item#new-menuitemoptions
|
|
@@ -2188,15 +2380,13 @@ const toElectronMenu = (map, rootId) => {
|
|
|
2188
2380
|
};
|
|
2189
2381
|
};
|
|
2190
2382
|
|
|
2191
|
-
const menuEntries = [MenuEntriesFile, MenuEntriesEdit, MenuEntriesSelection, MenuEntriesView, MenuEntriesGo, MenuEntriesRun, MenuEntriesTerminal, MenuEntriesHelp
|
|
2192
|
-
// MenuEntriesTitleBar,
|
|
2193
|
-
];
|
|
2194
2383
|
const setItems = async items => {
|
|
2195
2384
|
const windowId = await getWindowId();
|
|
2196
|
-
return invoke('ElectronApplicationMenu.setItems', windowId, items);
|
|
2385
|
+
return invoke('WebView.compatSharedProcessInvoke', 'ElectronApplicationMenu.setItems', windowId, items);
|
|
2197
2386
|
};
|
|
2198
2387
|
const hydrate = async state => {
|
|
2199
|
-
const
|
|
2388
|
+
const ids = getMenuIds();
|
|
2389
|
+
const map = await getEntryMap(state, ids);
|
|
2200
2390
|
const {
|
|
2201
2391
|
commandMap,
|
|
2202
2392
|
electronMenu
|
|
@@ -2286,130 +2476,14 @@ const getKeyBindings = () => {
|
|
|
2286
2476
|
}];
|
|
2287
2477
|
};
|
|
2288
2478
|
|
|
2289
|
-
const getMenuEntriesTitleBarContextMenu = async state => {
|
|
2290
|
-
const {
|
|
2291
|
-
commandCenterEnabled,
|
|
2292
|
-
titleBarMenuBarEnabled
|
|
2293
|
-
} = state;
|
|
2294
|
-
// TODO checked state should be depending on whether or not that feature is currently visible or not
|
|
2295
|
-
return [{
|
|
2296
|
-
command: titleBarMenuBarEnabled ? 'TitleBar.hideMenuBar' : 'TitleBar.showMenuBar',
|
|
2297
|
-
flags: titleBarMenuBarEnabled ? Checked : Unchecked,
|
|
2298
|
-
id: 'MenuBar',
|
|
2299
|
-
label: menuBar()
|
|
2300
|
-
}, {
|
|
2301
|
-
command: commandCenterEnabled ? 'TitleBar.hideCommandCenter' : 'TitleBar.showCommandCenter',
|
|
2302
|
-
flags: commandCenterEnabled ? Checked : Unchecked,
|
|
2303
|
-
id: 'Command center',
|
|
2304
|
-
label: commandCenter()
|
|
2305
|
-
}, {
|
|
2306
|
-
command: '',
|
|
2307
|
-
flags: Checked,
|
|
2308
|
-
id: 'layout controls',
|
|
2309
|
-
label: 'layout controls'
|
|
2310
|
-
}];
|
|
2311
|
-
};
|
|
2312
|
-
|
|
2313
|
-
const MenuIdTitleBarContextMenu = 50;
|
|
2314
|
-
const getMenuIds = () => {
|
|
2315
|
-
return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$1, View$2, MenuIdTitleBarContextMenu, TitleBarContextMenu];
|
|
2316
|
-
};
|
|
2317
|
-
|
|
2318
|
-
const getRecentlyOpened = () => {
|
|
2319
|
-
return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
2320
|
-
};
|
|
2321
|
-
|
|
2322
|
-
const File = 'file://';
|
|
2323
|
-
|
|
2324
|
-
const getTitle$1 = (homeDir, uri) => {
|
|
2325
|
-
if (!uri) {
|
|
2326
|
-
return '';
|
|
2327
|
-
}
|
|
2328
|
-
if (uri.startsWith(File)) {
|
|
2329
|
-
return uri.slice(File.length);
|
|
2330
|
-
}
|
|
2331
|
-
return uri;
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
|
-
const moreDot = () => {
|
|
2335
|
-
return i18nString(MoreDot);
|
|
2336
|
-
};
|
|
2337
|
-
const clearRecentlyOpened = () => {
|
|
2338
|
-
return i18nString(ClearRecentlyOpened);
|
|
2339
|
-
};
|
|
2340
|
-
|
|
2341
|
-
const getHomeDir = () => {
|
|
2342
|
-
return '';
|
|
2343
|
-
};
|
|
2344
|
-
|
|
2345
|
-
const MAX_MENU_RECENT_ENTRIES = 10;
|
|
2346
|
-
const toMenuItem = folder => {
|
|
2347
|
-
const homeDir = getHomeDir();
|
|
2348
|
-
const label = getTitle$1(homeDir, folder);
|
|
2349
|
-
return {
|
|
2350
|
-
args: [folder],
|
|
2351
|
-
command: 'Workspace.setPath',
|
|
2352
|
-
flags: None$1,
|
|
2353
|
-
label
|
|
2354
|
-
};
|
|
2355
|
-
};
|
|
2356
|
-
const getMenuEntries$4 = async () => {
|
|
2357
|
-
const allItems = await getRecentlyOpened();
|
|
2358
|
-
const itemsToShow = allItems.slice(0, MAX_MENU_RECENT_ENTRIES);
|
|
2359
|
-
const items = [];
|
|
2360
|
-
if (itemsToShow.length > 0) {
|
|
2361
|
-
items.push(...itemsToShow.map(toMenuItem), menuEntrySeparator);
|
|
2362
|
-
}
|
|
2363
|
-
items.push({
|
|
2364
|
-
command: 'QuickPick.showRecent',
|
|
2365
|
-
flags: None$1,
|
|
2366
|
-
id: 'more',
|
|
2367
|
-
label: moreDot()
|
|
2368
|
-
}, menuEntrySeparator, {
|
|
2369
|
-
command: 'RecentlyOpened.clearRecentlyOpened',
|
|
2370
|
-
flags: None$1,
|
|
2371
|
-
id: 'clearRecentlyOpened',
|
|
2372
|
-
label: clearRecentlyOpened()
|
|
2373
|
-
});
|
|
2374
|
-
return items;
|
|
2375
|
-
};
|
|
2376
|
-
|
|
2377
|
-
const getMenuEntries2 = async (state, props) => {
|
|
2378
|
-
switch (props.menuId) {
|
|
2379
|
-
case Edit$2:
|
|
2380
|
-
return getMenuEntries$c();
|
|
2381
|
-
case File$3:
|
|
2382
|
-
return getMenuEntries$b(props.platform);
|
|
2383
|
-
case Go$2:
|
|
2384
|
-
return getMenuEntries$a();
|
|
2385
|
-
case Help$3:
|
|
2386
|
-
return getMenuEntries$9(props.platform);
|
|
2387
|
-
case OpenRecent$1:
|
|
2388
|
-
return getMenuEntries$4();
|
|
2389
|
-
case Run$2:
|
|
2390
|
-
return getMenuEntries$8();
|
|
2391
|
-
case Selection$2:
|
|
2392
|
-
return getMenuEntries$7();
|
|
2393
|
-
case Terminal$2:
|
|
2394
|
-
return getMenuEntries$6();
|
|
2395
|
-
case TitleBarContextMenu:
|
|
2396
|
-
case MenuIdTitleBarContextMenu:
|
|
2397
|
-
return getMenuEntriesTitleBarContextMenu(state);
|
|
2398
|
-
case View$2:
|
|
2399
|
-
return getMenuEntries$5();
|
|
2400
|
-
default:
|
|
2401
|
-
return [];
|
|
2402
|
-
}
|
|
2403
|
-
};
|
|
2404
|
-
|
|
2405
2479
|
const maximize = async () => {
|
|
2406
|
-
await
|
|
2480
|
+
await maximizeWindow();
|
|
2407
2481
|
};
|
|
2408
2482
|
const minimize = async () => {
|
|
2409
|
-
await
|
|
2483
|
+
await minimizeWindow();
|
|
2410
2484
|
};
|
|
2411
2485
|
const close = async () => {
|
|
2412
|
-
await
|
|
2486
|
+
await closeWindow();
|
|
2413
2487
|
};
|
|
2414
2488
|
|
|
2415
2489
|
const handleClickClose = async state => {
|
|
@@ -2443,8 +2517,7 @@ const handleClick$1 = async (state, className) => {
|
|
|
2443
2517
|
};
|
|
2444
2518
|
|
|
2445
2519
|
const show2 = async (uid, menuId, x, y, args) => {
|
|
2446
|
-
|
|
2447
|
-
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
2520
|
+
await showContextMenu2(uid, menuId, x, y, args);
|
|
2448
2521
|
};
|
|
2449
2522
|
|
|
2450
2523
|
const handleContextMenu = async (state, button, eventX, eventY) => {
|
|
@@ -2788,100 +2861,6 @@ const getTitle = workspaceUri => {
|
|
|
2788
2861
|
return baseName;
|
|
2789
2862
|
};
|
|
2790
2863
|
|
|
2791
|
-
const getMenuEntries$3 = () => {
|
|
2792
|
-
return [{
|
|
2793
|
-
command: '',
|
|
2794
|
-
flags: SubMenu$1,
|
|
2795
|
-
id: File$1,
|
|
2796
|
-
label: file()
|
|
2797
|
-
}, {
|
|
2798
|
-
command: '',
|
|
2799
|
-
flags: SubMenu$1,
|
|
2800
|
-
id: Edit,
|
|
2801
|
-
label: edit()
|
|
2802
|
-
}, {
|
|
2803
|
-
command: '',
|
|
2804
|
-
flags: SubMenu$1,
|
|
2805
|
-
id: Selection,
|
|
2806
|
-
label: selection()
|
|
2807
|
-
}, {
|
|
2808
|
-
command: '',
|
|
2809
|
-
flags: SubMenu$1,
|
|
2810
|
-
id: View,
|
|
2811
|
-
label: view()
|
|
2812
|
-
}, {
|
|
2813
|
-
command: '',
|
|
2814
|
-
flags: SubMenu$1,
|
|
2815
|
-
id: Go,
|
|
2816
|
-
label: go()
|
|
2817
|
-
}, {
|
|
2818
|
-
command: '',
|
|
2819
|
-
flags: SubMenu$1,
|
|
2820
|
-
id: Run,
|
|
2821
|
-
keyboardShortCut: 'Alt+r',
|
|
2822
|
-
label: run()
|
|
2823
|
-
}, {
|
|
2824
|
-
command: '',
|
|
2825
|
-
flags: SubMenu$1,
|
|
2826
|
-
id: Terminal,
|
|
2827
|
-
keyboardShortCut: 'Alt+t',
|
|
2828
|
-
label: terminal()
|
|
2829
|
-
}, {
|
|
2830
|
-
command: '',
|
|
2831
|
-
flags: SubMenu$1,
|
|
2832
|
-
id: Help$1,
|
|
2833
|
-
keyboardShortCut: 'Alt+h',
|
|
2834
|
-
label: help()
|
|
2835
|
-
}];
|
|
2836
|
-
};
|
|
2837
|
-
|
|
2838
|
-
const getMenuEntries$2 = () => {
|
|
2839
|
-
return [{
|
|
2840
|
-
command: '',
|
|
2841
|
-
flags: None$1,
|
|
2842
|
-
id: File$1,
|
|
2843
|
-
label: file()
|
|
2844
|
-
}, {
|
|
2845
|
-
command: '',
|
|
2846
|
-
flags: None$1,
|
|
2847
|
-
id: Edit,
|
|
2848
|
-
label: edit()
|
|
2849
|
-
}, {
|
|
2850
|
-
command: '',
|
|
2851
|
-
flags: None$1,
|
|
2852
|
-
id: Selection,
|
|
2853
|
-
label: selection()
|
|
2854
|
-
}, {
|
|
2855
|
-
command: '',
|
|
2856
|
-
flags: None$1,
|
|
2857
|
-
id: View,
|
|
2858
|
-
label: view()
|
|
2859
|
-
}, {
|
|
2860
|
-
command: '',
|
|
2861
|
-
flags: None$1,
|
|
2862
|
-
id: Go,
|
|
2863
|
-
label: go()
|
|
2864
|
-
}, {
|
|
2865
|
-
command: '',
|
|
2866
|
-
flags: None$1,
|
|
2867
|
-
id: Help$1,
|
|
2868
|
-
label: help()
|
|
2869
|
-
}];
|
|
2870
|
-
};
|
|
2871
|
-
|
|
2872
|
-
const getFn$1 = platform => {
|
|
2873
|
-
switch (platform) {
|
|
2874
|
-
case Web:
|
|
2875
|
-
return getMenuEntries$2;
|
|
2876
|
-
default:
|
|
2877
|
-
return getMenuEntries$3;
|
|
2878
|
-
}
|
|
2879
|
-
};
|
|
2880
|
-
const getMenuEntries$1 = async platform => {
|
|
2881
|
-
const fn = getFn$1(platform);
|
|
2882
|
-
return fn();
|
|
2883
|
-
};
|
|
2884
|
-
|
|
2885
2864
|
const loadContent2 = async state => {
|
|
2886
2865
|
const {
|
|
2887
2866
|
controlsOverlayEnabled,
|
|
@@ -2893,12 +2872,15 @@ const loadContent2 = async state => {
|
|
|
2893
2872
|
platform,
|
|
2894
2873
|
titleBarStyleCustom
|
|
2895
2874
|
} = state;
|
|
2896
|
-
const titleBarEntries = await getMenuEntries$
|
|
2875
|
+
const titleBarEntries = await getMenuEntries$2(platform);
|
|
2897
2876
|
const withWidths = addWidths(titleBarEntries, labelPadding, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
|
|
2898
2877
|
const buttons = getTitleBarButtons(platform, controlsOverlayEnabled, titleBarStyleCustom);
|
|
2899
2878
|
const workspaceUri = await invoke('Workspace.getUri');
|
|
2900
2879
|
const title = getTitle(workspaceUri);
|
|
2901
2880
|
const iconWidth = 30;
|
|
2881
|
+
if (titleBarStyleCustom === false) {
|
|
2882
|
+
return hydrate(state);
|
|
2883
|
+
}
|
|
2902
2884
|
return {
|
|
2903
2885
|
...state,
|
|
2904
2886
|
buttons,
|
|
@@ -3363,9 +3345,16 @@ const getTitleBarVirtualDom = state => {
|
|
|
3363
3345
|
titleBarEntries,
|
|
3364
3346
|
titleBarIconEnabled,
|
|
3365
3347
|
titleBarMenuBarEnabled,
|
|
3348
|
+
titleBarStyleCustom,
|
|
3366
3349
|
titleBarTitleEnabled,
|
|
3367
3350
|
width
|
|
3368
3351
|
} = state;
|
|
3352
|
+
if (titleBarStyleCustom) {
|
|
3353
|
+
return [{
|
|
3354
|
+
childCount: 0,
|
|
3355
|
+
type: Div$1
|
|
3356
|
+
}];
|
|
3357
|
+
}
|
|
3369
3358
|
const iconSrc = getIcon(assetDir);
|
|
3370
3359
|
const visibleEntries = getVisibleTitleBarEntries(titleBarEntries, width, focusedIndex, isMenuOpen);
|
|
3371
3360
|
return [{
|
|
@@ -3723,17 +3712,17 @@ const getFn = id => {
|
|
|
3723
3712
|
case Help$3:
|
|
3724
3713
|
return getMenuEntries$9;
|
|
3725
3714
|
case OpenRecent$1:
|
|
3726
|
-
return getMenuEntries$4;
|
|
3727
|
-
case Run$2:
|
|
3728
3715
|
return getMenuEntries$8;
|
|
3729
|
-
case
|
|
3716
|
+
case Run$2:
|
|
3730
3717
|
return getMenuEntries$7;
|
|
3731
|
-
case
|
|
3718
|
+
case Selection$2:
|
|
3732
3719
|
return getMenuEntries$6;
|
|
3720
|
+
case Terminal$2:
|
|
3721
|
+
return getMenuEntries$5;
|
|
3733
3722
|
case TitleBar$1:
|
|
3734
|
-
return getMenuEntries$
|
|
3723
|
+
return getMenuEntries$2;
|
|
3735
3724
|
case View$2:
|
|
3736
|
-
return getMenuEntries$
|
|
3725
|
+
return getMenuEntries$1;
|
|
3737
3726
|
default:
|
|
3738
3727
|
return undefined;
|
|
3739
3728
|
}
|