Skip to content

Commit

Permalink
Save and restore article list width for #393
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Jan 28, 2025
1 parent bbd7bfe commit 4838d78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Planet/Views/Articles/ArticleListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct ArticleListView: View {
.navigationSubtitle(
Text(planetStore.navigationSubtitle)
)
.frame(minWidth: 240, maxWidth: .infinity, maxHeight: .infinity)
.frame(minWidth: 240, idealWidth: UserDefaults.standard.double(forKey: "articleListWidth") > 0 ? UserDefaults.standard.double(forKey: "articleListWidth") : 240) // See https://github.com/Planetable/Planet/issues/393
.background(Color(NSColor.textBackgroundColor))
.toolbar {
Menu {
Expand Down Expand Up @@ -263,5 +263,9 @@ struct ArticleListView: View {
}
}
.onDrop(of: [.fileURL], delegate: articleDropDelegate)
.onWidthChange { newWidth in
@AppStorage("articleListWidth") var articleListWidth = 240.0
articleListWidth = newWidth
}
}
}
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 2325
CURRENT_PROJECT_VERSION = 2327

0 comments on commit 4838d78

Please sign in to comment.