Skip to content

Commit 3ae99ad

Browse files
committed
feat: Update UI elements with new icons and improved button styles
1 parent 601e0e4 commit 3ae99ad

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

core/src/main/kotlin/cc/unitmesh/devti/agent/view/WebViewWindow.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ class WebViewWindow {
3535
private val urlField = JTextField()
3636

3737
private val refreshButton = JButton(AllIcons.Actions.Refresh).apply {
38-
isBorderPainted = false
39-
isContentAreaFilled = false
40-
cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)
38+
preferredSize = Dimension(24, 24)
4139
}
4240

4341
private val openDefaultBrowserButton = JButton(AllIcons.Xml.Browsers.Chrome).apply {
44-
isBorderPainted = false
45-
isContentAreaFilled = false
46-
cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)
42+
preferredSize = Dimension(24, 24)
4743
}
4844

4945
init {

core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import cc.unitmesh.devti.AutoDevIcons
44
import cc.unitmesh.devti.gui.AutoDevToolWindowFactory
55
import cc.unitmesh.devti.settings.LanguageChangedCallback.componentStateChanged
66
import cc.unitmesh.devti.sketch.SketchToolWindow
7+
import com.intellij.icons.AllIcons
78
import com.intellij.openapi.actionSystem.*
89
import com.intellij.openapi.actionSystem.ex.CustomComponentAction
910
import com.intellij.openapi.diagnostic.logger
@@ -13,7 +14,7 @@ import com.intellij.util.ui.JBUI
1314
import javax.swing.JButton
1415
import javax.swing.JComponent
1516

16-
class NewSketchAction : AnAction("New Sketch", "Create new Sketch", AutoDevIcons.COMMAND), CustomComponentAction {
17+
class NewSketchAction : AnAction("New Sketch", "Create new Sketch", AllIcons.General.Add), CustomComponentAction {
1718
private val logger = logger<NewChatAction>()
1819

1920
override fun update(e: AnActionEvent) {

core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import com.intellij.ui.dsl.builder.Cell
3636
import com.intellij.ui.dsl.builder.Row
3737
import com.intellij.ui.dsl.builder.panel
3838
import com.intellij.util.ui.JBUI
39+
import com.intellij.util.ui.UIUtil
3940
import org.jetbrains.annotations.NonNls
4041
import java.awt.BorderLayout
4142
import java.awt.Toolkit
@@ -111,6 +112,11 @@ class SketchToolWindow(val project: Project, val editor: Editor?, private val sh
111112
}
112113
}
113114

115+
header.border = JBUI.Borders.compound(
116+
JBUI.Borders.customLine(UIUtil.getBoundsColor(), 0, 0, 1, 0),
117+
JBUI.Borders.empty(0, 4, 0, 4)
118+
)
119+
114120
contentPanel.add(header, BorderLayout.NORTH)
115121
}
116122

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/FileInsCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FileInsCommand(private val myProject: Project, private val prop: String) :
5858
}
5959

6060
val output = StringBuilder()
61-
output.append("// File: $prop\n")
61+
output.append("// File: $prop")
6262
output.append("\n```$lang\n")
6363
output.append(fileContent)
6464
output.append("\n```\n")

exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/sketch/TerminalSketchProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import cc.unitmesh.devti.sketch.SketchToolWindow
66
import cc.unitmesh.devti.sketch.ui.ExtensionLangSketch
77
import cc.unitmesh.devti.sketch.ui.LanguageSketchProvider
88
import com.intellij.execution.filters.Filter
9+
import com.intellij.icons.AllIcons
910
import com.intellij.lang.Language
1011
import com.intellij.openapi.actionSystem.ActionManager
1112
import com.intellij.openapi.actionSystem.AnAction
@@ -107,7 +108,7 @@ class TerminalSketchProvider : LanguageSketchProvider {
107108
}
108109

109110
fun createConsoleActions(): List<AnAction> {
110-
val clearAction = object : AnAction("Clear", "Clear Terminal", null) {
111+
val clearAction = object : AnAction("Clear", "Clear Terminal", AllIcons.Actions.GC) {
111112
override fun actionPerformed(p0: AnActionEvent) {
112113
terminalWidget?.terminalStarter?.sendString("clear\n", false)
113114
}

0 commit comments

Comments
 (0)