color gray on the git test files + dock menu
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
This commit is contained in:
@@ -122,7 +122,7 @@ async function openFolderFlow(win: BrowserWindow | null): Promise<boolean> {
|
||||
startWatcher()
|
||||
startConfigWatcher()
|
||||
startGitWatcher()
|
||||
syncWindowTitle()
|
||||
syncProjectChrome()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -196,8 +196,17 @@ function buildAppMenu(): Menu {
|
||||
/** macOS Dock right-click menu. Sits above the system items (Show All Windows,
|
||||
* Hide, Quit) that macOS appends itself. It mirrors File → New Window so a new
|
||||
* project window is one right-click away, even with no window focused. */
|
||||
/**
|
||||
* macOS reads the Dock tile's name from the bundle's CFBundleName at launch, so
|
||||
* every Helder process shows the same "Helder" tooltip — `app.setName()` moves
|
||||
* the menu-bar name and the paths, but never the Dock label. The open project is
|
||||
* therefore named in the Dock *menu* instead: a disabled first item, so a
|
||||
* right-click tells the two tiles apart.
|
||||
*/
|
||||
function buildDockMenu(): Menu {
|
||||
const name = getName()
|
||||
return Menu.buildFromTemplate([
|
||||
...(name ? [{ label: name, enabled: false }, { type: 'separator' as const }] : []),
|
||||
{ label: 'New Window', click: () => spawnInstance() },
|
||||
])
|
||||
}
|
||||
@@ -270,7 +279,7 @@ function registerIpc(): void {
|
||||
setRoot(path)
|
||||
const r = getRoot()
|
||||
if (r) { await resolveConfig(r); startWatcher(); startConfigWatcher(); startGitWatcher() }
|
||||
syncWindowTitle()
|
||||
syncProjectChrome()
|
||||
broadcast('project:changed')
|
||||
return { root: getRoot(), name: getName() }
|
||||
})
|
||||
@@ -338,11 +347,13 @@ function registerIpc(): void {
|
||||
})
|
||||
}
|
||||
|
||||
/** The window title is the open project's folder name (falling back to the app
|
||||
* name when nothing is open). Push it to every window after a project change. */
|
||||
function syncWindowTitle(): void {
|
||||
/** The window title and the Dock menu both carry the open project's folder name
|
||||
* (the title falls back to the app name when nothing is open). Push both after a
|
||||
* project change. */
|
||||
function syncProjectChrome(): void {
|
||||
const title = getName() || 'Helder'
|
||||
for (const w of BrowserWindow.getAllWindows()) w.setTitle(title)
|
||||
app.dock?.setMenu(buildDockMenu())
|
||||
}
|
||||
|
||||
function createWindow(): void {
|
||||
|
||||
Reference in New Issue
Block a user