Skip to content

Commit 1623970

Browse files
committed
Fix selection highlighting
1 parent e6c5eef commit 1623970

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/kotlin/com/coder/gateway/views/steps/WorkspaceCellRenderer.kt

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.coder.gateway.views.steps
33
import com.coder.gateway.sdk.v2.models.ProvisionerJobStatus
44
import com.coder.gateway.sdk.v2.models.Workspace
55
import com.coder.gateway.sdk.v2.models.WorkspaceBuildTransition
6-
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
76
import com.intellij.ui.IconManager
87
import com.intellij.ui.dsl.builder.panel
98
import com.intellij.util.ui.JBFont
@@ -13,7 +12,7 @@ import javax.swing.ListCellRenderer
1312

1413
class WorkspaceCellRenderer : ListCellRenderer<Workspace> {
1514

16-
override fun getListCellRendererComponent(list: JList<out Workspace>?, workspace: Workspace, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component {
15+
override fun getListCellRendererComponent(list: JList<out Workspace>, workspace: Workspace, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component {
1716
return panel {
1817
indent {
1918
row {
@@ -30,7 +29,13 @@ class WorkspaceCellRenderer : ListCellRenderer<Workspace> {
3029
}
3130
}
3231
}.apply {
33-
background = WelcomeScreenUIManager.getProjectsSelectionBackground(true)
32+
if (isSelected) {
33+
background = list.selectionBackground
34+
foreground = list.selectionForeground
35+
} else {
36+
background = list.background
37+
foreground = list.selectionForeground
38+
}
3439
}
3540
}
3641

0 commit comments

Comments
 (0)