@@ -2,7 +2,6 @@ package org.digma.intellij.plugin.ui.list.insights
22
33import com.intellij.openapi.project.Project
44import com.intellij.ui.components.ActionLink
5- import com.intellij.ui.components.JBPanel
65import com.intellij.util.ui.JBUI.Borders.empty
76import org.digma.intellij.plugin.document.CodeObjectsUtil
87import org.digma.intellij.plugin.model.rest.insights.SpanDurationBreakdown
@@ -94,9 +93,10 @@ fun durationBreakdownRowPanel(
9493 val spanDisplayNameLabel = getSpanDisplayNameLabel(durationBreakdown, project, moreData)
9594 val breakdownDurationLabelPanel = getBreakdownDurationLabelPanel(durationBreakdown, layoutHelper)
9695
97- durationBreakdownPanel.add(telescopeIconLabel, BorderLayout .WEST )
98- durationBreakdownPanel.add(spanDisplayNameLabel, BorderLayout .CENTER )
99- durationBreakdownPanel.add(breakdownDurationLabelPanel, BorderLayout .EAST )
96+ durationBreakdownPanel.add(telescopeIconLabel)
97+ durationBreakdownPanel.add(spanDisplayNameLabel)
98+ durationBreakdownPanel.add(Box .createHorizontalGlue())
99+ durationBreakdownPanel.add(breakdownDurationLabelPanel)
100100
101101 return durationBreakdownPanel
102102}
@@ -160,9 +160,9 @@ private fun updateDurationBreakdownPanel(durationBreakdownEntries: List<SpanDura
160160 resultBreakdownPanel!! .reset()
161161}
162162
163- private fun getDurationBreakdownPanel (): JBPanel < JBPanel < * >> {
164- val durationBreakdownPanel = JBPanel < JBPanel < * >> ()
165- durationBreakdownPanel.layout = BorderLayout ( 5 , 0 )
163+ private fun getDurationBreakdownPanel (): JPanel {
164+ val durationBreakdownPanel = JPanel ()
165+ durationBreakdownPanel.layout = BoxLayout (durationBreakdownPanel, BoxLayout . LINE_AXIS )
166166 durationBreakdownPanel.border = empty()
167167 durationBreakdownPanel.isOpaque = false
168168 return durationBreakdownPanel
@@ -192,7 +192,7 @@ private fun getSpanDisplayNameLabel(
192192 JLabel (asHtml(displayName), SwingConstants .LEFT )
193193 }
194194 messageLabel.toolTipText = displayName
195- messageLabel.border = empty(0 , 0 , 5 , 0 )
195+ messageLabel.border = empty(0 , 5 , 5 , 0 )
196196 messageLabel.isOpaque = false
197197
198198 return messageLabel
@@ -208,10 +208,10 @@ private fun getBreakdownDurationLabelPanel(
208208 boldFonts(pLabel)
209209
210210 val breakdownDurationLabelPanel = JPanel ()
211- breakdownDurationLabelPanel.layout = BorderLayout ( )
212- breakdownDurationLabelPanel.border = empty()
211+ breakdownDurationLabelPanel.layout = BoxLayout (breakdownDurationLabelPanel, BoxLayout . LINE_AXIS )
212+ breakdownDurationLabelPanel.border = empty(0 , 0 , 0 , 5 )
213213 breakdownDurationLabelPanel.isOpaque = false
214- breakdownDurationLabelPanel.add(pLabel, BorderLayout . WEST )
214+ breakdownDurationLabelPanel.add(pLabel)
215215 addCurrentLargestWidthDurationPLabel(layoutHelper, breakdownDurationLabelPanel.preferredSize.width)
216216
217217 return breakdownDurationLabelPanel
0 commit comments