@@ -74,21 +74,38 @@ class SingleFileDiffSketch(
74
74
this @SingleFileDiffSketch.appliedPatch,
75
75
this @SingleFileDiffSketch.patch
76
76
)
77
- val filepathLabel = JBLabel (currentFile.name).apply {
77
+
78
+ val fileName = if (currentFile.name.contains(" /" )) {
79
+ currentFile.name.substringAfterLast(" /" )
80
+ } else {
81
+ currentFile.name
82
+ }
83
+
84
+ val filepathLabel = JBLabel (fileName).apply {
78
85
icon = currentFile.fileType.icon
79
86
border = BorderFactory .createEmptyBorder(2 , 10 , 2 , 10 )
80
-
87
+
88
+ val originalColor = foreground
89
+ val hoverColor = JBColor (0x4A7EB3 , 0x589DF6 ) // Blue color for hover state
90
+
81
91
addMouseListener(object : MouseAdapter () {
82
92
override fun mouseClicked (e : MouseEvent ? ) {
83
93
FileEditorManager .getInstance(myProject).openFile(currentFile, true )
84
94
}
85
-
86
- override fun mouseEntered (e : MouseEvent ) {
87
- patchActionPanel?.background = JBColor (DarculaColors .BLUE , DarculaColors .BLUE )
95
+
96
+ override fun mouseEntered (e : MouseEvent ? ) {
97
+ foreground = hoverColor
98
+ cursor = java.awt.Cursor .getPredefinedCursor(java.awt.Cursor .HAND_CURSOR )
99
+ border = BorderFactory .createCompoundBorder(
100
+ BorderFactory .createMatteBorder(0 , 0 , 1 , 0 , hoverColor),
101
+ BorderFactory .createEmptyBorder(2 , 10 , 1 , 10 )
102
+ )
88
103
}
89
-
90
- override fun mouseExited (e : MouseEvent ) {
91
- patchActionPanel?.background = JBColor .PanelBackground
104
+
105
+ override fun mouseExited (e : MouseEvent ? ) {
106
+ foreground = originalColor
107
+ cursor = java.awt.Cursor .getDefaultCursor()
108
+ border = BorderFactory .createEmptyBorder(2 , 10 , 2 , 10 )
92
109
}
93
110
})
94
111
}
@@ -337,4 +354,4 @@ fun saveText(file: VirtualFile, text: String) {
337
354
stream.write(text.toByteArray(charset))
338
355
}
339
356
}
340
- }
357
+ }
0 commit comments