fix: adjusted sensors portal width per row (#1819)

This commit is contained in:
Serhiy Mytrovtsiy
2024-02-20 20:12:20 +01:00
parent 90ef1b1818
commit 82fd30668e
2 changed files with 8 additions and 1 deletions

View File

@@ -71,7 +71,10 @@ public class Portal: NSStackView, Portal_p {
self.list = [:]
}
let width: CGFloat = self.frame.width - self.edgeInsets.left - self.edgeInsets.right - Constants.Popup.margins
var width: CGFloat = self.frame.width - self.edgeInsets.left - self.edgeInsets.right
if list.count >= 4 {
width -= self.container.scrollWidth ?? Constants.Popup.margins
}
list.forEach { s in
let v = ValueSensorView(s, width: width, callback: {})
self.container.stackView.addArrangedSubview(v)