Skip to content

Commit 4a83400

Browse files
committed
refactor(devti): enhance UI styling and theme support
- Update Markdown viewer background color to match current theme - Improve Plan toolbar appearance and spacing - Adjust TaskStepPanel label styling for better readability - Update AI copilot icon color to match new branding - Enlarge stop icon for better visibility
1 parent cb32e0f commit 4a83400

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/MarkdownWebViewer.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.intellij.openapi.util.text.StringUtil
55
import com.intellij.ui.BrowserHyperlinkListener
66
import com.intellij.ui.ColorUtil
77
import com.intellij.util.ui.HTMLEditorKitBuilder
8+
import com.intellij.util.ui.JBUI
89
import com.intellij.util.ui.UIUtil
910
import javax.swing.JEditorPane
1011
import javax.swing.text.DefaultCaret
@@ -15,8 +16,8 @@ object MarkdownWebViewer {
1516
jEditorPane.setContentType("text/html")
1617
val htmlEditorKit = HTMLEditorKitBuilder().build()
1718

18-
val backgroundColor = UIUtil.getPanelBackground()
19-
val backgroundColorHex = ColorUtil.toHex(backgroundColor)
19+
val backgroundColor = JBUI.CurrentTheme.ToolWindow.background()
20+
val bg = ColorUtil.toHex(backgroundColor)
2021

2122
val editorFontName = EditorColorsManager.getInstance().schemeForCurrentUITheme.editorFontName
2223
val editorFontSize = EditorColorsManager.getInstance().schemeForCurrentUITheme.editorFontSize
@@ -31,8 +32,8 @@ object MarkdownWebViewer {
3132
h3 { font-size: 1.2em; font-weight: bold; }
3233
h4, h5, h6 { font-size: 1.1em; font-weight: bold; }
3334
34-
pre { background-color: #f5f5f5; border-radius: 4px; padding: 8px; overflow-x: auto; margin: 1em 0; }
35-
code { font-family: 'JetBrains Mono', Consolas, monospace; background-color: #f5f5f5; padding: 2px 4px; border-radius: 3px; font-size: 0.9em; }
35+
pre { background-color: #$bg; border-radius: 4px; padding: 8px; overflow-x: auto; margin: 1em 0; }
36+
code { font-family: 'JetBrains Mono', Consolas, monospace; background-color: #$bg; padding: 2px 4px; border-radius: 3px; font-size: 0.9em; }
3637
3738
/* Lists */
3839
ul, ol { margin-top: 0.5em; margin-bottom: 0.5em; padding-left: 2em; }
@@ -51,7 +52,7 @@ object MarkdownWebViewer {
5152
a:hover { text-decoration: underline; }
5253
5354
/* Horizontal rule */
54-
hr { border: 0; height: 1px; background-color: #ddd; margin: 1em 0; }
55+
hr { border: 0; height: 1px; background-color: #$bg; margin: 1em 0; }
5556
5657
/* Inline elements */
5758
strong, b { font-weight: bold; }

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,22 @@ class PlanToolbarFactory(private val project: Project) {
3030
this.targetComponent = component
3131
}
3232

33-
val titleLabel = JLabel("Thought Plan").apply {
33+
val bg = JBUI.CurrentTheme.ToolWindow.background()
34+
toolbar.component.setBackground(bg)
35+
36+
val titleLabel = JLabel("Plan").apply {
3437
border = JBUI.Borders.empty(0, 10)
3538
}
3639

3740
val toolbarPanel = JPanel(BorderLayout()).apply {
3841
add(titleLabel, BorderLayout.WEST)
3942
add(toolbar.component, BorderLayout.EAST)
43+
}.also {
44+
it.background = bg
4045
}
4146

4247
val toolbarWrapper = Wrapper(JBUI.Panels.simplePanel(toolbarPanel)).also {
43-
it.border = JBUI.Borders.customLine(UIUtil.getBoundsColor(), 1, 1, 1, 1)
48+
it.border = JBUI.Borders.customLine(UIUtil.getBoundsColor(), 0, 0, 1, 0)
4449
}
4550

4651
return toolbarWrapper

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ class TaskStepPanel(
9595
private fun createStyledTaskLabel(): JEditorPane {
9696
val labelText = getLabelTextByStatus()
9797

98-
val backgroundColor = UIUtil.getPanelBackground()
98+
val backgroundColor = JBUI.CurrentTheme.ToolWindow.background()
9999
val backgroundColorHex = ColorUtil.toHex(backgroundColor)
100100

101-
// Get the foreground color that matches the current theme
102101
val foregroundColor = UIUtil.getLabelForeground()
103102
val foregroundColorHex = ColorUtil.toHex(foregroundColor)
104103

core/src/main/resources/icons/ai-copilot.svg

Lines changed: 1 addition & 1 deletion
Loading

core/src/main/resources/icons/stop.svg

Lines changed: 1 addition & 1 deletion
Loading

core/src/main/resources/icons/view.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)