From 6f55861be7a8f01731e5a8ca3e742adb69d32182 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Sun, 27 Sep 2026 10:44:39 +0800 Subject: [PATCH] Keep the keyboard input-source icon visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hiding boundary sat right of the input-source indicator, so the hamburger took the slot where the language icon had been. Move the boundary left of it so the language icon stays, with the hamburger still at the left edge. 💘 Generated with Crush Assisted-by: Crush:deepseek-v4.1-flash --- README.md | 15 +++++---------- Sources/SimpleTopBar/App.swift | 2 +- Sources/SimpleTopBar/MenuBarItems.swift | 11 ++++++----- build-app.sh | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ac107c2..bbf283c 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,11 @@ automatically. What it can and cannot hide: - It hides **other third-party apps' icons** (cmux, Kapture, moomoo, WireGuard). -- It **keeps Wi-Fi, Now Playing, Spotlight, Clock, Battery and Control Center** - visible, with the **hamburger at the left edge of that group**. The spacer's - boundary (preferred position 300) falls just left of Now Playing. macOS - reserves the far-right area, so an item can never be placed to the right of - the system icons. -- The input-source indicator is the one system icon that ends up hidden (it sits - immediately left of where the hamburger can go). To keep it, set - `defaults write dev.tzgyn.simpletopbar debug.spacerPos -float 350` and - `debug.hamburgerPos -float 300`, which moves the hamburger one slot to the - right of it. +- It **keeps Wi-Fi, Now Playing, the input-source indicator, Spotlight, Clock, + Battery and Control Center** visible, with the **hamburger at the left edge of + that group**. The spacer's boundary (preferred position 330) falls just left + of the input-source indicator. macOS reserves the far-right area, so an item + can never be placed to the right of the system icons. - Newly launched apps are placed to the left of the spacer, so they are hidden automatically. - Advanced: set `defaults write dev.tzgyn.simpletopbar debug.spacerPos -float ` diff --git a/Sources/SimpleTopBar/App.swift b/Sources/SimpleTopBar/App.swift index f474b82..e2f4bc2 100644 --- a/Sources/SimpleTopBar/App.swift +++ b/Sources/SimpleTopBar/App.swift @@ -109,7 +109,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate { if let override = UserDefaults.standard.object(forKey: "debug.hamburgerPos") as? Double { UserDefaults.standard.set(override, forKey: positionKey) } else if UserDefaults.standard.object(forKey: positionKey) == nil { - UserDefaults.standard.set(290.0, forKey: positionKey) + UserDefaults.standard.set(320.0, forKey: positionKey) } let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) diff --git a/Sources/SimpleTopBar/MenuBarItems.swift b/Sources/SimpleTopBar/MenuBarItems.swift index a5df814..dfe11cd 100644 --- a/Sources/SimpleTopBar/MenuBarItems.swift +++ b/Sources/SimpleTopBar/MenuBarItems.swift @@ -313,14 +313,15 @@ final class MenuBarHider: ObservableObject { // The boundary between "hidden" and "kept" falls just left of Wi-Fi at // ~250, so the other apps hide while Apple's Wi-Fi/Clock/Battery/Control // Center/Spotlight stay visible. `debug.spacerPos` overrides the seed. - // The boundary sits just left of Now Playing, so every Control Center - // item stays visible while the apps hide. It must stay *above* the - // hamburger's preferred position (see AppDelegate) for the hamburger to - // remain on the visible side. `debug.spacerPos` overrides the seed. + // The boundary sits just left of the input-source indicator, so every + // system item (input source, Now Playing, Wi-Fi, …) stays visible while + // the apps hide. It must stay *above* the hamburger's preferred position + // (see AppDelegate) for the hamburger to remain on the visible side. + // `debug.spacerPos` overrides the seed. if let override = UserDefaults.standard.object(forKey: "debug.spacerPos") as? Double { UserDefaults.standard.set(override, forKey: key) } else if UserDefaults.standard.object(forKey: key) == nil { - UserDefaults.standard.set(300.0, forKey: key) + UserDefaults.standard.set(330.0, forKey: key) } let item = NSStatusBar.system.statusItem(withLength: 0) item.autosaveName = name diff --git a/build-app.sh b/build-app.sh index 136e4c7..3bfeb76 100755 --- a/build-app.sh +++ b/build-app.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "$0")" -VERSION="${1:-0.4.6}" +VERSION="${1:-0.4.7}" swift build -c release