feat(window): use the frameless title bar on Linux (#279)

Linux windows used the GTK menu bar and the system title bar, unlike the frameless main toolbar on Windows.

Linux project and Settings windows now turn off decorations, install no GTK menu bar and draw the main menu and caption buttons in the title bar.

Co-authored-by: xRookieFight <[email protected]>
Цей коміт міститься в:
xRookieFightтаxRookieFight authored and GitHub committed 2026-10-31 12:43:01 +08:00
1 джерело cbdc177bbc
коміт a553dafa7a
8 files changed
+30 -12

No files matched your search

+1 -1
Переглянути файл
@@ -1,5 +1,5 @@
/**
* Windows title bar: IDEA's main menu button. Clicking ☰ expands the menu bar
* Frameless title bar (Windows, Linux): IDEA's main menu button. Clicking ☰ expands the menu bar
* in place (File Edit View …) with File open; hovering another title switches
* menus, ←/→ walk them, and closing the menu collapses the bar again. The
* entries come from the same spec as the native menu (`menu_model`). As in
+1 -1
Переглянути файл
@@ -99,7 +99,7 @@
color: var(--fg-secondary);
}
/* Windows frameless window: caption buttons sit flush with the right and top edges. */
/* Frameless window (Windows, Linux): caption buttons sit flush with the right and top edges. */
.frameless {
padding-right: 0;
}
+2 -2
Переглянути файл
@@ -256,7 +256,7 @@ function ToolbarEntry({ id, items }: { id: string; items: ReadonlyMap<string, Ti
/**
* 40px main toolbar. macOS: native traffic lights overlay its left edge.
* Windows: the window is frameless, so the bar carries IDEA's main menu (☰) and
* Windows and Linux: the window is frameless, so the bar carries IDEA's main menu (☰) and
* the caption buttons. `dialog`: a dialog window's bar (Settings), close button only.
* `lightEdit`: a LightEdit window's bar, its title and the menu but no toolbar widgets.
*/
@@ -279,7 +279,7 @@ export function TitleBar({
const [menuExpanded, setMenuExpanded] = useState(false);
const className = clsx(styles.bar, overlay && styles.overlay, frameless && styles.frameless);
// Distraction Free Mode: the window frame only. Where the title bar carries the
// main menu (Windows) it stays, or nothing would lead back out of the mode.
// main menu (Windows, Linux) it stays, or nothing would lead back out of the mode.
if (bare)
return (
<header className={className} data-tauri-drag-region data-titlebar="bare">
+1 -1
Переглянути файл
@@ -1,5 +1,5 @@
/**
* Windows caption buttons (minimise, maximise / restore, close) for the frameless
* Caption buttons (minimise, maximise / restore, close) for the frameless
* title bar. Dialog windows (Settings) only have close, as in IDEA.
*/
import { useEffect, useState } from "react";