fixed: fixed missing background on older macOS (#3015)

This commit is contained in:
Serhiy Mytrovtsiy
2026-03-08 19:06:08 +01:00
parent 37266d2fe1
commit 1744d687d0
4 changed files with 25 additions and 5 deletions

View File

@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>754</string>
<string>756</string>
<key>Description</key>
<string>Simple macOS system monitor in your menu bar</string>
<key>LSApplicationCategoryType</key>

View File

@@ -219,14 +219,34 @@ class SettingsWindow: NSWindow, NSWindowDelegate, NSToolbarDelegate {
private class MainView: NSView {
fileprivate let container: NSStackView = NSStackView()
private let background: NSVisualEffectView = {
let view = NSVisualEffectView(frame: NSRect.zero)
view.blendingMode = .withinWindow
view.material = .contentBackground
view.state = .active
view.translatesAutoresizingMaskIntoConstraints = false
view.setContentHuggingPriority(.defaultLow, for: .horizontal)
view.setContentHuggingPriority(.defaultLow, for: .vertical)
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
view.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
return view
}()
override init(frame: NSRect) {
super.init(frame: NSRect.zero)
self.translatesAutoresizingMaskIntoConstraints = false
self.container.translatesAutoresizingMaskIntoConstraints = false
self.addSubview(self.background, positioned: .below, relativeTo: .none)
self.addSubview(self.container)
NSLayoutConstraint.activate([
self.background.leadingAnchor.constraint(equalTo: leadingAnchor),
self.background.trailingAnchor.constraint(equalTo: trailingAnchor),
self.background.topAnchor.constraint(equalTo: topAnchor),
self.background.bottomAnchor.constraint(equalTo: bottomAnchor),
self.container.leadingAnchor.constraint(equalTo: leadingAnchor),
self.container.trailingAnchor.constraint(equalTo: trailingAnchor),
self.container.topAnchor.constraint(equalTo: topAnchor, constant: Constants.Popup.headerHeight*1.4),