desktop: fix title bar for macos

This commit is contained in:
Ammar Ahmed
2024-03-31 00:28:28 +05:00
committed by Abdullah Atta
parent 23bd4a564f
commit be5d0820d5
3 changed files with 23 additions and 9 deletions

View File

@@ -181,9 +181,10 @@ export const osIntegrationRouter = t.router({
({ input: { theme, windowControlsIconColor, backgroundColor } }) => {
if (windowControlsIconColor) {
config.windowControlsIconColor = windowControlsIconColor;
globalThis.window?.setTitleBarOverlay({
symbolColor: windowControlsIconColor
});
if (process.platform === "win32")
globalThis.window?.setTitleBarOverlay({
symbolColor: windowControlsIconColor
});
}
if (backgroundColor) {

View File

@@ -89,6 +89,10 @@ async function createWindow() {
color: "#00000000",
symbolColor: config.windowControlsIconColor
},
trafficLightPosition: {
x: 16,
y: 12
},
webPreferences: {
zoomFactor: config.zoomFactor,

View File

@@ -183,11 +183,20 @@ export function EditorActionBar() {
return (
<ScopedThemeProvider scope="titleBar" injectCssVars>
<Flex sx={{ gap: 2, borderBottom: "1px solid var(--border)", pl: 2 }}>
<Flex
sx={{
gap: 2,
borderBottom: "1px solid var(--border)",
px: 2,
...(IS_DESKTOP_APP && !isFullscreen && !hasNativeWindowControls
? getPlatform() === "darwin"
? { pl: "calc(100vw - env(titlebar-area-width))" }
: { pr: "calc(100vw - env(titlebar-area-width))" }
: {})
}}
>
{IS_DESKTOP_APP ? (
getPlatform() === "darwin" && !isFullscreen ? (
<></>
) : (
getPlatform() === "darwin" && !isFullscreen ? null : (
<svg
className="titlebarLogo"
style={{
@@ -207,8 +216,8 @@ export function EditorActionBar() {
// borderRadius: "default",
// overflow: "hidden",
alignItems: "center",
justifyContent: "flex-end",
mr: IS_DESKTOP_APP ? `calc(100vw - env(titlebar-area-width))` : 2
justifyContent: "flex-end"
// mr: IS_DESKTOP_APP ? `calc(100vw - env(titlebar-area-width))` : 2
}}
>
{tools.map((tool) => (