mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 01:51:21 +08:00
fix(jetbrains): outline prompt bubbles
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@kilocode/kilo-jetbrains": patch
|
||||
---
|
||||
|
||||
Always outline JetBrains prompt bubbles and use a rounder prompt bubble shape.
|
||||
+1
-1
@@ -155,7 +155,7 @@ object SessionUiStyle {
|
||||
const val EDITOR_LINES = 1
|
||||
const val EDITOR_CHROME = 16
|
||||
const val SEND_BUTTON_SIZE = 24
|
||||
const val CORNER_ARC = 6
|
||||
const val CORNER_ARC = 10
|
||||
const val FOCUS_WIDTH = 2
|
||||
const val PANEL_VERTICAL_PADDING = 8
|
||||
const val PANEL_HORIZONTAL_PADDING = 12
|
||||
|
||||
+7
-1
@@ -479,10 +479,16 @@ class MessageView(
|
||||
val g2 = g.create() as Graphics2D
|
||||
try {
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)
|
||||
val arc = JBUI.scale(JBUI.getInt("Button.arc", SessionUiStyle.View.Prompt.CORNER_ARC))
|
||||
val arc = JBUI.scale(SessionUiStyle.View.Prompt.CORNER_ARC)
|
||||
val pt = if (box === this) Point() else SwingUtilities.convertPoint(box, Point(), this)
|
||||
g2.color = SessionUiStyle.View.Prompt.bgColor(style)
|
||||
g2.fillRoundRect(pt.x, pt.y, box.width, box.height, arc, arc)
|
||||
val w = box.width - 1
|
||||
val h = box.height - 1
|
||||
if (w > 0 && h > 0) {
|
||||
g2.color = SessionUiStyle.View.Outline.color()
|
||||
g2.drawRoundRect(pt.x, pt.y, w, h, arc, arc)
|
||||
}
|
||||
} finally {
|
||||
g2.dispose()
|
||||
}
|
||||
|
||||
+7
-10
@@ -819,16 +819,13 @@ class SessionMessageListPanelTest : BasePlatformTestCase() {
|
||||
message.paint(graphics)
|
||||
graphics.dispose()
|
||||
|
||||
// The bubble is a filled code-block surface; it only draws an outline when that fill matches
|
||||
// the session background. Probing the box edges verifies it paints at the wrapped coordinates.
|
||||
val bg = SessionUiStyle.View.Prompt.bgColor(SessionEditorStyle.current())
|
||||
val expected = if (bg.rgb == SessionUiStyle.Colors.sessionBackground().rgb) {
|
||||
SessionUiStyle.View.Outline.color().rgb
|
||||
} else {
|
||||
bg.rgb
|
||||
}
|
||||
assertEquals(expected, Color(image.getRGB(point.x + box.width / 2, point.y), true).rgb)
|
||||
assertEquals(expected, Color(image.getRGB(point.x + box.width / 2, point.y + box.height - 1), true).rgb)
|
||||
// The bubble always draws an outline; probing the box edges verifies it paints at the
|
||||
// wrapped coordinates, while the center remains the prompt fill surface.
|
||||
val outline = SessionUiStyle.View.Outline.color().rgb
|
||||
val fill = SessionUiStyle.View.Prompt.bgColor(SessionEditorStyle.current()).rgb
|
||||
assertEquals(outline, Color(image.getRGB(point.x + box.width / 2, point.y), true).rgb)
|
||||
assertEquals(outline, Color(image.getRGB(point.x + box.width / 2, point.y + box.height - 1), true).rgb)
|
||||
assertEquals(fill, Color(image.getRGB(point.x + box.width / 2, point.y + box.height / 2), true).rgb)
|
||||
}
|
||||
|
||||
fun `test created ContentDelta is not double applied`() {
|
||||
|
||||
Reference in New Issue
Block a user