misc: adjust connection panel order & enable auto save

This commit is contained in:
yicheng 2023-07-24 17:06:18 +08:00
parent bc83166ee8
commit 2448a80f11
2 changed files with 14 additions and 3 deletions

View File

@ -17,13 +17,13 @@ enum ConnectionColume:String, CaseIterable {
case statusIcon
case process
case status
case date
case url
case rule
case date
case upload
case download
case currentUpload
case currentDownload
case upload
case download
case type
var columeTitle:String {
@ -69,6 +69,14 @@ enum ConnectionColume:String, CaseIterable {
}
}
var width:CGFloat {
switch self {
case .upload, .download, .currentUpload, .currentDownload: return 80
case .status: return 50
default:return 100
}
}
var maxWidth:CGFloat {
switch self {
case .statusIcon: return 16

View File

@ -43,9 +43,12 @@ class ConnectionTopListView: NSView {
column.title = columnType.columeTitle
column.minWidth = columnType.minWidth
column.maxWidth = columnType.maxWidth
column.width = columnType.width
column.sortDescriptorPrototype = viewModel.sortSortDescriptor(for: columnType)
tableView.addTableColumn(column)
}
tableView.autosaveName = className.appending("tableAutoSave")
tableView.autosaveTableColumns = true
tableView.sortDescriptors = [viewModel.currentSortDescriptor].compactMap {$0}
tableView.usesAlternatingRowBackgroundColors = true
tableView.delegate = self