chore: merge dev into v2
This commit is contained in:
commit
f39bdd86ce
150 changed files with 8974 additions and 751 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@opencode-ai/desktop",
|
||||
"private": true,
|
||||
"version": "1.17.14",
|
||||
"version": "1.17.15",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"homepage": "https://opencode.ai",
|
||||
|
|
|
|||
|
|
@ -71,7 +71,10 @@ export function setAppQuitting(quitting = true) {
|
|||
|
||||
export function setBackgroundColor(color: string) {
|
||||
backgroundColor = color
|
||||
BrowserWindow.getAllWindows().forEach((win) => win.setBackgroundColor(color))
|
||||
BrowserWindow.getAllWindows().forEach((win) => {
|
||||
win.setBackgroundColor(color)
|
||||
if (process.platform === "darwin") win.invalidateShadow()
|
||||
})
|
||||
}
|
||||
|
||||
export function getBackgroundColor(): string | undefined {
|
||||
|
|
@ -106,6 +109,13 @@ function overlay(theme: Partial<TitlebarTheme> = {}, zoom = 1) {
|
|||
|
||||
export function setTitlebar(win: BrowserWindow, theme: Partial<TitlebarTheme> = {}) {
|
||||
titlebarThemes.set(win, theme)
|
||||
// macOS draws the window frame hairline and shadow using the NSWindow
|
||||
// appearance, which follows nativeTheme rather than the rendered content.
|
||||
// Align it with the app theme so a light app on a dark system does not get
|
||||
// the dark-appearance border and shadow. A "system" scheme must map to
|
||||
// "system" (not the resolved mode) or prefers-color-scheme stops tracking
|
||||
// OS appearance changes in the renderer.
|
||||
if (process.platform === "darwin") nativeTheme.themeSource = theme.scheme ?? theme.mode ?? "system"
|
||||
updateTitlebar(win)
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +182,7 @@ export function createMainWindow(id: string = randomUUID()) {
|
|||
...(process.platform === "darwin"
|
||||
? {
|
||||
titleBarStyle: "hidden" as const,
|
||||
trafficLightPosition: { x: 12, y: 14 },
|
||||
trafficLightPosition: { x: 14, y: 14 },
|
||||
}
|
||||
: {}),
|
||||
...(process.platform === "win32"
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export type UpdaterAPI = {
|
|||
export type LinuxDisplayBackend = "wayland" | "auto"
|
||||
export type TitlebarTheme = {
|
||||
mode: "light" | "dark"
|
||||
scheme?: "system" | "light" | "dark"
|
||||
}
|
||||
export type FatalRendererError = {
|
||||
error: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue