Skip to content

Commit 3af249f

Browse files
committed
feat(gui): use custom icons for planner changes #352
- Replace AllIcons with AutoDevIcons for change types - Add new icons for GIT_NEW, GIT_DELETE, GIT_EDIT, and GIT_MOVE- Update PlannerResultSummary to use new icons - Adjust icon spacing and layout
1 parent 90a638d commit 3af249f

File tree

6 files changed

+75
-6
lines changed

6 files changed

+75
-6
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,16 @@ object AutoDevIcons {
8585

8686
@JvmField
8787
val INPUT: Icon = IconLoader.getIcon("/icons/input.svg", AutoDevIcons::class.java)
88+
89+
@JvmField
90+
val GIT_NEW: Icon = IconLoader.getIcon("/icons/git-new.svg", AutoDevIcons::class.java)
91+
92+
@JvmField
93+
val GIT_DELETE: Icon = IconLoader.getIcon("/icons/git-delete.svg", AutoDevIcons::class.java)
94+
95+
@JvmField
96+
val GIT_EDIT: Icon = IconLoader.getIcon("/icons/git-edit.svg", AutoDevIcons::class.java)
97+
98+
@JvmField
99+
val GIT_MOVE: Icon = IconLoader.getIcon("/icons/git-move.svg", AutoDevIcons::class.java)
88100
}

core/src/main/kotlin/cc/unitmesh/devti/gui/planner/PlannerResultSummary.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cc.unitmesh.devti.gui.planner
22

33
import cc.unitmesh.devti.AutoDevBundle
4+
import cc.unitmesh.devti.AutoDevIcons
45
import cc.unitmesh.devti.util.relativePath
56
import com.intellij.icons.AllIcons
67
import com.intellij.openapi.actionSystem.AnAction
@@ -169,10 +170,10 @@ class PlannerResultSummary(
169170
layout = BoxLayout(this, BoxLayout.X_AXIS)
170171

171172
val changeIcon = when (change.type) {
172-
Change.Type.NEW -> AllIcons.Actions.New
173-
Change.Type.DELETED -> AllIcons.Actions.GC
174-
Change.Type.MOVED -> AllIcons.Actions.Forward
175-
else -> AllIcons.Actions.Edit
173+
Change.Type.NEW -> AutoDevIcons.GIT_NEW
174+
Change.Type.DELETED -> AutoDevIcons.GIT_DELETE
175+
Change.Type.MOVED -> AutoDevIcons.GIT_MOVE
176+
else -> AutoDevIcons.GIT_EDIT
176177
}
177178

178179
val fileLabel = HyperlinkLabel(fileName).apply {
@@ -188,7 +189,7 @@ class PlannerResultSummary(
188189
}
189190

190191
add(fileLabel)
191-
add(Box.createHorizontalStrut(4))
192+
add(Box.createHorizontalStrut(2))
192193

193194
val pathLabel = JBLabel(filePath).apply {
194195
foreground = UIUtil.getLabelDisabledForeground()
@@ -204,7 +205,7 @@ class PlannerResultSummary(
204205
}
205206

206207
add(pathLabel)
207-
add(Box.createHorizontalGlue()) // This pushes the action buttons to the right
208+
add(Box.createHorizontalGlue())
208209

209210
val actionsPanel = JPanel().apply {
210211
isOpaque = false
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)