Skip to content

Commit c374dea

Browse files
committed
Moved the button above the spellchecker switch b ecause the spellchecker switch has a subtitle associated with it that I don'tk now how to move so this makes more sense.
1 parent b252d60 commit c374dea

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

app/common/typed-ipc.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export type MainMessage = {
55
"clear-app-settings": () => void;
66
"configure-spell-checker": () => void;
77
"fetch-user-agent": () => string;
8-
'zoom-other-tabs': (zoomLevel: number) => void;
98
"focus-app": () => void;
109
"focus-this-webview": () => void;
1110
"new-clipboard-key": () => {key: Uint8Array; sig: Uint8Array};
@@ -19,12 +18,12 @@ export type MainMessage = {
1918
"toggle-app": () => void;
2019
"toggle-badge-option": (newValue: boolean) => void;
2120
"toggle-menubar": (showMenubar: boolean) => void;
22-
"toggle-one-zoom": (newValue: boolean) => void;
2321
toggleAutoLauncher: (AutoLaunchValue: boolean) => void;
2422
"unread-count": (unreadCount: number) => void;
2523
"update-badge": (messageCount: number) => void;
2624
"update-menu": (properties: MenuProperties) => void;
2725
"update-taskbar-icon": (data: string, text: string) => void;
26+
"zoom-other-tabs": (zoomLevel: number) => void;
2827
};
2928

3029
export type MainCall = {

app/main/index.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import {sentryInit} from "./sentry.js";
3131
import {setAutoLaunch} from "./startup.js";
3232
import {ipcMain, send} from "./typed-ipc-main.js";
3333

34-
35-
3634
import "gatemaker/electron-setup"; // eslint-disable-line import/no-unassigned-import
3735

3836
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -156,6 +154,7 @@ function createMainWindow(): BrowserWindow {
156154
app.quit();
157155
return;
158156
}
157+
159158
await app.whenReady();
160159

161160
if (process.env.GDK_BACKEND !== GDK_BACKEND) {
@@ -280,13 +279,13 @@ function createMainWindow(): BrowserWindow {
280279
}
281280
});
282281

283-
ipcMain.on('zoom-other-tabs', (event, zoomLevel) => {
284-
BrowserWindow.getAllWindows().forEach((window) => {
285-
window.webContents.setZoomLevel(zoomLevel);
286-
});
282+
ipcMain.on("zoom-other-tabs", (event, zoomLevel) => {
283+
const windows = BrowserWindow.getAllWindows();
284+
for (const window of windows) {
285+
window.webContents.setZoomLevel(zoomLevel);
286+
}
287287
});
288288

289-
290289
ipcMain.on("fetch-user-agent", (event) => {
291290
event.returnValue = session
292291
.fromPartition("persist:webviewsession")

app/renderer/js/components/webview.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type {WebContents} from "electron/main";
22
import fs from "node:fs";
33
import process from "node:process";
4-
//import { ipcRenderer } from 'electron';
54

65
import * as remote from "@electron/remote";
76
import {app, dialog} from "@electron/remote";
@@ -159,15 +158,6 @@ export default class WebView {
159158
this.show();
160159
}
161160

162-
private syncZooms(): void {
163-
// Sync zoom level with other tabs if useOneZoom is enabled
164-
const useOneZoom = ConfigUtil.getConfigItem("useOneZoom", true);
165-
if(useOneZoom) {
166-
const zoomLevel = this.getWebContents().zoomLevel;
167-
ipcRenderer.send('zoom-other-tabs', zoomLevel);
168-
}
169-
}
170-
171161
zoomIn(): void {
172162
this.getWebContents().zoomLevel += 0.5;
173163
this.syncZooms();
@@ -237,6 +227,15 @@ export default class WebView {
237227
ipcRenderer.send("forward-to", this.webContentsId, channel, ...arguments_);
238228
}
239229

230+
private syncZooms(): void {
231+
// Sync zoom level with other tabs if useOneZoom is enabled
232+
const useOneZoom = ConfigUtil.getConfigItem("useOneZoom", true);
233+
if (useOneZoom) {
234+
const zoomLevel = this.getWebContents().getZoomLevel();
235+
ipcRenderer.send("zoom-other-tabs", zoomLevel);
236+
}
237+
}
238+
240239
private registerListeners(): void {
241240
const webContents = this.getWebContents();
242241

app/renderer/js/pages/preference/general-section.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,16 @@ export function initGeneralSection({$root}: GeneralSectionProperties): void {
126126
</div>
127127
<div class="setting-control"></div>
128128
</div>
129-
<div class="setting-row" id="enable-spellchecker-option">
129+
<div class="setting-row" id="one-zoom-option">
130130
<div class="setting-description">
131-
${t.__("Enable spellchecker (requires restart)")}
131+
${t.__("Use one zoom for all server tabs")}
132132
</div>
133133
<div class="setting-control"></div>
134134
</div>
135-
<div class="setting-row" id="one-zoom-option">
135+
<div class="setting-row" id="enable-spellchecker-option">
136136
<div class="setting-description">
137-
${t.__("Use one zoom for all server tabs")}</div>
137+
${t.__("Enable spellchecker (requires restart)")}
138+
</div>
138139
<div class="setting-control"></div>
139140
</div>
140141
<div
@@ -277,9 +278,11 @@ export function initGeneralSection({$root}: GeneralSectionProperties): void {
277278
const newValue = !ConfigUtil.getConfigItem("useOneZoom", false);
278279
ConfigUtil.setConfigItem("useOneZoom", newValue);
279280
useOneZoom();
281+
if (newValue) {
282+
ipcRenderer.send("zoom-other-tabs", 1);
283+
}
280284
},
281-
})
282-
return;
285+
});
283286
}
284287

285288
function updateMenubarOption(): void {

0 commit comments

Comments
 (0)