feat: added threshold for network status notification

This commit is contained in:
Serhiy Mytrovtsiy
2025-03-07 17:36:21 +01:00
parent d298d8a199
commit 5a7e4b7e55
2 changed files with 67 additions and 23 deletions

View File

@@ -1464,6 +1464,7 @@ public class StepperInput: NSStackView, NSTextFieldDelegate, PreferencesSwitchWi
_ value: Int,
range: NSRange = NSRange(location: 1, length: 99),
unit: String = "%",
visibileUnit: Bool = true,
units: [KeyValue_p]? = nil,
callback: @escaping (Int) -> Void = {_ in },
unitCallback: @escaping (KeyValue_p) -> Void = {_ in }
@@ -1504,10 +1505,12 @@ public class StepperInput: NSStackView, NSTextFieldDelegate, PreferencesSwitchWi
if unit == "%" {
self.widthAnchor.constraint(equalToConstant: 68).isActive = true
}
let symbol: NSTextField = LabelField(unit)
symbol.textColor = .textColor
self.addArrangedSubview(symbol)
self.symbolView = symbol
if visibileUnit {
let symbol: NSTextField = LabelField(unit)
symbol.textColor = .textColor
self.addArrangedSubview(symbol)
self.symbolView = symbol
}
} else if let units {
self.units = units
self.unitsView = selectView(