mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-19 21:11:32 +01:00
Add native titlebar setting (#837)
This commit is contained in:
parent
8de1c53c1e
commit
0f09a70836
@ -96,7 +96,7 @@ tasks:
|
|||||||
sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}}
|
sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}}
|
||||||
GO_LDFLAGS: -linkmode 'external' -extldflags=-static
|
GO_LDFLAGS: -linkmode 'external' -extldflags=-static
|
||||||
GO_ENV_VARS:
|
GO_ENV_VARS:
|
||||||
sh: echo "CC=\"zig cc -target {{if eq "arm" ARCH}}aarch64{{else}}x86_64{{end}}-linux-gnu.2.23\""
|
sh: echo "CC=\"zig cc -target {{if eq "arm" ARCH}}aarch64-linux-gnu{{else}}x86_64-linux-gnu.2.23{{end}}\""
|
||||||
|
|
||||||
build:server:internal:
|
build:server:internal:
|
||||||
requires:
|
requires:
|
||||||
|
@ -336,8 +336,10 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi
|
|||||||
height: winHeight,
|
height: winHeight,
|
||||||
};
|
};
|
||||||
winBounds = ensureBoundsAreVisible(winBounds);
|
winBounds = ensureBoundsAreVisible(winBounds);
|
||||||
|
const settings = fullConfig?.settings;
|
||||||
const winOpts: Electron.BrowserWindowConstructorOptions = {
|
const winOpts: Electron.BrowserWindowConstructorOptions = {
|
||||||
titleBarStyle: unamePlatform === "darwin" ? "hiddenInset" : "hidden",
|
titleBarStyle:
|
||||||
|
unamePlatform === "darwin" ? "hiddenInset" : settings["window:nativetitlebar"] ? "default" : "hidden",
|
||||||
titleBarOverlay:
|
titleBarOverlay:
|
||||||
unamePlatform !== "darwin"
|
unamePlatform !== "darwin"
|
||||||
? {
|
? {
|
||||||
@ -362,7 +364,6 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi
|
|||||||
show: false,
|
show: false,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
};
|
};
|
||||||
const settings = fullConfig?.settings;
|
|
||||||
const isTransparent = settings?.["window:transparent"] ?? false;
|
const isTransparent = settings?.["window:transparent"] ?? false;
|
||||||
const isBlur = !isTransparent && (settings?.["window:blur"] ?? false);
|
const isBlur = !isTransparent && (settings?.["window:blur"] ?? false);
|
||||||
if (isTransparent) {
|
if (isTransparent) {
|
||||||
@ -652,6 +653,10 @@ if (unamePlatform !== "darwin") {
|
|||||||
const fac = new FastAverageColor();
|
const fac = new FastAverageColor();
|
||||||
|
|
||||||
electron.ipcMain.on("update-window-controls-overlay", async (event, rect: Dimensions) => {
|
electron.ipcMain.on("update-window-controls-overlay", async (event, rect: Dimensions) => {
|
||||||
|
// Bail out if the user requests the native titlebar
|
||||||
|
const fullConfig = await services.FileService.GetFullConfig();
|
||||||
|
if (fullConfig.settings["window:nativetitlebar"]) return;
|
||||||
|
|
||||||
const zoomFactor = event.sender.getZoomFactor();
|
const zoomFactor = event.sender.getZoomFactor();
|
||||||
const electronRect: Electron.Rectangle = {
|
const electronRect: Electron.Rectangle = {
|
||||||
x: rect.left * zoomFactor,
|
x: rect.left * zoomFactor,
|
||||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -439,6 +439,7 @@ declare global {
|
|||||||
"window:bgcolor"?: string;
|
"window:bgcolor"?: string;
|
||||||
"window:reducedmotion"?: boolean;
|
"window:reducedmotion"?: boolean;
|
||||||
"window:tilegapsize"?: number;
|
"window:tilegapsize"?: number;
|
||||||
|
"window:nativetitlebar"?: boolean;
|
||||||
"telemetry:*"?: boolean;
|
"telemetry:*"?: boolean;
|
||||||
"telemetry:enabled"?: boolean;
|
"telemetry:enabled"?: boolean;
|
||||||
};
|
};
|
||||||
|
@ -46,6 +46,7 @@ const (
|
|||||||
ConfigKey_WindowBgColor = "window:bgcolor"
|
ConfigKey_WindowBgColor = "window:bgcolor"
|
||||||
ConfigKey_WindowReducedMotion = "window:reducedmotion"
|
ConfigKey_WindowReducedMotion = "window:reducedmotion"
|
||||||
ConfigKey_WindowTileGapSize = "window:tilegapsize"
|
ConfigKey_WindowTileGapSize = "window:tilegapsize"
|
||||||
|
ConfigKey_WindowNativeTitleBar = "window:nativetitlebar"
|
||||||
|
|
||||||
ConfigKey_TelemetryClear = "telemetry:*"
|
ConfigKey_TelemetryClear = "telemetry:*"
|
||||||
ConfigKey_TelemetryEnabled = "telemetry:enabled"
|
ConfigKey_TelemetryEnabled = "telemetry:enabled"
|
||||||
|
@ -80,6 +80,7 @@ type SettingsType struct {
|
|||||||
WindowBgColor string `json:"window:bgcolor,omitempty"`
|
WindowBgColor string `json:"window:bgcolor,omitempty"`
|
||||||
WindowReducedMotion bool `json:"window:reducedmotion,omitempty"`
|
WindowReducedMotion bool `json:"window:reducedmotion,omitempty"`
|
||||||
WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"`
|
WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"`
|
||||||
|
WindowNativeTitleBar bool `json:"window:nativetitlebar,omitempty"`
|
||||||
|
|
||||||
TelemetryClear bool `json:"telemetry:*,omitempty"`
|
TelemetryClear bool `json:"telemetry:*,omitempty"`
|
||||||
TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`
|
TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`
|
||||||
|
Loading…
Reference in New Issue
Block a user