fix: hide Split the value option in the RAM module if bar chart is not enabled

This commit is contained in:
Serhiy Mytrovtsiy
2021-08-15 13:05:37 +02:00
parent f12b123e3d
commit 3b8c468137

View File

@@ -82,12 +82,14 @@ internal class Settings: NSStackView, Settings_v {
selected: "\(self.numberOfProcesses)"
))
self.addArrangedSubview(toggleTitleRow(
frame: NSRect(x: 0, y: 0, width: width, height: Constants.Settings.row),
title: localizedString("Split the value (App/Wired/Compressed)"),
action: #selector(toggleSplitValue),
state: self.splitValueState
))
if !widgets.filter({ $0 == .barChart }).isEmpty {
self.addArrangedSubview(toggleTitleRow(
frame: NSRect(x: 0, y: 0, width: width, height: Constants.Settings.row),
title: localizedString("Split the value (App/Wired/Compressed)"),
action: #selector(toggleSplitValue),
state: self.splitValueState
))
}
let h = self.arrangedSubviews.map({ $0.bounds.height + self.spacing }).reduce(0, +) - self.spacing + self.edgeInsets.top + self.edgeInsets.bottom
if self.frame.size.height != h {