Skip to content

Commit

Permalink
Clean file + clean Picker
Browse files Browse the repository at this point in the history
  • Loading branch information
bourvill committed Mar 29, 2023
1 parent c085da4 commit a56af2c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
24 changes: 13 additions & 11 deletions App/Features/Entry/EntriesListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ struct EntriesListView: View {
ArchiveEntryButton(entry: entry)
StarEntryButton(entry: entry)
}
}.buttonStyle(PlainButtonStyle())
.swipeActions(allowsFullSwipe: false, content: {
ArchiveEntryButton(entry: entry)
.tint(.blue)
.labelStyle(.iconOnly)
StarEntryButton(entry: entry)
.tint(.orange)
.labelStyle(.iconOnly)
})
}
.buttonStyle(.plain)
.swipeActions(allowsFullSwipe: false, content: {
ArchiveEntryButton(entry: entry)
.tint(.blue)
.labelStyle(.iconOnly)
StarEntryButton(entry: entry)
.tint(.orange)
.labelStyle(.iconOnly)
})
}
}.refreshable { appSync.requestSync() }
.listStyle(InsetListStyle())
}
.refreshable { appSync.requestSync() }
.listStyle(.inset)
}
}
2 changes: 1 addition & 1 deletion App/Features/Entry/EntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct EntryView: View {
ToolbarItem(placement: toolbarPlacement) {
HStack {
FontSizeSelectorView()
.buttonStyle(PlainButtonStyle())
.buttonStyle(.plain)
#if os(iOS)
Spacer()
#endif
Expand Down
3 changes: 2 additions & 1 deletion App/Features/Player/PlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import SwiftUI
}, label: {
Image(systemName: "stop.circle")
}).font(.system(size: 30))
}.buttonStyle(PlainButtonStyle())
}
.buttonStyle(.plain)
}.padding()
}
} else {
Expand Down
5 changes: 3 additions & 2 deletions App/Features/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct SearchView: View {
HStack {
if showSearchBar {
TextField("Search", text: $searchViewModel.search)
.textFieldStyle(RoundedBorderTextFieldStyle())
.textFieldStyle(.roundedBorder)
.disableAutocorrection(true)
#if os(iOS)
.autocapitalization(.none)
Expand All @@ -33,7 +33,8 @@ struct SearchView: View {
}, label: {
Image(systemName: self.showSearchBar ? "list.bullet.below.rectangle" : "magnifyingglass")
.padding(.trailing)
}).buttonStyle(PlainButtonStyle())
})
.buttonStyle(.plain)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion SharedLib/Sources/SharedLib/Extension/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public extension String {
URL(string: self)
}

@available(iOS 13.0, macOS 10.15, *)
var md5: String {
Insecure.MD5.hash(data: data(using: .utf8)!).map {
String(format: "%02hhx", $0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import SwiftUI

@available(iOS 13.0, macOS 10.15, *)
public struct RetrieveModePicker: View {
@Binding var filter: RetrieveMode

Expand All @@ -14,11 +13,12 @@ public struct RetrieveModePicker: View {
Text(LocalizedStringKey(RetrieveMode.starredArticles.rawValue)).tag(RetrieveMode.starredArticles)
Text(LocalizedStringKey(RetrieveMode.unarchivedArticles.rawValue)).tag(RetrieveMode.unarchivedArticles)
Text(LocalizedStringKey(RetrieveMode.archivedArticles.rawValue)).tag(RetrieveMode.archivedArticles)
}).pickerStyle(SegmentedPickerStyle())
})
.pickerStyle(.segmented)
.labelsHidden()
}
}

@available(iOS 13.0, macOS 10.15, *)
struct RetrieveModePicker_Previews: PreviewProvider {
static var previews: some View {
RetrieveModePicker(filter: .constant(.archivedArticles)).previewLayout(.fixed(width: 300, height: 70))
Expand Down

0 comments on commit a56af2c

Please sign in to comment.