[collab] Always show focus border around rounded panel when focus is inside

GitOrigin-RevId: b2661d8f8f845c6ba79aefe19b7a6a322da3abd1
This commit is contained in:
Chris Lemaire
2025-06-12 18:42:47 +02:00
committed by intellij-monorepo-bot
parent b808732dda
commit 119e5ffecd

View File

@@ -24,6 +24,7 @@ import com.intellij.openapi.actionSystem.UiDataProvider
import com.intellij.openapi.editor.colors.EditorColors
import com.intellij.openapi.editor.colors.EditorColorsManager
import com.intellij.openapi.ui.MessageDialogBuilder
import com.intellij.openapi.wm.IdeFocusManager
import com.intellij.ui.ColorUtil
import com.intellij.ui.JBColor
import com.intellij.ui.OverlaidOffsetIconsIcon
@@ -42,14 +43,9 @@ import org.jetbrains.annotations.ApiStatus
import java.awt.BorderLayout
import java.awt.Color
import java.awt.Insets
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import java.awt.event.ComponentAdapter
import java.awt.event.ComponentEvent
import javax.swing.JComponent
import javax.swing.JLabel
import javax.swing.JPanel
import javax.swing.LayoutFocusTraversalPolicy
import java.awt.KeyboardFocusManager
import java.awt.event.*
import javax.swing.*
object CodeReviewCommentUIUtil {
@@ -72,7 +68,8 @@ object CodeReviewCommentUIUtil {
@ApiStatus.Internal
fun createEditorInlayPanel(component: JComponent, tint: Color? = null): JPanel {
val borderColor = JBColor.lazy {
if (component.hasFocus()) return@lazy JBUI.CurrentTheme.Focus.focusColor()
if (UIUtil.isFocusAncestor(component))
return@lazy JBUI.CurrentTheme.Focus.focusColor()
val scheme = EditorColorsManager.getInstance().globalScheme
scheme.getColor(EditorColors.TEARLINE_COLOR) ?: JBColor.border()