Skip to content

Commit cb6de5f

Browse files
committed
Improve circular back button
- The back button used in several views was not circular anymore on macOS 26.1. Now fixed - Added label to button instead of just an image for accessibility
1 parent 2bd8f69 commit cb6de5f

12 files changed

Lines changed: 50 additions & 48 deletions

File tree

src/Support.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
498DB7F22E5D113A00DDC33B /* AppModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498DB7F12E5D113A00DDC33B /* AppModel.swift */; };
8888
498DB8412E5E49D700DDC33B /* LocalPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498DB8402E5E49D700DDC33B /* LocalPreferences.swift */; };
8989
498DB8432E5EE13A00DDC33B /* ConfiguratorSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498DB8422E5EE13A00DDC33B /* ConfiguratorSettingsView.swift */; };
90+
499CC4672EBBA24D00ED16EC /* BackButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 499CC4662EBBA24D00ED16EC /* BackButton.swift */; };
9091
499F56732AE0832100CBDE73 /* AppCatalogSubview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 499F56722AE0832100CBDE73 /* AppCatalogSubview.swift */; };
9192
499F56752AE47A3900CBDE73 /* AppUpdatesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 499F56742AE47A3900CBDE73 /* AppUpdatesView.swift */; };
9293
499F56782AE47BE800CBDE73 /* InstalledAppItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 499F56772AE47BE800CBDE73 /* InstalledAppItem.swift */; };
@@ -251,6 +252,7 @@
251252
498DB7F12E5D113A00DDC33B /* AppModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppModel.swift; sourceTree = "<group>"; };
252253
498DB8402E5E49D700DDC33B /* LocalPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalPreferences.swift; sourceTree = "<group>"; };
253254
498DB8422E5EE13A00DDC33B /* ConfiguratorSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfiguratorSettingsView.swift; sourceTree = "<group>"; };
255+
499CC4662EBBA24D00ED16EC /* BackButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackButton.swift; sourceTree = "<group>"; };
254256
499F56722AE0832100CBDE73 /* AppCatalogSubview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCatalogSubview.swift; sourceTree = "<group>"; };
255257
499F56742AE47A3900CBDE73 /* AppUpdatesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUpdatesView.swift; sourceTree = "<group>"; };
256258
499F56772AE47BE800CBDE73 /* InstalledAppItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstalledAppItem.swift; sourceTree = "<group>"; };
@@ -336,6 +338,7 @@
336338
49CB03B02E663F8200D0016D /* LegacyContentView.swift */,
337339
490B27972E8D49C700DE50E0 /* RemoveItemButtonView.swift */,
338340
491ECC592DAC5BEB00B88732 /* ItemConfigurationView.swift */,
341+
499CC4662EBBA24D00ED16EC /* BackButton.swift */,
339342
4915291B259CD38800056B5F /* EffectsView.swift */,
340343
4915290C259CCF7A00056B5F /* NotificationBadgeView.swift */,
341344
0A24AB432624CABB004208C4 /* NotificationBadgeTextView.swift */,
@@ -761,6 +764,7 @@
761764
0A4A7388260208B500927DAB /* UptimeSubview.swift in Sources */,
762765
491ECC5A2DAC5BEB00B88732 /* ItemConfigurationView.swift in Sources */,
763766
498DB8432E5EE13A00DDC33B /* ConfiguratorSettingsView.swift in Sources */,
767+
499CC4672EBBA24D00ED16EC /* BackButton.swift in Sources */,
764768
49BF03FC2BC0BE3A00AB7152 /* FileUtilities.swift in Sources */,
765769
49822CE324B4C3F100E8DE54 /* AppDelegate.swift in Sources */,
766770
4934C79A2B99317000268CE2 /* SoftwareUpdateDeclarationModel.swift in Sources */,

src/Support/Views/AppCatalog/AppUpdatesView.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,7 @@ struct AppUpdatesView: View {
5858
Button(action: {
5959
appCatalogController.showAppUpdates.toggle()
6060
}) {
61-
if #available(macOS 26, *) {
62-
Image(systemName: "chevron.backward")
63-
.font(.system(size: 16))
64-
.padding(4)
65-
} else {
66-
Ellipse()
67-
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.1))
68-
.overlay(
69-
Image(systemName: "chevron.backward")
70-
)
71-
.frame(width: 26, height: 26)
72-
}
61+
BackButton()
7362
}
7463
.modify {
7564
if #available(macOS 26, *) {

src/Support/Views/BackButton.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// BackButton.swift
3+
// Support
4+
//
5+
// Created by Jordy Witteman on 05/11/2025.
6+
//
7+
8+
import SwiftUI
9+
10+
struct BackButton: View {
11+
12+
// Dark Mode detection
13+
@Environment(\.colorScheme) var colorScheme
14+
15+
var body: some View {
16+
if #available(macOS 26, *) {
17+
Label(NSLocalizedString("BACK", comment: ""), systemImage: "chevron.backward")
18+
.labelStyle(.iconOnly)
19+
.font(.system(size: 12))
20+
.frame(width: 12, height: 12)
21+
.padding(4)
22+
} else {
23+
Ellipse()
24+
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.1))
25+
.overlay(
26+
Image(systemName: "chevron.backward")
27+
)
28+
.frame(width: 26, height: 26)
29+
.accessibilityLabel(NSLocalizedString("BACK", comment: ""))
30+
}
31+
}
32+
}
33+
34+
#Preview {
35+
BackButton()
36+
}

src/Support/Views/ItemConfigurationView.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,7 @@ struct ItemConfigurationView: View {
9090
Button(action: {
9191
preferences.showItemConfiguration = false
9292
}) {
93-
if #available(macOS 26, *) {
94-
Image(systemName: "chevron.backward")
95-
.font(.system(size: 16))
96-
.padding(4)
97-
} else {
98-
Ellipse()
99-
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.1))
100-
.overlay(
101-
Image(systemName: "chevron.backward")
102-
)
103-
.frame(width: 26, height: 26)
104-
}
93+
BackButton()
10594
}
10695
.modify {
10796
if #available(macOS 26, *) {

src/Support/Views/UpdateView.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,7 @@ struct UpdateView: View {
5656
Button(action: {
5757
computerinfo.showMacosUpdates.toggle()
5858
}) {
59-
if #available(macOS 26, *) {
60-
Image(systemName: "chevron.backward")
61-
.font(.system(size: 16))
62-
.padding(4)
63-
} else {
64-
Ellipse()
65-
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.1))
66-
.overlay(
67-
Image(systemName: "chevron.backward")
68-
)
69-
.frame(width: 26, height: 26)
70-
}
59+
BackButton()
7160
}
7261
.modify {
7362
if #available(macOS 26, *) {

src/Support/Views/UptimeAlertView.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,7 @@ struct UptimeAlertView: View {
6464
Button(action: {
6565
computerinfo.showUptimeAlert.toggle()
6666
}) {
67-
if #available(macOS 26, *) {
68-
Image(systemName: "chevron.backward")
69-
.font(.system(size: 16))
70-
.padding(4)
71-
} else {
72-
Ellipse()
73-
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.1))
74-
.overlay(
75-
Image(systemName: "chevron.backward")
76-
)
77-
.frame(width: 26, height: 26)
78-
}
67+
BackButton()
7968
}
8069
.modify {
8170
if #available(macOS 26, *) {

src/Support/de.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@
8080
"ITEM_TYPE" = "Item type";
8181
"STORAGE" = "Storage";
8282
"NETWORK_IP_ADDRESS" = "Network IP Address";
83+
"BACK" = "Zurück";

src/Support/en.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@
8080
"ITEM_TYPE" = "Item type";
8181
"STORAGE" = "Storage";
8282
"NETWORK_IP_ADDRESS" = "Network IP Address";
83+
"BACK" = "Back";

src/Support/es.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@
8080
"ITEM_TYPE" = "Item type";
8181
"STORAGE" = "Storage";
8282
"NETWORK_IP_ADDRESS" = "Network IP Address";
83+
"BACK" = "Atrás";

src/Support/fr.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@
8080
"ITEM_TYPE" = "Item type";
8181
"STORAGE" = "Storage";
8282
"NETWORK_IP_ADDRESS" = "Network IP Address";
83+
"BACK" = "Retour";

0 commit comments

Comments
 (0)