Preserve the tab selection after a reload

This commit is contained in:
Damiano Galassi committed 2024-07-06 16:58:35 +02:00
1 parent 4e2c18c2f4
commit 89ba80859e
2 files changed
+34 -1

No files matched your search

+12
View File
@@ -17,4 +17,16 @@ class PropertyView : NSViewController {
tabView?.selectPreviousTabViewItem(self)
}
}
func selectTabViewItem(at index: Int) {
tabView?.selectTabViewItem(at: index)
}
func selectedViewIndex() -> Int {
var index = NSNotFound
if let item = tabView?.selectedTabViewItem {
index = tabView?.indexOfTabViewItem(item) ?? NSNotFound
}
return index
}
}