-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add cleaner titlebar visibility options #1327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
b77d7c2
ca6f83f
cdcfa19
c8d561c
7385a01
d5cf95a
6b281dc
3e75be2
cf3a132
6244e49
d7d6c60
945881b
cc51646
dc394ad
9ecefc5
239ec1d
a82fa63
18d2d5f
5cd4b30
67f2bda
afd2d21
278a2ff
5c42da4
f1e0abe
8d96c97
ae0a4e3
b61698c
87ee59f
39d8cc2
3a41872
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,30 @@ import Combine | |
| import ObjectiveC.runtime | ||
| import Darwin | ||
|
|
||
| final class MainWindowHostingView<Content: View>: NSHostingView<Content> { | ||
| private let zeroSafeAreaLayoutGuide = NSLayoutGuide() | ||
|
|
||
| override var safeAreaInsets: NSEdgeInsets { NSEdgeInsetsZero } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Overriding Useful? React with 👍 / 👎. |
||
| override var safeAreaRect: NSRect { bounds } | ||
| override var safeAreaLayoutGuide: NSLayoutGuide { zeroSafeAreaLayoutGuide } | ||
|
|
||
| required init(rootView: Content) { | ||
| super.init(rootView: rootView) | ||
| addLayoutGuide(zeroSafeAreaLayoutGuide) | ||
| NSLayoutConstraint.activate([ | ||
| zeroSafeAreaLayoutGuide.leadingAnchor.constraint(equalTo: leadingAnchor), | ||
| zeroSafeAreaLayoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor), | ||
| zeroSafeAreaLayoutGuide.topAnchor.constraint(equalTo: topAnchor), | ||
| zeroSafeAreaLayoutGuide.bottomAnchor.constraint(equalTo: bottomAnchor), | ||
| ]) | ||
| } | ||
|
|
||
| @available(*, unavailable) | ||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
| } | ||
|
|
||
| #if DEBUG | ||
| enum CmuxTypingTiming { | ||
| static let isEnabled: Bool = { | ||
|
|
@@ -5371,7 +5395,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent | |
| } else { | ||
| window.center() | ||
| } | ||
| window.contentView = NSHostingView(rootView: root) | ||
| window.contentView = MainWindowHostingView(rootView: root) | ||
|
|
||
| // Apply shared window styling. | ||
| attachUpdateAccessory(to: window) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 8792
🏁 Script executed:
rg -n "enum ChromeControlsVisibilityMode" -A 20 --type swiftRepository: manaflow-ai/cmux
Length of output: 1632
🏁 Script executed:
rg -n "extension ChromeControlsVisibilityMode" -A 15 --type swiftRepository: manaflow-ai/cmux
Length of output: 1056
Add separate mode display name keys for
paneTabBarControlsor explicitly document intentional key sharing.The
paneTabBarControlspicker usesChromeControlsVisibilityMode.displayName, which hardcodes localization keys fromsettings.app.titlebarControls.alwaysandsettings.app.titlebarControls.hover(lines 3047-3049 in cmuxApp.swift). While both controls share the same enum, this creates implicit coupling.Consider either:
settings.app.paneTabBarControls.alwaysandsettings.app.paneTabBarControls.hoverkeys to the localization file for independent control, ordisplayNameimplementation to make the key sharing explicit and documented in code.Currently, changes to titlebar mode labels would unintentionally affect pane tab bar mode labels.
🤖 Prompt for AI Agents