Skip to content

Commit c5759fc

Browse files
committed
fix(sketch): improve diff sketch UI styling and borders
Add border to wrapper panel and update toggle button styling by removing border painting, setting content area to transparent, and adjusting size from 20px to 24px with empty insets.
1 parent 9f40329 commit c5759fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/SingleFileDiffSketch.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import com.intellij.ui.components.panels.HorizontalLayout
3535
import com.intellij.ui.components.panels.VerticalLayout
3636
import com.intellij.util.LocalTimeCounter
3737
import com.intellij.util.concurrency.annotations.RequiresWriteLock
38+
import com.intellij.util.ui.JBUI
39+
import com.intellij.util.ui.UIUtil
3840
import java.awt.BorderLayout
3941
import java.awt.Dimension
4042
import java.awt.event.MouseAdapter
@@ -212,6 +214,7 @@ class SingleFileDiffSketch(
212214
wrapperPanel.preferredSize = Dimension(wrapperPanel.preferredSize.width, maxOf(200, minHeight))
213215
wrapperPanel.maximumSize = Dimension(Int.MAX_VALUE, maxOf(200, minHeight))
214216

217+
wrapperPanel.border = JBUI.Borders.customLine(UIUtil.getBoundsColor(), 1, 1, 1, 1)
215218
return wrapperPanel
216219
}
217220

@@ -268,7 +271,10 @@ class SingleFileDiffSketch(
268271

269272
val toggleButton = JButton().apply {
270273
icon = AllIcons.Actions.Diff
271-
preferredSize = Dimension(20, 20)
274+
preferredSize = Dimension(24, 24)
275+
margin = JBUI.emptyInsets()
276+
isBorderPainted = false
277+
isContentAreaFilled = false
272278
isOpaque = false
273279
toolTipText = AutoDevBundle.message("sketch.terminal.show.hide")
274280
addActionListener {

0 commit comments

Comments
 (0)