Skip to content

Commit

Permalink
Fix Preferences About screen doesn't recognize inputs (#3692)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1199230911884351/1209057693918519/f
Tech Design URL:
CC:

**Description**:

Bug fix targeting release branch.

**Optional E2E tests**:
- [ ] Run PIR E2E tests
Check this to run the Personal Information Removal end to end tests. If
updating CCF, or any PIR related code, tick this.

**Steps to test this PR**:
1.

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

**Definition of Done**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

---
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
  • Loading branch information
quanganhdo authored Jan 1, 2025
1 parent 4aceb93 commit 03d10df
Showing 1 changed file with 37 additions and 29 deletions.
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

0 comments on commit 03d10df

Please sign in to comment.