mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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}}
|
||||
GO_LDFLAGS: -linkmode 'external' -extldflags=-static
|
||||
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:
|
||||
requires:
|
||||
|
@ -336,8 +336,10 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi
|
||||
height: winHeight,
|
||||
};
|
||||
winBounds = ensureBoundsAreVisible(winBounds);
|
||||
const settings = fullConfig?.settings;
|
||||
const winOpts: Electron.BrowserWindowConstructorOptions = {
|
||||
titleBarStyle: unamePlatform === "darwin" ? "hiddenInset" : "hidden",
|
||||
titleBarStyle:
|
||||
unamePlatform === "darwin" ? "hiddenInset" : settings["window:nativetitlebar"] ? "default" : "hidden",
|
||||
titleBarOverlay:
|
||||
unamePlatform !== "darwin"
|
||||
? {
|
||||
@ -362,7 +364,6 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
};
|
||||
const settings = fullConfig?.settings;
|
||||
const isTransparent = settings?.["window:transparent"] ?? false;
|
||||
const isBlur = !isTransparent && (settings?.["window:blur"] ?? false);
|
||||
if (isTransparent) {
|
||||
@ -652,6 +653,10 @@ if (unamePlatform !== "darwin") {
|
||||
const fac = new FastAverageColor();
|
||||
|
||||
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 electronRect: Electron.Rectangle = {
|
||||
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:reducedmotion"?: boolean;
|
||||
"window:tilegapsize"?: number;
|
||||
"window:nativetitlebar"?: boolean;
|
||||
"telemetry:*"?: boolean;
|
||||
"telemetry:enabled"?: boolean;
|
||||
};
|
||||
|
@ -46,6 +46,7 @@ const (
|
||||
ConfigKey_WindowBgColor = "window:bgcolor"
|
||||
ConfigKey_WindowReducedMotion = "window:reducedmotion"
|
||||
ConfigKey_WindowTileGapSize = "window:tilegapsize"
|
||||
ConfigKey_WindowNativeTitleBar = "window:nativetitlebar"
|
||||
|
||||
ConfigKey_TelemetryClear = "telemetry:*"
|
||||
ConfigKey_TelemetryEnabled = "telemetry:enabled"
|
||||
|
@ -73,13 +73,14 @@ type SettingsType struct {
|
||||
WidgetClear bool `json:"widget:*,omitempty"`
|
||||
WidgetShowHelp bool `json:"widget:showhelp,omitempty"`
|
||||
|
||||
WindowClear bool `json:"window:*,omitempty"`
|
||||
WindowTransparent bool `json:"window:transparent,omitempty"`
|
||||
WindowBlur bool `json:"window:blur,omitempty"`
|
||||
WindowOpacity *float64 `json:"window:opacity,omitempty"`
|
||||
WindowBgColor string `json:"window:bgcolor,omitempty"`
|
||||
WindowReducedMotion bool `json:"window:reducedmotion,omitempty"`
|
||||
WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"`
|
||||
WindowClear bool `json:"window:*,omitempty"`
|
||||
WindowTransparent bool `json:"window:transparent,omitempty"`
|
||||
WindowBlur bool `json:"window:blur,omitempty"`
|
||||
WindowOpacity *float64 `json:"window:opacity,omitempty"`
|
||||
WindowBgColor string `json:"window:bgcolor,omitempty"`
|
||||
WindowReducedMotion bool `json:"window:reducedmotion,omitempty"`
|
||||
WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"`
|
||||
WindowNativeTitleBar bool `json:"window:nativetitlebar,omitempty"`
|
||||
|
||||
TelemetryClear bool `json:"telemetry:*,omitempty"`
|
||||
TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user