Skip to content

Commit eb86715

Browse files
committed
update electron
1 parent 3ff8161 commit eb86715

6 files changed

Lines changed: 49 additions & 16 deletions

File tree

Assets/Styles/Custom.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,4 +390,24 @@ input::selection {
390390
.button-chide {display:none !important;}
391391
.button-cplay {display:none !important;}
392392
.button-cadd {display:none !important;}
393+
}
394+
395+
[os="Windows"] .win\:autohide {
396+
display:none
397+
}
398+
399+
[os="Windows"] .win\:barfix {
400+
padding-top:0 !important;
401+
margin-top: 0.25rem !important;
402+
}
403+
404+
[os="WindowsLegacy"] .owin\:barfix {
405+
padding-top:0 !important;
406+
margin-top: 0.25rem !important;
407+
}
408+
409+
@media (min-width: 768px) {
410+
[os="Windows"] .win\:autohide {
411+
display:inline-block
412+
}
393413
}

Assets/Styles/Optimized.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,15 +2797,7 @@ ol {
27972797
opacity: 1;
27982798
}
27992799

2800-
[os="Windows"] .win\:autohide {
2801-
display:none
2802-
}
28032800

2804-
@media (min-width: 768px) {
2805-
[os="Windows"] .win\:autohide {
2806-
display:inline-block
2807-
}
2808-
}
28092801

28102802
[os="Windows"] .win\:m-4 {
28112803
margin: 1rem;

Components/ExtendedTopbar.wlx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Component[OptionsPattern[]] := With[{
129129

130130
<div style="z-index: 100;" class="atitlebar flex sticky top-0 z-40 flex h-10 win:h-titlebar owin:h-titlebar linux:h-titlebar shrink-0 items-center osx:border-b border-gray-300 dark:border-gray-500 osx:bg-239 dark:bg-gray-700 dark:win:bg-transparent dark:owin:bg-transparent dark:linux:bg-transparent px-2 osx:pl-20 md:osx:pl-2 osx-zen:pl-20 win:pl-0 owin:pl-0 md:pl-2 win-zen:pl-0 owin-zen:pl-0 linux-zen:pl-0 bro-zen:pl-0">
131131
<Menu/>
132-
<div class="my-auto mr-auto lg:border-r border-gray-300 dark:border-gray-500 pr-1 pt-1 win:pt035 owin:pt035 bro:pt-2 osx:h-fit h-full overflow-hidden">
132+
<div class="my-auto mr-auto lg:border-r border-gray-300 dark:border-gray-500 pr-1 pt-1 win:barfix owin:barfix bro:pt-2 osx:h-fit h-full overflow-hidden">
133133
<button id="sidebar-toggle" title="Toggle sidebar" class="zen:ml-0 text-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md w-8 h-6 bro:ml-0 win:ml-0 owin:ml-0 linux:ml-0">
134134
<svg fill="currentColor" class="w-5 h-5 mr-auto ml-auto" viewBox="0 0 56 56" xmlns="http://www.w3.org/2000/svg">
135135
<path d="M 7.7148 49.5742 L 48.2852 49.5742 C 53.1836 49.5742 55.6446 47.1367 55.6446 42.3086 L 55.6446 13.6914 C 55.6446 8.8633 53.1836 6.4258 48.2852 6.4258 L 7.7148 6.4258 C 2.8398 6.4258 .3554 8.8398 .3554 13.6914 L .3554 42.3086 C .3554 47.1602 2.8398 49.5742 7.7148 49.5742 Z M 7.7851 45.8008 C 5.4413 45.8008 4.1288 44.5586 4.1288 42.1211 L 4.1288 13.8789 C 4.1288 11.4414 5.4413 10.1992 7.7851 10.1992 L 18.2148 10.1992 L 18.2148 45.8008 Z M 48.2147 10.1992 C 50.5350 10.1992 51.8708 11.4414 51.8708 13.8789 L 51.8708 42.1211 C 51.8708 44.5586 50.5350 45.8008 48.2147 45.8008 L 21.8944 45.8008 L 21.8944 10.1992 Z M 13.7148 18.8945 C 14.4179 18.8945 15.0507 18.2617 15.0507 17.5820 C 15.0507 16.8789 14.4179 16.2696 13.7148 16.2696 L 8.6757 16.2696 C 7.9726 16.2696 7.3632 16.8789 7.3632 17.5820 C 7.3632 18.2617 7.9726 18.8945 8.6757 18.8945 Z M 13.7148 24.9649 C 14.4179 24.9649 15.0507 24.3320 15.0507 23.6289 C 15.0507 22.9258 14.4179 22.3398 13.7148 22.3398 L 8.6757 22.3398 C 7.9726 22.3398 7.3632 22.9258 7.3632 23.6289 C 7.3632 24.3320 7.9726 24.9649 8.6757 24.9649 Z M 13.7148 31.0118 C 14.4179 31.0118 15.0507 30.4258 15.0507 29.7227 C 15.0507 29.0196 14.4179 28.4102 13.7148 28.4102 L 8.6757 28.4102 C 7.9726 28.4102 7.3632 29.0196 7.3632 29.7227 C 7.3632 30.4258 7.9726 31.0118 8.6757 31.0118 Z"/>
@@ -149,7 +149,7 @@ Component[OptionsPattern[]] := With[{
149149
<ExtensionTemplates Template={"AppTopBar"} Type={"ExtendedApp"} Path={Path} Parameters={parameters} Modals={modals} AppEvent={AppEvent} Controls={Controls} Messanger={messages}/>
150150

151151
<div class="grow h-full" style="-webkit-app-region: drag; max-width:300px"></div>
152-
<div class="my-auto ml-auto lg:border-l flex border-gray-300 dark:border-gray-500 pl-1 bro:pt-2 h-full osx:h-fit overflow-hidden win:pt035 owin:pt035">
152+
<div class="my-auto ml-auto lg:border-l flex border-gray-300 dark:border-gray-500 pl-1 bro:pt-2 h-full osx:h-fit overflow-hidden win:barfix owin:barfix">
153153
<NotebookOnly Path={Path}>
154154
<List>
155155
<Identity>

Components/Topbar.wlx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Component[OptionsPattern[]] := With[{
129129

130130
<div style="z-index: 100;" class="atitlebar flex sticky top-0 z-40 flex h-10 win:h-titlebar owin:h-titlebar linux:h-titlebar shrink-0 items-center osx:border-b border-gray-300 dark:border-gray-500 osx:bg-239 dark:bg-gray-700 dark:win:bg-transparent dark:owin:bg-transparent dark:linux:bg-transparent px-2 pl-20 win:pl-0 owin:pl-0 linux:pl-2">
131131

132-
<div class="my-auto mr-auto lg:border-r win:pt035 owin:pt035 border-gray-300 dark:border-gray-500 pr-1 flex flex-row linux:pt-fix h-full osx:h-fit overflow-hidden">
132+
<div class="my-auto mr-auto lg:border-r win:barfix owin:barfix border-gray-300 dark:border-gray-500 pr-1 flex flex-row linux:pt-fix h-full osx:h-fit overflow-hidden">
133133
<Menu/>
134134
<NotebookOnly Path={Path}>
135135
<button id="sidebar-save" title="Save" class="win:autohide zen:ml-0 linux:ml-0 text-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700 rounded-md w-7 h-6">
@@ -145,7 +145,7 @@ Component[OptionsPattern[]] := With[{
145145
<ExtensionTemplates Template={"AppTopBar"} Type={"App"} Path={Path} Parameters={parameters} Modals={modals} AppEvent={AppEvent} Controls={Controls} Messanger={messages}/>
146146

147147
<div class="grow h-full" style="-webkit-app-region: drag; max-width:300px"></div>
148-
<div class="my-auto ml-auto lg:border-l flex border-gray-300 dark:border-gray-500 pl-1 h-full osx:h-fit overflow-hidden win:pt035 owin:pt035">
148+
<div class="my-auto ml-auto lg:border-l flex border-gray-300 dark:border-gray-500 pl-1 h-full osx:h-fit overflow-hidden win:barfix owin:barfix">
149149
<NotebookOnly Path={Path}>
150150
<List>
151151
<Identity>

Electron/main.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,8 @@ function create_window(opts, cbk = () => {}) {
15011501
}
15021502

15031503
if (isWindows) {
1504-
options.override.maximizable = false;
1504+
options.disallowFullscreen = true;
1505+
15051506
}
15061507

15071508
if ((new RegExp(/gptchat/)).exec(options.url)) {
@@ -1539,6 +1540,8 @@ function create_window(opts, cbk = () => {}) {
15391540
options.linuxMenuBar = false;
15401541
options.contextMenu = false;
15411542
options.override.maximizable = true;
1543+
options.disallowFullscreen = false;
1544+
//options.override.fullScreenable = true;
15421545
}
15431546

15441547

@@ -1665,6 +1668,24 @@ function create_window(opts, cbk = () => {}) {
16651668
//win.setRoundedCorner();
16661669
}*/
16671670
if (!options.overlay) {
1671+
if (options.disallowFullscreen) {
1672+
/* let maxed = false;
1673+
win.on('maximize', (event) => {
1674+
maxed = !maxed;
1675+
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
1676+
win.unmaximize();
1677+
if (maxed) {
1678+
setTimeout(() => win.setBounds({ x: 0, y: 0, width, height }), 100);
1679+
} else {
1680+
setTimeout(() => win.setBounds({ x: width/4.0, y: height/4.0, width:width/2.0, height:height/2.0 }), 100);
1681+
}
1682+
1683+
});*/
1684+
1685+
//win.setMaximizable(false);
1686+
}
1687+
1688+
16681689
if (!IS_WINDOWS_11 || server.frontend.WindowsLegacy) {
16691690
const checkTheme = () => {
16701691
if (!nativeTheme.shouldUseDarkColors) {
@@ -1685,7 +1706,7 @@ function create_window(opts, cbk = () => {}) {
16851706
//a bug with maximizing the window
16861707
//https://github.com/electron/electron/issues/38743
16871708

1688-
win.once('maximize', () => {
1709+
/*win.once('maximize', () => {
16891710
const checkTheme = () => {
16901711
if (!nativeTheme.shouldUseDarkColors) {
16911712
win.setBackgroundColor("#fff");
@@ -1701,7 +1722,7 @@ function create_window(opts, cbk = () => {}) {
17011722
});
17021723
17031724
checkTheme();
1704-
});
1725+
});*/
17051726

17061727

17071728

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"@playwright/test": "^1.51.0",
188188
"@rollup/plugin-commonjs": "^24.0.1",
189189
"@types/node": "^22.13.10",
190-
"electron": "32.2.5",
190+
"electron": "38.3.0",
191191
"electron-builder": "^25.1.8",
192192
"rollup": "^3.29.3",
193193
"rollup-plugin-combine": "^2.1.1",

0 commit comments

Comments
 (0)