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

Fix Preferences About screen doesn't recognize inputs #3692

Merged
merged 1 commit into from
Jan 1, 2025
Merged
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
66 changes: 37 additions & 29 deletions DuckDuckGo/Preferences/View/PreferencesAboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,37 @@ extension Preferences {

var body: some View {
PreferencePane {
GeometryReader { geometry in
VStack(alignment: .leading) {
TextMenuTitle(UserText.aboutDuckDuckGo)
VStack(alignment: .leading) {
TextMenuTitle(UserText.aboutDuckDuckGo)

if !model.isCurrentOsReceivingUpdates {
UnsupportedDeviceInfoBox(wide: true)
.padding(.top, 10)
.padding(.leading, -20)
}
if !model.isCurrentOsReceivingUpdates {
UnsupportedDeviceInfoBox(wide: true)
.padding(.top, 10)
.padding(.leading, -20)
}

AboutContentSection(geometry: geometry, model: model)
AboutContentSection(model: model)

#if SPARKLE
UpdatesSection(areAutomaticUpdatesEnabled: $areAutomaticUpdatesEnabled, model: model)
UpdatesSection(areAutomaticUpdatesEnabled: $areAutomaticUpdatesEnabled, model: model)
#endif
}
}
}
}
}

struct AboutContentSection: View {
var geometry: GeometryProxy
@ObservedObject var model: AboutPreferences

var body: some View {
PreferencePaneSection {
if geometry.size.width > 400 {
HStack(alignment: .top) {
Image(.aboutPageLogo)
.padding(.top, 2)
VStack(alignment: .leading, spacing: 8) {
rightColumnContent
}
.padding(.top, 10)
if #available(macOS 13.0, *) {
ViewThatFits(in: .horizontal) {
horizontalPageLogo
verticalPageLogo
}
.padding(.bottom, 8)
} else {
VStack(alignment: .leading) {
Image(.aboutPageLogo)
VStack(alignment: .leading, spacing: 8) {
rightColumnContent
}
.padding(.top, 10)
}
.padding(.bottom, 8)
horizontalPageLogo
}

TextButton(UserText.moreAt(url: model.displayableAboutURL)) {
Expand Down Expand Up @@ -139,6 +124,29 @@ extension Preferences {
}
}

private var horizontalPageLogo: some View {
HStack(alignment: .top) {
Image(.aboutPageLogo)
.padding(.top, 2)
VStack(alignment: .leading, spacing: 8) {
rightColumnContent
}
.padding(.top, 10)
}
.padding(.bottom, 8)
}

private var verticalPageLogo: some View {
VStack(alignment: .leading) {
Image(.aboutPageLogo)
VStack(alignment: .leading, spacing: 8) {
rightColumnContent
}
.padding(.top, 10)
}
.padding(.bottom, 8)
}

#if SPARKLE
private var hasPendingUpdate: Bool {
model.updateController?.hasPendingUpdate == true
Expand Down
Loading