Skip to content

Commit 02804ea

Browse files
Changed Button to Toggle
1 parent e0ac045 commit 02804ea

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,14 @@ struct ProjectNavigatorToolbarBottom: View {
2828
leadingAccessories: {
2929
FilterDropDownIconButton(menu: {
3030
ForEach([(true, "Folders on top"), (false, "Alphabetically")], id: \.0) { value, title in
31-
Button {
31+
Toggle(title, isOn: Binding(get: {
32+
workspace.sortFoldersOnTop == value
33+
}, set: { _ in
3234
// Avoid calling the handleFilterChange method
3335
if workspace.sortFoldersOnTop != value {
3436
workspace.sortFoldersOnTop = value
3537
}
36-
} label: {
37-
HStack {
38-
if value == workspace.sortFoldersOnTop {
39-
Image(systemName: "checkmark")
40-
}
41-
Text(title)
42-
}
43-
}
38+
}))
4439
}
4540
}, isOn: !workspace.navigatorFilter.isEmpty)
4641
.padding(.leading, 4)

0 commit comments

Comments
 (0)