From a52a6c04dad6d05e92bb4e044f98270ba3897a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Kuklau?= Date: Sat, 6 Apr 2024 19:13:11 +0200 Subject: [PATCH] features/rearrange-columns: if only one column remains, might as well close the sheet --- .../ArrangeColumns/ArrangeColumnsWindowController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mastonaut/Features/ArrangeColumns/ArrangeColumnsWindowController.swift b/Mastonaut/Features/ArrangeColumns/ArrangeColumnsWindowController.swift index 8c855c7..b3c1b55 100644 --- a/Mastonaut/Features/ArrangeColumns/ArrangeColumnsWindowController.swift +++ b/Mastonaut/Features/ArrangeColumns/ArrangeColumnsWindowController.swift @@ -95,9 +95,14 @@ class ArrangeColumnsWindowController: NSWindowController, NSCollectionViewDelega return true } - + func reloadData() { collectionView.reloadData() + + // if only one column remains, there's nothing left for the user to do in the sheet + if let viewControllers = getColumnViewControllers?(), viewControllers.count == 1 { + close() + } } @IBAction func done(_ sender: Any) {