Skip to content

Commit 45aa64c

Browse files
committed
Finish Activity Viewer Pills
1 parent 7e50ff9 commit 45aa64c

File tree

2 files changed

+49
-20
lines changed

2 files changed

+49
-20
lines changed

CodeEdit/Features/ActivityViewer/Tasks/SchemeDropDownView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct SchemeDropDownView: View {
6464
HStack(spacing: 4) {
6565
label
6666
chevron
67-
.padding(.leading, 1)
67+
.offset(x: 2)
6868
.opacity(isHoveringScheme || isSchemePopOverPresented ? 0.0 : 1.0)
6969
}
7070
.background {

CodeEdit/Features/ActivityViewer/Tasks/TaskDropDownView.swift

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,12 @@ struct TaskDropDownView: View {
2121

2222
var body: some View {
2323
Group {
24-
if let selectedTask = taskManager.selectedTask {
25-
if let selectedActiveTask = taskManager.activeTasks[selectedTask.id] {
26-
ActiveTaskView(activeTask: selectedActiveTask)
27-
.fixedSize()
28-
} else {
29-
TaskView(task: selectedTask, status: CETaskStatus.notRunning)
30-
.fixedSize()
31-
}
24+
if #available(macOS 26, *) {
25+
tahoe
3226
} else {
33-
Text("Create Tasks")
34-
.frame(minWidth: 0)
27+
seqouia
3528
}
3629
}
37-
.opacity(activeState == .inactive ? 0.4 : 1.0)
38-
.font(.subheadline)
39-
.padding(.trailing, 11.5)
40-
.padding(.horizontal, 2.5)
41-
.padding(.vertical, 2.5)
42-
.background(backgroundColor)
4330
.onHover { hovering in
4431
self.isHoveringTasks = hovering
4532
}
@@ -60,7 +47,49 @@ struct TaskDropDownView: View {
6047
}
6148
}
6249

63-
private var backgroundColor: some View {
50+
@available(macOS 26, *)
51+
@ViewBuilder private var tahoe: some View {
52+
HStack(spacing: 4) {
53+
label
54+
chevronIcon
55+
.opacity(isHoveringTasks || isTaskPopOverPresented ? 1.0 : 0.0)
56+
}
57+
.padding(6)
58+
.background {
59+
Color(nsColor: colorScheme == .dark ? .white : .black)
60+
.opacity(isHoveringTasks || isTaskPopOverPresented ? 0.05 : 0)
61+
.clipShape(Capsule(style: .continuous))
62+
}
63+
}
64+
65+
@ViewBuilder private var seqouia: some View {
66+
label
67+
.opacity(activeState == .inactive ? 0.4 : 1.0)
68+
.padding(.trailing, 11.5)
69+
.padding(.horizontal, 2.5)
70+
.padding(.vertical, 2.5)
71+
.background(backgroundColor)
72+
}
73+
74+
@ViewBuilder private var label: some View {
75+
Group {
76+
if let selectedTask = taskManager.selectedTask {
77+
if let selectedActiveTask = taskManager.activeTasks[selectedTask.id] {
78+
ActiveTaskView(activeTask: selectedActiveTask)
79+
.fixedSize()
80+
} else {
81+
TaskView(task: selectedTask, status: CETaskStatus.notRunning)
82+
.fixedSize()
83+
}
84+
} else {
85+
Text("Create Tasks")
86+
.frame(minWidth: 0)
87+
}
88+
}
89+
.font(.subheadline)
90+
}
91+
92+
@ViewBuilder private var backgroundColor: some View {
6493
Color(nsColor: colorScheme == .dark ? .white : .black)
6594
.opacity(isHoveringTasks || isTaskPopOverPresented ? 0.05 : 0)
6695
.clipShape(RoundedRectangle(cornerSize: CGSize(width: 4, height: 4)))
@@ -74,14 +103,14 @@ struct TaskDropDownView: View {
74103
)
75104
}
76105

77-
private var chevronIcon: some View {
106+
@ViewBuilder private var chevronIcon: some View {
78107
Image(systemName: "chevron.down")
79108
.font(.system(size: 8, weight: .bold, design: .default))
80109
.padding(.top, 0.5)
81110
.padding(.trailing, 2)
82111
}
83112

84-
private var taskPopoverContent: some View {
113+
@ViewBuilder private var taskPopoverContent: some View {
85114
VStack(alignment: .leading, spacing: 0) {
86115
if !taskManager.availableTasks.isEmpty {
87116
ForEach(taskManager.availableTasks, id: \.id) { task in

0 commit comments

Comments
 (0)