Skip to content

Commit 98116c3

Browse files
committed
refactor(devti): adjust task panel padding and visibility logic #352
- Reduce right padding from 16 to 0 in TaskSectionPanel border - Increase left padding from 4 to 8 in stepsPanel border - Simplify steps visibility toggle by removing redundant revalidate/repaint calls - Remove unused CompoundBorder import in TaskStepPanel
1 parent 099883c commit 98116c3

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskSectionPanel.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class TaskSectionPanel(
4242
background = JBUI.CurrentTheme.ToolWindow.background()
4343
border = CompoundBorder(
4444
BorderFactory.createMatteBorder(0, 0, 1, 0, JBColor.border()),
45-
JBUI.Borders.empty(4, 16)
45+
JBUI.Borders.empty(4, 0)
4646
)
4747

4848
val headerPanel = createHeaderPanel()
4949
add(headerPanel, BorderLayout.NORTH)
5050

5151
stepsPanel.layout = BoxLayout(stepsPanel, BoxLayout.Y_AXIS)
5252
stepsPanel.background = JBUI.CurrentTheme.ToolWindow.background()
53-
stepsPanel.border = JBUI.Borders.emptyLeft(4)
53+
stepsPanel.border = JBUI.Borders.emptyLeft(8)
5454

5555
refreshStepsPanel()
5656

@@ -158,15 +158,11 @@ class TaskSectionPanel(
158158

159159
private fun toggleStepsVisibility(visible: Boolean) {
160160
scrollPane.isVisible = visible
161-
SwingUtilities.invokeLater {
162-
parent?.revalidate()
163-
parent?.repaint()
164-
}
161+
stepsPanel.isVisible = visible
165162
}
166163

167164
private fun refreshStepsPanel() {
168165
stepsPanel.removeAll()
169-
170166
planItem.steps.forEach { step ->
171167
val taskStepPanel = TaskStepPanel(project, step) {
172168
updateSectionStatus()

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskStepPanel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import java.awt.Font
2323
import java.awt.event.MouseAdapter
2424
import java.awt.event.MouseEvent
2525
import javax.swing.*
26-
import javax.swing.border.CompoundBorder
2726
import javax.swing.text.AttributeSet
2827
import javax.swing.text.SimpleAttributeSet
2928
import javax.swing.text.StyleConstants

0 commit comments

Comments
 (0)