@@ -12,12 +12,15 @@ import yesweburp.ui.matchSizes
1212import java.awt.*
1313import java.awt.event.MouseAdapter
1414import java.awt.event.MouseEvent
15+ import java.awt.font.TextAttribute
1516import java.lang.StrictMath.min
1617import java.util.*
1718import javax.swing.Box
19+ import javax.swing.JEditorPane
1820import javax.swing.JLabel
1921import javax.swing.JTable
2022import javax.swing.border.EmptyBorder
23+ import kotlin.reflect.jvm.internal.impl.resolve.calls.inference.CapturedType
2124
2225
2326class ProgramInfoPanel (program : Program ) : BorderPanel() {
@@ -35,19 +38,10 @@ class ProgramInfoPanel(program: Program) : BorderPanel() {
3538 override fun mouseClicked (e : MouseEvent ? ) {
3639 openInBrowser(" https://yeswehack.com/programs/${program.slug} " )
3740 }
38-
39- override fun mouseEntered (e : MouseEvent ? ) {
40- super .mouseEntered(e)
41- text = " <html><u>${program.title} </u></html>"
42- }
43-
44- override fun mouseExited (e : MouseEvent ? ) {
45- super .mouseExited(e)
46- text = program.title
47- }
4841 })
4942 }
5043
44+
5145 val privateLabel = Label {
5246 if (program.public) {
5347 text = " Public"
@@ -66,21 +60,23 @@ class ProgramInfoPanel(program: Program) : BorderPanel() {
6660
6761 matchSizes(privateLabel, configButton)
6862 add(privateLabel, gridY = 0 )
69- add(Box .createHorizontalGlue(), gridY = 0 , weightX = 1.0 , fill = GridBagConstraints .HORIZONTAL )
63+ add(Box .createHorizontalGlue(), gridY = 0 , weightX = 1.0 , fill = GridBagConstraints .HORIZONTAL )
7064 add(title, gridY = 0 )
71- add(Box .createHorizontalGlue(), gridY = 0 , weightX = 1.0 , fill = GridBagConstraints .HORIZONTAL )
65+ add(Box .createHorizontalGlue(), gridY = 0 , weightX = 1.0 , fill = GridBagConstraints .HORIZONTAL )
7266 add(configButton, gridY = 0 )
7367 }
7468 }
7569
7670 private class HTMLBox (rules : String ) : BorderPanel() {
7771 init {
7872 border = EmptyBorder (5 , 0 , 0 , 0 )
79- val css = " html{width:600px;padding:5px;font-family: InriaSans,Arial,sans-serif;} p{text-align: justify} img{max-width:100%}"
80- val htmlRules = Label (" <html><head><style>${css} </style></head><body>${rules} </body></html>" ) {
81- verticalAlignment = JLabel .TOP
82- isOpaque = true
83- }
73+ val css =
74+ " html{width:600px;padding:5px;font-family: InriaSans,Arial,sans-serif;} p{text-align: justify} img{max-width:100%}"
75+ val htmlRules =
76+ JEditorPane (" text/html" , " <html><head><style>${css} </style></head><body>${rules} </body></html>" )
77+ htmlRules.isEditable = false
78+ htmlRules.isOpaque = true
79+ htmlRules.alignmentY = JEditorPane .TOP_ALIGNMENT
8480 center = ScrollPane (htmlRules) {
8581 maximumSize = Dimension (Int .MAX_VALUE , Int .MAX_VALUE )
8682 verticalScrollBar.unitIncrement = 16
0 commit comments