Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLED theme tweaks #1468

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Mlem/App/Views/Pages/CommentEditor/CommentEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ struct CommentEditorView: View {
)
.padding(.vertical, Constants.main.standardSpacing)
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
.padding(.horizontal, Constants.main.standardSpacing)
contextView
.padding(Constants.main.standardSpacing)
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
.padding(.horizontal, Constants.main.standardSpacing)
}
.animation(.easeOut(duration: 0.2), value: resolutionState == .notFound)
Expand Down
1 change: 1 addition & 0 deletions Mlem/App/Views/Pages/Community/CommunityView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ struct CommunityView: View {
Markdown(description, configuration: .default)
.padding(Constants.main.standardSpacing)
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}
.padding([.horizontal, .bottom], Constants.main.standardSpacing)
Expand Down
2 changes: 0 additions & 2 deletions Mlem/App/Views/Pages/Instance/FediseerOpinionListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ struct FediseerOpinionListView: View {

ForEach(items, id: \.domain) { opinion in
FediseerOpinionView(opinion: opinion)
.background(palette.secondaryGroupedBackground)
.cornerRadius(Constants.main.standardSpacing)
}
}
.padding(16)
Expand Down
3 changes: 3 additions & 0 deletions Mlem/App/Views/Pages/Instance/FediseerOpinionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ struct FediseerOpinionView: View {
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
.font(.callout)
.background(palette.secondaryGroupedBackground)
.cornerRadius(Constants.main.standardSpacing)
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}

@ViewBuilder
Expand Down
3 changes: 2 additions & 1 deletion Mlem/App/Views/Pages/Instance/InstanceSafetyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct InstanceSafetyView: View {
destination: items.count > 5 ? destination : nil
)
ForEach(items.prefix(5), id: \.domain) { item in
section { FediseerOpinionView(opinion: item) }
FediseerOpinionView(opinion: item)
.padding(.bottom, 9)
}
}
Expand All @@ -121,6 +121,7 @@ struct InstanceSafetyView: View {
.frame(maxWidth: .infinity)
.background(palette.secondaryGroupedBackground)
.cornerRadius(Constants.main.standardSpacing)
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}

Expand Down
6 changes: 2 additions & 4 deletions Mlem/App/Views/Pages/Instance/InstanceUptimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ struct InstanceUptimeView: View {
.padding(.leading, 12)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.vertical, 10)
.background(
RoundedRectangle(cornerRadius: Constants.main.standardSpacing)
.fill(palette.secondaryGroupedBackground)
)
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
}
.buttonStyle(EmptyButtonStyle())

Expand Down Expand Up @@ -218,6 +215,7 @@ struct InstanceUptimeView: View {
.frame(maxWidth: .infinity)
.background(palette.secondaryGroupedBackground)
.cornerRadius(Constants.main.standardSpacing)
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}

Expand Down
1 change: 1 addition & 0 deletions Mlem/App/Views/Pages/Instance/InstanceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct InstanceView: View {
Markdown(description, configuration: .default)
.padding(Constants.main.standardSpacing)
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
.padding([.horizontal, .bottom], Constants.main.standardSpacing)
}
case .details:
Expand Down
5 changes: 5 additions & 0 deletions Mlem/App/Views/Root/Tabs/Settings/SortingSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import MlemMiddleware
import SwiftUI

struct SortingSettingsView: View {
@Environment(Palette.self) var palette

@Setting(\.defaultPostSort) var defaultPostSort
@Setting(\.fallbackPostSort) var fallbackPostSort
@Setting(\.commentSort) var commentSort
Expand All @@ -20,6 +22,7 @@ struct SortingSettingsView: View {
Text("Posts")
Spacer()
FeedSortPicker(sort: $defaultPostSort)
.foregroundStyle(palette.accent)
.frame(minHeight: 50)
.buttonStyle(.bordered)
}
Expand All @@ -28,6 +31,7 @@ struct SortingSettingsView: View {
Text("Fallback")
Spacer()
FeedSortPicker(sort: $fallbackPostSort, filters: [.alwaysAvailable])
.foregroundStyle(palette.accent)
.frame(minHeight: 50)
.buttonStyle(.bordered)
}
Expand All @@ -50,6 +54,7 @@ struct SortingSettingsView: View {
}
}
}
.foregroundStyle(palette.accent)
.frame(minHeight: 50)
.buttonStyle(.bordered)
}
Expand Down
4 changes: 3 additions & 1 deletion Mlem/App/Views/Shared/FooterLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ struct FooterLinkView: View {

let title: String
let subtitle: String?

var body: some View {
VStack(alignment: .leading, spacing: 5) {
Text(title)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.subheadline)
.fontWeight(.semibold)
.multilineTextAlignment(.leading)
.lineLimit(2)

if let subtitle {
Text(subtitle)
Expand Down
3 changes: 2 additions & 1 deletion Mlem/App/Views/Shared/Form/FormSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct FormSection<Content: View>: View {
content
.frame(maxWidth: .infinity)
.background(palette.secondaryGroupedBackground)
.clipShape(.rect(cornerRadius: 10))
.clipShape(.rect(cornerRadius: Constants.main.standardSpacing))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}
4 changes: 2 additions & 2 deletions Mlem/App/Views/Shared/Palette Components/Form.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ struct Form<Content: View>: View {
.tint(palette.accent)
.buttonStyle(PaletteButton())
}
.listStyle(InsetListStyle())
.listStyle(.insetGrouped)
.scrollContentBackground(.hidden)
.background(palette.groupedBackground)
.shadow(color: palette.primary.opacity(palette.bordered ? 0.2 : 0.0), radius: 5)
.shadow(color: palette.primary.opacity(palette.bordered ? 0.4 : 0.0), radius: 1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ struct CommunityListRow<Content2: View>: View {
.contentShape(.contextMenuPreview, .rect(cornerRadius: Constants.main.standardSpacing))
.contextMenu { community.menuActions(navigation: navigation) }
.quickSwipes(community.swipeActions(behavior: .standard))
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ struct InstanceListRow<Content2: View>: View {
.contextMenu {
instanceStub?.menuActions(allowExternalBlocking: true) ?? []
}
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}
1 change: 1 addition & 0 deletions Mlem/App/Views/Shared/Search/Results/PersonListRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ struct PersonListRow<Content2: View>: View {
.background(palette.secondaryGroupedBackground, in: .rect(cornerRadius: Constants.main.standardSpacing))
.contentShape(.contextMenuPreview, .rect(cornerRadius: Constants.main.standardSpacing))
.contextMenu { person.menuActions(navigation: navigation) }
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
}
}
1 change: 0 additions & 1 deletion Mlem/App/Views/Shared/Search/SearchResultsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct SearchResultsView<Item: Identifiable, Content: View>: View {
var body: some View {
ForEach(results) { item in
content(item)
.paletteBorder(cornerRadius: Constants.main.standardSpacing)
.padding(.horizontal, Constants.main.standardSpacing)
.padding(.bottom, Constants.main.halfSpacing)
}
Expand Down
Loading