mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 07:19:04 +00:00
Excluding unwanted strings from translation. (#128)
This commit is contained in:
@@ -1,39 +1,11 @@
|
|||||||
{
|
{
|
||||||
"sourceLanguage" : "en",
|
"sourceLanguage" : "en",
|
||||||
"strings" : {
|
"strings" : {
|
||||||
"" : {
|
|
||||||
"localizations" : {
|
|
||||||
"en" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "needs_review",
|
|
||||||
"value" : ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"shouldTranslate" : false
|
|
||||||
},
|
|
||||||
"(Build %@)" : {
|
"(Build %@)" : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"/Full/Path/example-1.txt, /Full/Path/example-2.txt" : {
|
"/Full/Path/example-1.txt, /Full/Path/example-2.txt" : {
|
||||||
|
|
||||||
},
|
|
||||||
"%@" : {
|
|
||||||
"shouldTranslate" : false
|
|
||||||
},
|
|
||||||
"%lld" : {
|
|
||||||
"shouldTranslate" : false
|
|
||||||
},
|
|
||||||
"%lld %@ %lld %@" : {
|
|
||||||
"localizations" : {
|
|
||||||
"en" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "new",
|
|
||||||
"value" : "%1$lld %2$@ %3$lld %4$@"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"shouldTranslate" : false
|
|
||||||
},
|
},
|
||||||
"•" : {
|
"•" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ struct AboutSettingsTab: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Button(""){
|
Button {
|
||||||
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/issues/new/choose")!)
|
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/issues/new/choose")!)
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "paperplane", help: String(localized: "View")))
|
.buttonStyle(SimpleButtonStyle(icon: "paperplane", help: String(localized: "View")))
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -92,16 +92,16 @@ struct AboutSettingsTab: View {
|
|||||||
|
|
||||||
Text("View project contributors")
|
Text("View project contributors")
|
||||||
|
|
||||||
DisclosureGroup("", isExpanded: $disclose, content: {
|
DisclosureGroup(isExpanded: $disclose) {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(alignment: .leading, spacing: 0) {
|
LazyVStack(alignment: .leading, spacing: 0) {
|
||||||
ForEach(sponsors) { sponsor in
|
ForEach(sponsors) { sponsor in
|
||||||
HStack() {
|
HStack() {
|
||||||
Text(sponsor.name)
|
Text(sponsor.name)
|
||||||
Spacer()
|
Spacer()
|
||||||
Button(""){
|
Button {
|
||||||
NSWorkspace.shared.open(sponsor.url)
|
NSWorkspace.shared.open(sponsor.url)
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "link", help: String(localized: "View")))
|
.buttonStyle(SimpleButtonStyle(icon: "link", help: String(localized: "View")))
|
||||||
.padding(.trailing)
|
.padding(.trailing)
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ struct AboutSettingsTab: View {
|
|||||||
}
|
}
|
||||||
.frame(height: 45)
|
.frame(height: 45)
|
||||||
.padding(5)
|
.padding(5)
|
||||||
})
|
} label: { EmptyView() }
|
||||||
|
|
||||||
// Button(action: {
|
// Button(action: {
|
||||||
// NSWorkspace.shared.open(URL(string: "https://github.com/sponsors/alienator88")!)
|
// NSWorkspace.shared.open(URL(string: "https://github.com/sponsors/alienator88")!)
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ struct FolderSettingsTab: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Text("Drop folders above or click to add").opacity(0.5)
|
Text("Drop folders above or click to add").opacity(0.5)
|
||||||
Button("") {
|
Button {
|
||||||
selectFolder()
|
selectFolder()
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add folder"), size: 16, rotate: true))
|
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add folder"), size: 16, rotate: true))
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
@@ -183,9 +183,9 @@ struct FolderSettingsTab: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Text("Drop files or folders above or click to add").opacity(0.5)
|
Text("Drop files or folders above or click to add").opacity(0.5)
|
||||||
Button("") {
|
Button {
|
||||||
selectFilesFoldersZ()
|
selectFilesFoldersZ()
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add file/folder"), size: 16, rotate: true))
|
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add file/folder"), size: 16, rotate: true))
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,14 +146,14 @@ struct GeneralSettingsTab: View {
|
|||||||
}
|
}
|
||||||
InfoButton(text: String(localized: "Real size type will show how much actual allocated space the file has on disk.\n\nLogical type shows the binary size. The filesystem can compress and deduplicate sectors on disk, so real size is sometimes smaller(or bigger) than logical size.\n\nFinder size is similar to if you right click > Get Info on a file in Finder, which will show both the logical and real sizes together."))
|
InfoButton(text: String(localized: "Real size type will show how much actual allocated space the file has on disk.\n\nLogical type shows the binary size. The filesystem can compress and deduplicate sectors on disk, so real size is sometimes smaller(or bigger) than logical size.\n\nFinder size is similar to if you right click > Get Info on a file in Finder, which will show both the logical and real sizes together."))
|
||||||
Spacer()
|
Spacer()
|
||||||
Picker("", selection: $sizeType) {
|
Picker(selection: $sizeType) {
|
||||||
Text("Real")
|
Text("Real")
|
||||||
.tag("Real")
|
.tag("Real")
|
||||||
Text("Logical")
|
Text("Logical")
|
||||||
.tag("Logical")
|
.tag("Logical")
|
||||||
// Text("Finder")
|
// Text("Finder")
|
||||||
// .tag("Finder")
|
// .tag("Finder")
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(.borderless)
|
.buttonStyle(.borderless)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ struct InterfaceSettingsTab: View {
|
|||||||
})
|
})
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.switch)
|
||||||
.disabled(menubarEnabled)
|
.disabled(menubarEnabled)
|
||||||
.help(menubarEnabled ? String(localized: "Disabled when menubar icon is enabled") : String(localized: ""))
|
.help(menubarEnabled ? String(localized: "Disabled when menubar icon is enabled") : "")
|
||||||
.onChange(of: mini) { newVal in
|
.onChange(of: mini) { newVal in
|
||||||
if mini {
|
if mini {
|
||||||
appState.currentView = miniView ? .apps : .empty
|
appState.currentView = miniView ? .apps : .empty
|
||||||
@@ -371,7 +371,7 @@ struct InterfaceSettingsTab: View {
|
|||||||
.foregroundStyle(.primary)
|
.foregroundStyle(.primary)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Picker("", selection: $selectedMenubarIcon) {
|
Picker(selection: $selectedMenubarIcon) {
|
||||||
ForEach(icons, id: \.self) { icon in
|
ForEach(icons, id: \.self) { icon in
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: icon)
|
Image(systemName: icon)
|
||||||
@@ -381,7 +381,7 @@ struct InterfaceSettingsTab: View {
|
|||||||
.tag(icon)
|
.tag(icon)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.frame(width: 60)
|
.frame(width: 60)
|
||||||
.onChange(of: selectedMenubarIcon) { newValue in
|
.onChange(of: selectedMenubarIcon) { newValue in
|
||||||
MenuBarExtraManager.shared.swapMenuBarIcon(icon: newValue)
|
MenuBarExtraManager.shared.swapMenuBarIcon(icon: newValue)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ struct SettingsView: View {
|
|||||||
detailView
|
detailView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("")
|
.navigationTitle(Text(verbatim: ""))
|
||||||
.frame(width: 750, height: 620)
|
.frame(width: 750, height: 620)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,9 +68,9 @@ struct SettingsView: View {
|
|||||||
Text("v\(Bundle.main.version)").foregroundStyle(.secondary)
|
Text("v\(Bundle.main.version)").foregroundStyle(.secondary)
|
||||||
.padding(.bottom, 4)
|
.padding(.bottom, 4)
|
||||||
|
|
||||||
Button("") {
|
Button {
|
||||||
resetUserDefaults()
|
resetUserDefaults()
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(ResetSettingsButtonStyle(isResetting: $isResetting, label: String(localized: "Reset Settings"), help: String(localized: "Reset all settings to default")))
|
.buttonStyle(ResetSettingsButtonStyle(isResetting: $isResetting, label: String(localized: "Reset Settings"), help: String(localized: "Reset all settings to default")))
|
||||||
.disabled(isResetting)
|
.disabled(isResetting)
|
||||||
|
|
||||||
|
|||||||
@@ -35,21 +35,21 @@ struct UpdateSettingsTab: View {
|
|||||||
|
|
||||||
HStack(alignment: .center, spacing: 20) {
|
HStack(alignment: .center, spacing: 20) {
|
||||||
|
|
||||||
Button(""){
|
Button {
|
||||||
updater.checkForUpdatesForce(showSheet: false)
|
updater.checkForUpdatesForce(showSheet: false)
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "arrow.uturn.left.circle", label: String(localized: "Refresh"), help: String(localized: "Refresh updater")))
|
.buttonStyle(SimpleButtonStyle(icon: "arrow.uturn.left.circle", label: String(localized: "Refresh"), help: String(localized: "Refresh updater")))
|
||||||
|
|
||||||
|
|
||||||
Button(""){
|
Button {
|
||||||
updater.resetAnnouncementAlert()
|
updater.resetAnnouncementAlert()
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "star", label: String(localized: "Announcement"), help: String(localized: "Show announcements badge again")))
|
.buttonStyle(SimpleButtonStyle(icon: "star", label: String(localized: "Announcement"), help: String(localized: "Show announcements badge again")))
|
||||||
|
|
||||||
|
|
||||||
Button(""){
|
Button {
|
||||||
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
|
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "link", label: String(localized: "Releases"), help: String(localized: "View releases on GitHub")))
|
.buttonStyle(SimpleButtonStyle(icon: "link", label: String(localized: "Releases"), help: String(localized: "View releases on GitHub")))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ struct AppSearchView: View {
|
|||||||
.popover(isPresented: $showMenu) {
|
.popover(isPresented: $showMenu) {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
||||||
Button("") {
|
Button {
|
||||||
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
||||||
// Cycle through all enum cases using `CaseIterable`
|
// Cycle through all enum cases using `CaseIterable`
|
||||||
if let nextSortOption = SortOption(rawValue: selectedSortOption.rawValue + 1) {
|
if let nextSortOption = SortOption(rawValue: selectedSortOption.rawValue + 1) {
|
||||||
@@ -105,17 +105,17 @@ struct AppSearchView: View {
|
|||||||
showMenu = false
|
showMenu = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Sorting: \(selectedSortOption.title)", help: "Sort app list alphabetically by name or by size", size: 5))
|
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Sorting: \(selectedSortOption.title)", help: "Sort app list alphabetically by name or by size", size: 5))
|
||||||
|
|
||||||
if mini && !menubarEnabled {
|
if mini && !menubarEnabled {
|
||||||
Button("") {
|
Button {
|
||||||
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
||||||
appState.currentView = .empty
|
appState.currentView = .empty
|
||||||
appState.appInfo = AppInfo.empty
|
appState.appInfo = AppInfo.empty
|
||||||
showPopover = false
|
showPopover = false
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Drop Target", help: "Drop Target", size: 5))
|
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Drop Target", help: "Drop Target", size: 5))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,11 +168,11 @@ struct AppSearchView: View {
|
|||||||
}
|
}
|
||||||
} else if search.isEmpty && (!mini || !menubarEnabled) {
|
} else if search.isEmpty && (!mini || !menubarEnabled) {
|
||||||
|
|
||||||
Button("") {
|
Button {
|
||||||
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
||||||
showMenu.toggle()
|
showMenu.toggle()
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", help: selectedSortOption.title, size: 16))
|
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", help: selectedSortOption.title, size: 16))
|
||||||
.popover(isPresented: $showMenu, arrowEdge: .bottom) {
|
.popover(isPresented: $showMenu, arrowEdge: .bottom) {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
@@ -183,12 +183,12 @@ struct AppSearchView: View {
|
|||||||
}
|
}
|
||||||
Divider()
|
Divider()
|
||||||
ForEach(SortOption.allCases) { option in
|
ForEach(SortOption.allCases) { option in
|
||||||
Button("") {
|
Button {
|
||||||
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
||||||
selectedSortOption = option
|
selectedSortOption = option
|
||||||
showMenu = false
|
showMenu = false
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: selectedSortOption == option ? "circle.inset.filled" : "circle", label: option.title, help: "", size: 5))
|
.buttonStyle(SimpleButtonStyle(icon: selectedSortOption == option ? "circle.inset.filled" : "circle", label: option.title, help: "", size: 5))
|
||||||
|
|
||||||
|
|
||||||
@@ -287,9 +287,9 @@ struct SimpleSearchStyle: TextFieldStyle {
|
|||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if trash && text != "" {
|
if trash && text != "" {
|
||||||
Button("") {
|
Button {
|
||||||
text = ""
|
text = ""
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "delete.left.fill", help: String(localized: "Clear text"), size: 14, padding: padding))
|
.buttonStyle(SimpleButtonStyle(icon: "delete.left.fill", help: String(localized: "Clear text"), size: 14, padding: padding))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ struct SearchBar: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
HStack {
|
||||||
TextField("", text: $search)
|
TextField(text: $search) { EmptyView() }
|
||||||
.textFieldStyle(SimpleSearchStyle(trash: true, text: $search, darker: darker, glass: glass, padding: padding, sidebar: sidebar))
|
.textFieldStyle(SimpleSearchStyle(trash: true, text: $search, darker: darker, glass: glass, padding: padding, sidebar: sidebar))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,9 +82,9 @@ struct Header: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
HStack {
|
||||||
Text("\(title)").foregroundStyle(.primary).opacity(0.5)
|
Text(verbatim: "\(title)").foregroundStyle(.primary).opacity(0.5)
|
||||||
|
|
||||||
Text("\(count)")
|
Text(verbatim: "\(count)")
|
||||||
.font(.system(size: 10))
|
.font(.system(size: 10))
|
||||||
.monospacedDigit()
|
.monospacedDigit()
|
||||||
.frame(minWidth: count > 99 ? 30 : 24, minHeight: 17)
|
.frame(minWidth: count > 99 ? 30 : 24, minHeight: 17)
|
||||||
|
|||||||
@@ -109,19 +109,19 @@ struct FilesView: View {
|
|||||||
}
|
}
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
Text("\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1)
|
Text(verbatim: "\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1)
|
||||||
Image(systemName: "circle.fill").foregroundStyle(Color("AccentColor")).font(.system(size: 5))
|
Image(systemName: "circle.fill").foregroundStyle(Color("AccentColor")).font(.system(size: 5))
|
||||||
Text("\(appState.appInfo.appVersion)").font(.title3)
|
Text(verbatim: "\(appState.appInfo.appVersion)").font(.title3)
|
||||||
|
|
||||||
}
|
}
|
||||||
Text("\(appState.appInfo.bundleIdentifier)")
|
Text(verbatim: "\(appState.appInfo.bundleIdentifier)")
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.font(.title3)
|
.font(.title3)
|
||||||
.foregroundStyle((.primary.opacity(0.5)))
|
.foregroundStyle((.primary.opacity(0.5)))
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button("\(detailsEnabled ? String(localized: "Hide Details") : String(localized: "Show Details"))") {
|
Button(detailsEnabled ? "Hide Details" : "Show Details") {
|
||||||
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
|
||||||
detailsEnabled.toggle()
|
detailsEnabled.toggle()
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ struct FilesView: View {
|
|||||||
VStack(alignment: .leading, spacing: 5) {
|
VStack(alignment: .leading, spacing: 5) {
|
||||||
Text("Total size of files:")
|
Text("Total size of files:")
|
||||||
.font(.callout).fontWeight(.bold)
|
.font(.callout).fontWeight(.bold)
|
||||||
Text("")
|
Text(verbatim: "")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
Text("Installed Date:")
|
Text("Installed Date:")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
@@ -147,9 +147,9 @@ struct FilesView: View {
|
|||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
VStack(alignment: .trailing, spacing: 5) {
|
VStack(alignment: .trailing, spacing: 5) {
|
||||||
Text("\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
|
Text(verbatim: "\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
|
||||||
|
|
||||||
Text("\(appState.appInfo.fileSize.count == 1 ? "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "item"))" : "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "items"))")")
|
Text(verbatim: "\(appState.appInfo.fileSize.count == 1 ? "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "item"))" : "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "items"))")")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
|
|
||||||
if let creationDate = appState.appInfo.creationDate {
|
if let creationDate = appState.appInfo.creationDate {
|
||||||
@@ -203,14 +203,14 @@ struct FilesView: View {
|
|||||||
|
|
||||||
// Item selection and sorting toolbar
|
// Item selection and sorting toolbar
|
||||||
HStack() {
|
HStack() {
|
||||||
Toggle("", isOn: Binding(
|
Toggle(isOn: Binding(
|
||||||
get: { self.appState.selectedItems.count == self.appState.appInfo.fileSize.keys.count },
|
get: { self.appState.selectedItems.count == self.appState.appInfo.fileSize.keys.count },
|
||||||
set: { newValue in
|
set: { newValue in
|
||||||
updateOnMain {
|
updateOnMain {
|
||||||
self.appState.selectedItems = newValue ? Set(self.appState.appInfo.fileSize.keys) : []
|
self.appState.selectedItems = newValue ? Set(self.appState.appInfo.fileSize.keys) : []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))
|
)) { EmptyView() }
|
||||||
.toggleStyle(SimpleCheckboxToggleStyle())
|
.toggleStyle(SimpleCheckboxToggleStyle())
|
||||||
.help("All checkboxes")
|
.help("All checkboxes")
|
||||||
|
|
||||||
@@ -272,9 +272,9 @@ struct FilesView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button("") {
|
Button {
|
||||||
selectedSortAlpha.toggle()
|
selectedSortAlpha.toggle()
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", label: String(localized: selectedSortAlpha ? "Name" : "Size"), help: String(localized: selectedSortAlpha ? "Sorted alphabetically" : "Sorted by size"), size: 16))
|
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", label: String(localized: selectedSortAlpha ? "Name" : "Size"), help: String(localized: selectedSortAlpha ? "Sorted alphabetically" : "Sorted by size"), size: 16))
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ struct FilesView: View {
|
|||||||
// .padding(.top)
|
// .padding(.top)
|
||||||
|
|
||||||
|
|
||||||
Button("\(sizeType == "Logical" ? totalSelectedSize.logical : totalSelectedSize.real)") {
|
Button {
|
||||||
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
|
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
|
||||||
Task {
|
Task {
|
||||||
|
|
||||||
@@ -419,8 +419,8 @@ struct FilesView: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} label: {
|
||||||
|
Text(verbatim: "\(sizeType == "Logical" ? totalSelectedSize.logical : totalSelectedSize.real)")
|
||||||
}
|
}
|
||||||
.buttonStyle(UninstallButton(isEnabled: !appState.selectedItems.isEmpty))
|
.buttonStyle(UninstallButton(isEnabled: !appState.selectedItems.isEmpty))
|
||||||
.disabled(appState.selectedItems.isEmpty)
|
.disabled(appState.selectedItems.isEmpty)
|
||||||
@@ -483,7 +483,7 @@ struct FileDetailsItem: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 20) {
|
HStack(alignment: .center, spacing: 20) {
|
||||||
Toggle("", isOn: Binding(
|
Toggle(isOn: Binding(
|
||||||
get: { self.appState.selectedItems.contains(self.path) },
|
get: { self.appState.selectedItems.contains(self.path) },
|
||||||
set: { isChecked in
|
set: { isChecked in
|
||||||
if isChecked {
|
if isChecked {
|
||||||
@@ -492,7 +492,7 @@ struct FileDetailsItem: View {
|
|||||||
self.appState.selectedItems.remove(self.path)
|
self.appState.selectedItems.remove(self.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))
|
)) { EmptyView() }
|
||||||
.toggleStyle(SimpleCheckboxToggleStyle())
|
.toggleStyle(SimpleCheckboxToggleStyle())
|
||||||
.disabled(self.path.path.contains(".Trash"))
|
.disabled(self.path.path.contains(".Trash"))
|
||||||
|
|
||||||
@@ -555,7 +555,7 @@ struct FileDetailsItem: View {
|
|||||||
|
|
||||||
let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
|
let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
|
||||||
formatByte(size: sizeL!).human
|
formatByte(size: sizeL!).human
|
||||||
Text("\(displaySize)")
|
Text(verbatim: "\(displaySize)")
|
||||||
|
|
||||||
}
|
}
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
|
|||||||
@@ -104,13 +104,13 @@ struct RegularMode: View {
|
|||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Picker("", selection: $appState.currentPage) {
|
Picker(selection: $appState.currentPage) {
|
||||||
ForEach(CurrentPage.allCases) { page in
|
ForEach(CurrentPage.allCases) { page in
|
||||||
Text(page.title)
|
Text(page.title)
|
||||||
.font(.title3)
|
.font(.title3)
|
||||||
.tag(page)
|
.tag(page)
|
||||||
}
|
}
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(.borderless)
|
.buttonStyle(.borderless)
|
||||||
.padding(2)
|
.padding(2)
|
||||||
.padding(.vertical, 2)
|
.padding(.vertical, 2)
|
||||||
|
|||||||
@@ -105,14 +105,14 @@ struct ZombieView: View {
|
|||||||
VStack(alignment: .leading, spacing: 5) {
|
VStack(alignment: .leading, spacing: 5) {
|
||||||
Text("Total size of files:")
|
Text("Total size of files:")
|
||||||
.font(.callout).fontWeight(.bold)
|
.font(.callout).fontWeight(.bold)
|
||||||
Text("")
|
Text(verbatim: "")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
VStack(alignment: .trailing, spacing: 5) {
|
VStack(alignment: .trailing, spacing: 5) {
|
||||||
Text("\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
|
Text(verbatim: "\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
|
||||||
|
|
||||||
Text("\(selectedZombieItemsLocal.count) \(String(localized: "of")) \(searchZ.isEmpty ? appState.zombieFile.fileSize.count : memoizedFiles.count) \(appState.zombieFile.fileSize.count == 1 ? "\(String(localized: "item"))" : "\(String(localized: "items"))")")
|
Text(verbatim: "\(selectedZombieItemsLocal.count) \(String(localized: "of")) \(searchZ.isEmpty ? appState.zombieFile.fileSize.count : memoizedFiles.count) \(appState.zombieFile.fileSize.count == 1 ? "\(String(localized: "item"))" : "\(String(localized: "items"))")")
|
||||||
.font(.footnote).foregroundStyle(.secondary)
|
.font(.footnote).foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ struct ZombieView: View {
|
|||||||
|
|
||||||
// Item selection and sorting toolbar
|
// Item selection and sorting toolbar
|
||||||
HStack {
|
HStack {
|
||||||
Toggle("", isOn: Binding(
|
Toggle(isOn: Binding(
|
||||||
get: {
|
get: {
|
||||||
if searchZ.isEmpty {
|
if searchZ.isEmpty {
|
||||||
// All items are selected if no filter is applied and all items are selected
|
// All items are selected if no filter is applied and all items are selected
|
||||||
@@ -158,7 +158,7 @@ struct ZombieView: View {
|
|||||||
|
|
||||||
updateTotalSizes()
|
updateTotalSizes()
|
||||||
}
|
}
|
||||||
))
|
)) { EmptyView() }
|
||||||
.toggleStyle(SimpleCheckboxToggleStyle())
|
.toggleStyle(SimpleCheckboxToggleStyle())
|
||||||
.help("All checkboxes")
|
.help("All checkboxes")
|
||||||
|
|
||||||
@@ -170,10 +170,10 @@ struct ZombieView: View {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Button("") {
|
Button {
|
||||||
selectedSortAlpha.toggle()
|
selectedSortAlpha.toggle()
|
||||||
updateMemoizedFiles(for: searchZ, sizeType: sizeType, selectedSortAlpha: selectedSortAlpha, force: true)
|
updateMemoizedFiles(for: searchZ, sizeType: sizeType, selectedSortAlpha: selectedSortAlpha, force: true)
|
||||||
}
|
} label: { EmptyView() }
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", label: String(localized: selectedSortAlpha ? "Name" : "Size"), help: String(localized: selectedSortAlpha ? "Sorted alphabetically" : "Sorted by size"), size: 16))
|
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", label: String(localized: selectedSortAlpha ? "Name" : "Size"), help: String(localized: selectedSortAlpha ? "Sorted alphabetically" : "Sorted by size"), size: 16))
|
||||||
|
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ struct ZombieView: View {
|
|||||||
}
|
}
|
||||||
.buttonStyle(RescanButton())
|
.buttonStyle(RescanButton())
|
||||||
|
|
||||||
Button("\(sizeType == "Logical" ? totalLogicalSizeUninstallBtn : totalRealSizeUninstallBtn)") {
|
Button {
|
||||||
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
|
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
|
||||||
Task {
|
Task {
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ struct ZombieView: View {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
} label: { Text(verbatim: "\(sizeType == "Logical" ? totalLogicalSizeUninstallBtn : totalRealSizeUninstallBtn)") }
|
||||||
.buttonStyle(UninstallButton(isEnabled: !selectedZombieItemsLocal.isEmpty))
|
.buttonStyle(UninstallButton(isEnabled: !selectedZombieItemsLocal.isEmpty))
|
||||||
.disabled(selectedZombieItemsLocal.isEmpty)
|
.disabled(selectedZombieItemsLocal.isEmpty)
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ struct ZombieFileDetailsItem: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 20) {
|
HStack(alignment: .center, spacing: 20) {
|
||||||
Toggle("", isOn: $isSelected)
|
Toggle(isOn: $isSelected) { EmptyView() }
|
||||||
.toggleStyle(SimpleCheckboxToggleStyle())
|
.toggleStyle(SimpleCheckboxToggleStyle())
|
||||||
|
|
||||||
if let appIcon = icon {
|
if let appIcon = icon {
|
||||||
@@ -486,7 +486,7 @@ struct ZombieFileDetailsItem: View {
|
|||||||
let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
|
let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
|
||||||
formatByte(size: sizeL!).human
|
formatByte(size: sizeL!).human
|
||||||
|
|
||||||
Text("\(displaySize)")
|
Text(verbatim: "\(displaySize)")
|
||||||
|
|
||||||
}
|
}
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
|
|||||||
Reference in New Issue
Block a user