Skip to content

Commit 0ef94a6

Browse files
committed
refactor(devtools): update task status icons and button styles #352
- Rename icons to PascalCase (CHECKED, ERROR, etc.) - Replace run button with text label in task panel - Update status bar icon for error state - Adjust icon sizes and styles in task panels
1 parent 98116c3 commit 0ef94a6

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

core/src/main/kotlin/cc/unitmesh/devti/AutoDevIcons.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ object AutoDevIcons {
1212
val DARK: Icon = IconLoader.getIcon("/icons/autodev-dark.svg", AutoDevIcons::class.java)
1313

1414
@JvmField
15-
val ERROR: Icon = IconLoader.getIcon("/icons/autodev-error.svg", AutoDevIcons::class.java)
15+
val AUTODEV_ERROR: Icon = IconLoader.getIcon("/icons/autodev-error.svg", AutoDevIcons::class.java)
1616

1717
@JvmField
1818
val COMMAND: Icon = IconLoader.getIcon("/icons/devins-command.svg", AutoDevIcons::class.java)
@@ -30,10 +30,10 @@ object AutoDevIcons {
3030
val Run: Icon = IconLoader.getIcon("/icons/run.svg", AutoDevIcons::class.java)
3131

3232
@JvmField
33-
val Error: Icon = IconLoader.getIcon("/icons/error.svg", AutoDevIcons::class.java)
33+
val ERROR: Icon = IconLoader.getIcon("/icons/error.svg", AutoDevIcons::class.java)
3434

3535
@JvmField
36-
val Checked: Icon = IconLoader.getIcon("/icons/checked.svg", AutoDevIcons::class.java)
36+
val CHECKED: Icon = IconLoader.getIcon("/icons/checked.svg", AutoDevIcons::class.java)
3737

3838
@JvmField
3939
val REPAIR: Icon = IconLoader.getIcon("/icons/repair.svg", AutoDevIcons::class.java)

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskSectionPanel.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class TaskSectionPanel(
9595
leftPanel.add(expandButton)
9696

9797
val statusIcon = when (planItem.status) {
98-
TaskStatus.COMPLETED -> JLabel(AutoDevIcons.Checked)
99-
TaskStatus.FAILED -> JLabel(AutoDevIcons.Error)
98+
TaskStatus.COMPLETED -> JLabel(AutoDevIcons.CHECKED)
99+
TaskStatus.FAILED -> JLabel(AutoDevIcons.ERROR)
100100
TaskStatus.IN_PROGRESS -> JLabel(AutoDevIcons.InProgress)
101101
TaskStatus.TODO -> JLabel(AutoDevIcons.Build)
102102
}
@@ -129,13 +129,13 @@ class TaskSectionPanel(
129129
rightPanel.add(statusLabel)
130130

131131
if (planItem.status == TaskStatus.TODO || planItem.status == TaskStatus.FAILED) {
132-
val executeButton = JButton(AutoDevIcons.Run).apply {
133-
margin = JBUI.emptyInsets()
134-
isBorderPainted = false
135-
isContentAreaFilled = false
136-
preferredSize = Dimension(20, 20)
132+
val executeButton = JButton("Execute").apply {
133+
font = font.deriveFont(Font.PLAIN, 12f)
134+
border = JBUI.Borders.empty(4, 8)
135+
preferredSize = Dimension(60, 20)
137136
addActionListener { executeSection() }
138137
}
138+
139139
rightPanel.add(executeButton)
140140
}
141141

@@ -224,4 +224,3 @@ class TaskSectionPanel(
224224
}
225225
}
226226
}
227-

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskStepPanel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ class TaskStepPanel(
105105

106106
private fun createStatusIcon(): JComponent {
107107
return when (task.status) {
108-
TaskStatus.COMPLETED -> JLabel(AutoDevIcons.Checked).apply {
108+
TaskStatus.COMPLETED -> JLabel(AutoDevIcons.CHECKED).apply {
109109
preferredSize = Dimension(20, 16)
110110
border = JBUI.Borders.empty()
111111
}
112112

113-
TaskStatus.FAILED -> JLabel(AutoDevIcons.Error).apply {
113+
TaskStatus.FAILED -> JLabel(AutoDevIcons.ERROR).apply {
114114
preferredSize = Dimension(20, 16)
115115
border = JBUI.Borders.empty()
116116
}

core/src/main/kotlin/cc/unitmesh/devti/statusbar/AutoDevStatus.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum class AutoDevStatus {
1616
WAITING -> AutoDevIcons.DARK
1717
Ready -> AutoDevIcons.AI_COPILOT
1818
InProgress -> AutoDevIcons.InProgress
19-
Error -> AutoDevIcons.ERROR
19+
Error -> AutoDevIcons.AUTODEV_ERROR
2020
Done -> AutoDevIcons.AI_COPILOT
2121
}
2222
}
Lines changed: 5 additions & 11 deletions
Loading

0 commit comments

Comments
 (0)