Skip to content

Commit

Permalink
Location of Downloads changed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstrba committed Mar 4, 2024
1 parent fabace4 commit ce2fca5
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions DuckDuckGo/Preferences/View/PreferencesGeneralView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,7 @@ extension Preferences {
}
}

// SECTION 2: Downloads
PreferencePaneSection(UserText.downloads) {

PreferencePaneSubSection {
Text(UserText.downloadsLocation + ":").bold()
HStack {
NSPathControlView(url: downloadsModel.selectedDownloadLocation)
#if !APPSTORE
Button(UserText.downloadsChangeDirectory) {
downloadsModel.presentDownloadDirectoryPanel()
}
#endif
}
.disabled(downloadsModel.alwaysRequestDownloadLocation)
ToggleMenuItem(UserText.downloadsAlwaysAsk, isOn: $downloadsModel.alwaysRequestDownloadLocation)
}
}

// SECTION 3: Home Page
// SECTION 2: Home Page
PreferencePaneSection(UserText.homePage) {

PreferencePaneSubSection {
Expand Down Expand Up @@ -97,7 +79,7 @@ extension Preferences {
Text(UserText.homeButtonMode(for: position)).tag(position)
}
}
.scaledToFit()
.frame(width: 200)
.onChange(of: startupModel.homeButtonPosition) { _ in
startupModel.updateHomeButton()
}
Expand All @@ -108,6 +90,23 @@ extension Preferences {
CustomHomePageSheet(startupModel: startupModel, isSheetPresented: $showingCustomHomePageSheet)
}

// SECTION 3: Downloads
PreferencePaneSection(UserText.downloads) {

PreferencePaneSubSection {
Text(UserText.downloadsLocation + ":").bold()
HStack {
NSPathControlView(url: downloadsModel.selectedDownloadLocation)
#if !APPSTORE
Button(UserText.downloadsChangeDirectory) {
downloadsModel.presentDownloadDirectoryPanel()
}
#endif
}
.disabled(downloadsModel.alwaysRequestDownloadLocation)
ToggleMenuItem(UserText.downloadsAlwaysAsk, isOn: $downloadsModel.alwaysRequestDownloadLocation)
}
}
}
}
}
Expand Down

0 comments on commit ce2fca5

Please sign in to comment.