mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fixed: fixed missing background on older macOS (#3015)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user