From d40c2e231fea7fb5a381b4839539d5da6cd882c7 Mon Sep 17 00:00:00 2001 From: ShigemoriHakura <62388797+ShigemoriHakura@users.noreply.github.com> Date: Sun, 7 Apr 2024 18:43:36 +0800 Subject: [PATCH] fix: fixed Sensors align in combined view and added localizedString to PortalHeader (#1879) * [fix] fix Sensors align fix the align in Sensors combined view * [feat] add localizedString to header --- Kit/module/portal.swift | 2 +- Modules/Sensors/portal.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Kit/module/portal.swift b/Kit/module/portal.swift index 06f76690..da30a193 100644 --- a/Kit/module/portal.swift +++ b/Kit/module/portal.swift @@ -78,7 +78,7 @@ public class PortalHeader: NSStackView { title.canDrawSubviewsIntoLayer = true title.alignment = .center title.font = NSFont.systemFont(ofSize: 12, weight: .regular) - title.stringValue = name + title.stringValue = localizedString(name) let settings = NSButton() settings.heightAnchor.constraint(equalToConstant: 18).isActive = true diff --git a/Modules/Sensors/portal.swift b/Modules/Sensors/portal.swift index 9927b6a4..d09067c0 100644 --- a/Modules/Sensors/portal.swift +++ b/Modules/Sensors/portal.swift @@ -35,12 +35,13 @@ public class Portal: NSStackView, Portal_p { self.orientation = .vertical self.distribution = .fillEqually - self.spacing = Constants.Popup.spacing*2 + self.widthAnchor.constraint(equalToConstant: Constants.Popup.width).isActive = true + self.spacing = Constants.Popup.spacing self.edgeInsets = NSEdgeInsets( top: Constants.Popup.spacing*2, left: Constants.Popup.spacing*2, bottom: Constants.Popup.spacing*2, - right: Constants.Popup.spacing*2 + right: Constants.Popup.spacing ) self.container.stackView.spacing = 0