From 10dedf6fb154d42b5edef721a3b888ffa4314c52 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sat, 31 Oct 2020 20:03:01 +0100 Subject: [PATCH] - fix Fans popup view size - fix scroll position when open popup view --- ModuleKit/popup.swift | 4 ++++ Modules/Fans/popup.swift | 1 + 2 files changed, 5 insertions(+) diff --git a/ModuleKit/popup.swift b/ModuleKit/popup.swift index 9d594893..ee16ea21 100644 --- a/ModuleKit/popup.swift +++ b/ModuleKit/popup.swift @@ -174,6 +174,10 @@ internal class PopupView: NSView { x: self?.header.frame.origin.x ?? 0, y: (self?.body.frame.height ?? 0) + (Constants.Popup.margins*2) )) + + if let documentView = self?.body.documentView { + documentView.scroll(NSPoint(x: 0, y: documentView.bounds.size.height)) + } } } } diff --git a/Modules/Fans/popup.swift b/Modules/Fans/popup.swift index 61c4b971..404926b9 100644 --- a/Modules/Fans/popup.swift +++ b/Modules/Fans/popup.swift @@ -61,6 +61,7 @@ internal class Popup: NSView, Popup_p { self.addSubview(view) self.setFrameSize(NSSize(width: self.frame.width, height: view.frame.height)) + self.sizeCallback?(self.frame.size) } internal func usageCallback(_ values: [Fan]) {