mirror of
https://github.com/yattee/yattee.git
synced 2025-04-26 08:36:29 +00:00
Minor layout fixes
This commit is contained in:
parent
f1551141e3
commit
d19446d37d
@ -15,8 +15,9 @@ struct AccountViewButton: View {
|
|||||||
Button {
|
Button {
|
||||||
navigation.presentingAccounts = true
|
navigation.presentingAccounts = true
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack(spacing: 6) {
|
||||||
if !accountPickerDisplaysUsername || !(model.current?.isPublic ?? true) {
|
if !accountPickerDisplaysUsername || !(model.current?.isPublic ?? true) {
|
||||||
|
if #available(iOS 15, macOS 12, *) {
|
||||||
if let name = model.current?.app?.rawValue.capitalized {
|
if let name = model.current?.app?.rawValue.capitalized {
|
||||||
Image(name)
|
Image(name)
|
||||||
.resizable()
|
.resizable()
|
||||||
@ -24,6 +25,9 @@ struct AccountViewButton: View {
|
|||||||
} else {
|
} else {
|
||||||
Image(systemName: "globe")
|
Image(systemName: "globe")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Image(systemName: "globe")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if accountPickerDisplaysUsername {
|
if accountPickerDisplaysUsername {
|
||||||
|
@ -32,6 +32,7 @@ struct SearchTextField: View {
|
|||||||
.frame(maxWidth: 190)
|
.frame(maxWidth: 190)
|
||||||
.textFieldStyle(.plain)
|
.textFieldStyle(.plain)
|
||||||
#else
|
#else
|
||||||
|
.frame(minWidth: 200)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.padding(.horizontal, 5)
|
.padding(.horizontal, 5)
|
||||||
.padding(.trailing, state.queryText.isEmpty ? 0 : 10)
|
.padding(.trailing, state.queryText.isEmpty ? 0 : 10)
|
||||||
@ -47,6 +48,7 @@ struct SearchTextField: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.transaction { t in t.animation = nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
private var fieldBorder: some View {
|
private var fieldBorder: some View {
|
||||||
|
@ -169,20 +169,13 @@ struct SearchView: View {
|
|||||||
#endif
|
#endif
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItemGroup(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
if !navigationBarHidden {
|
searchMenu
|
||||||
Button(action: { NavigationModel.shared.presentingSettings = true }) {
|
|
||||||
Image(systemName: "gearshape.2")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ToolbarItem(placement: .principal) {
|
ToolbarItem(placement: .principal) {
|
||||||
HStack(spacing: 0) {
|
|
||||||
searchMenu
|
|
||||||
SearchTextField()
|
SearchTextField()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -231,33 +224,6 @@ struct SearchView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private var navigationBarHidden: Bool {
|
|
||||||
if navigationStyle == .sidebar {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
let preferred = Defaults[.visibleSections]
|
|
||||||
var visibleSections = [VisibleSection]()
|
|
||||||
|
|
||||||
if accounts.app.supportsPopular && preferred.contains(.popular) {
|
|
||||||
visibleSections.append(.popular)
|
|
||||||
}
|
|
||||||
|
|
||||||
if accounts.app.supportsSubscriptions && accounts.signedIn && preferred.contains(.subscriptions) {
|
|
||||||
visibleSections.append(.subscriptions)
|
|
||||||
}
|
|
||||||
|
|
||||||
if accounts.app.supportsUserPlaylists && accounts.signedIn && preferred.contains(.playlists) {
|
|
||||||
visibleSections.append(.playlists)
|
|
||||||
}
|
|
||||||
|
|
||||||
if preferred.contains(.trending) {
|
|
||||||
visibleSections.append(.trending)
|
|
||||||
}
|
|
||||||
|
|
||||||
return !visibleSections.isEmpty || showHome
|
|
||||||
}
|
|
||||||
|
|
||||||
private var results: some View {
|
private var results: some View {
|
||||||
VStack {
|
VStack {
|
||||||
if showRecentQueries {
|
if showRecentQueries {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user