Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Fix view a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanDalelR committed Sep 14, 2023
1 parent cc39110 commit af7e5ac
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,19 @@ class MyToolWindowFactory : ToolWindowFactory {
add(expandedPanel, "Expanded")

val switchPanelListener = ActionListener {
// Switch between panels
if ((layout as CardLayout) == cardLayout) {
if (expandedPanel.isVisible) {
cardLayout.show(this@ExpandablePanel, "TitleOnly")
} else {
cardLayout.show(this@ExpandablePanel, "Expanded")
}
}
remove(titlePanel)
add(expandedPanel)
revalidate()
repaint()
}

titleButton.addActionListener(switchPanelListener)
bodyTextArea.addMouseListener(object : MouseAdapter() {
override fun mouseClicked(e: MouseEvent?) {
switchPanelListener.actionPerformed(null)
remove(expandedPanel)
add(titlePanel)
revalidate()
repaint()
}
})
}
Expand Down

0 comments on commit af7e5ac

Please sign in to comment.