Merge pull request #2305 from omnivore-app/fix/mac-library-list
Mac library tweaks
This commit is contained in:
@ -45,6 +45,7 @@ import Views
|
||||
item: item,
|
||||
viewModel: viewModel
|
||||
)
|
||||
.listRowInsets(EdgeInsets())
|
||||
.contextMenu {
|
||||
Button(
|
||||
action: { viewModel.itemUnderTitleEdit = item },
|
||||
@ -91,11 +92,11 @@ import Views
|
||||
LoadingSection()
|
||||
}
|
||||
}
|
||||
// .listStyle(PlainListStyle())
|
||||
.listStyle(InsetListStyle())
|
||||
.navigationTitle("Home")
|
||||
.searchable(
|
||||
text: $viewModel.searchTerm,
|
||||
placement: .sidebar
|
||||
placement: .toolbar
|
||||
) {
|
||||
if viewModel.searchTerm.isEmpty {
|
||||
Text(LocalText.inboxGeneric).searchCompletion("in:inbox ")
|
||||
@ -105,8 +106,6 @@ import Views
|
||||
}
|
||||
}
|
||||
.onChange(of: viewModel.searchTerm) { _ in
|
||||
// Maybe we should debounce this, but
|
||||
// it feels like it works ok without
|
||||
loadItems(isRefresh: true)
|
||||
}
|
||||
.onSubmit(of: .search) {
|
||||
|
||||
@ -81,7 +81,7 @@ struct WebReaderContent {
|
||||
title: `\(articleContent.title.replacingOccurrences(of: "`", with: "\\`"))`,
|
||||
content: document.getElementById('_omnivore-htmlContent').innerHTML,
|
||||
originalArticleUrl: "\(item.unwrappedPageURLString)",
|
||||
contentReader: "WEB",
|
||||
contentReader: "\(item.contentReader ?? "WEB")",
|
||||
readingProgressPercent: \(item.readingProgress),
|
||||
readingProgressAnchorIndex: \(item.readingProgressAnchor),
|
||||
labels: \(item.labelsJSONString),
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xF5",
|
||||
"green" : "0xF5",
|
||||
"red" : "0xF5"
|
||||
"blue" : "0xF9",
|
||||
"green" : "0xF9",
|
||||
"red" : "0xF9"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
|
||||
@ -31,8 +31,8 @@ struct LabelsFlowLayout: View {
|
||||
return ZStack(alignment: .topLeading) {
|
||||
ForEach(self.labelItems, id: \.self) { label in
|
||||
self.item(for: label)
|
||||
.padding(.horizontal, 2)
|
||||
.padding(.vertical, 2)
|
||||
.padding(.horizontal, 3)
|
||||
.padding(.vertical, 5)
|
||||
.alignmentGuide(.leading, computeValue: { dim in
|
||||
if abs(width - dim.width) > geom.size.width {
|
||||
width = 0
|
||||
|
||||
@ -17,13 +17,11 @@ public extension View {
|
||||
|
||||
public struct LibraryItemCard: View {
|
||||
let viewer: Viewer?
|
||||
let tapHandler: () -> Void
|
||||
@ObservedObject var item: LinkedItem
|
||||
|
||||
public init(item: LinkedItem, viewer: Viewer?, tapHandler: @escaping () -> Void = {}) {
|
||||
public init(item: LinkedItem, viewer: Viewer?) {
|
||||
self.item = item
|
||||
self.viewer = viewer
|
||||
self.tapHandler = tapHandler
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
@ -204,10 +202,5 @@ public struct LibraryItemCard: View {
|
||||
var labels: some View {
|
||||
LabelsFlowLayout(labels: item.sortedLabels)
|
||||
.padding(.top, 0)
|
||||
#if os(macOS)
|
||||
.onTapGesture {
|
||||
tapHandler()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user