Skip to content

Commit 822a6f8

Browse files
authored
Fix tab title repaint (#102)
* fix tab title repaint Signed-off-by: shalom <[email protected]> * fix tab title repaint Signed-off-by: shalom <[email protected]> * fix tab title repaint Signed-off-by: shalom <[email protected]>
1 parent 33d10d7 commit 822a6f8

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

ide-common/src/main/kotlin/org/digma/intellij/plugin/ui/service/AbstractViewService.kt

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,22 @@ abstract class AbstractViewService(val project: Project) {
2525
return
2626
}
2727

28-
if (SwingUtilities.isEventDispatchThread()) {
28+
val r = Runnable {
2929
toolWindow?.contentManager?.setSelectedContent(toolWindowContent!!, false)
30+
toolWindowContent?.component?.revalidate()
31+
panel?.reset()
32+
}
33+
34+
if (SwingUtilities.isEventDispatchThread()) {
35+
r.run()
3036
} else {
3137
SwingUtilities.invokeLater {
32-
toolWindow?.contentManager?.setSelectedContent(toolWindowContent!!, false)
38+
r.run()
3339
}
3440
}
3541
}
3642

43+
@Suppress("unused")
3744
fun isVisible():Boolean{
3845
return toolWindow?.contentManager?.selectedContent === toolWindowContent
3946
}
@@ -54,21 +61,28 @@ abstract class AbstractViewService(val project: Project) {
5461
return
5562
}
5663

57-
if (toolWindowContent != null){
58-
toolWindowContent?.displayName = getViewDisplayName()
59-
}
6064

61-
if (panel != null){
65+
if (panel != null) {
6266

63-
if (SwingUtilities.isEventDispatchThread()){
67+
val r = Runnable {
6468
panel?.reset()
65-
}else{
69+
70+
if (toolWindowContent != null) {
71+
toolWindowContent?.displayName = getViewDisplayName()
72+
toolWindowContent?.component?.revalidate()
73+
toolWindow?.component?.revalidate()
74+
toolWindow?.component?.repaint()
75+
}
76+
}
77+
78+
if (SwingUtilities.isEventDispatchThread()) {
79+
r.run()
80+
} else {
6681
SwingUtilities.invokeLater {
67-
panel?.reset()
82+
r.run()
6883
}
6984
}
7085
}
71-
7286
}
7387

7488
protected fun getNonSupportedFileScopeMessage(fileUri: String?): String{

src/main/kotlin/org/digma/intellij/plugin/ui/common/EnvironmentsPanel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class EnvironmentsPanel(project: Project, private val environmentsSupplier: Envi
112112
}
113113
}
114114
revalidate()
115+
repaint()
115116
}
116117

117118
private fun getSelected(): EnvLink? {

0 commit comments

Comments
 (0)