1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package me.kyren223.trident
import com.intellij.ui.JBIntSpinner
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.components.JBLabel
import com.intellij.util.ui.FormBuilder
import javax.swing.JPanel
class SettingsData {
val panel: JPanel
private val width: JBIntSpinner = JBIntSpinner(800, 1, 5000, 10)
private val height: JBIntSpinner = JBIntSpinner(400, 1, 5000, 10)
private val fontSize: JBIntSpinner = JBIntSpinner(20, 1, 100)
private val enterToSelect: JBCheckBox = JBCheckBox()
init {
panel = FormBuilder.createFormBuilder()
.addLabeledComponent(JBLabel("QuickMenu width"), width, 1, false)
.addLabeledComponent(JBLabel("QuickMenu height"), height, 1, false)
.addLabeledComponent(JBLabel("QuickMenu font size"), fontSize, 1, false)
.addLabeledComponent(JBLabel("Enter to select item in the QuickMenu"), enterToSelect, 1, false)
.addComponentFillVertically(JPanel(), 0)
.panel
}
fun getWidth(): Int {
return width.number
}
fun getHeight(): Int {
return height.number
}
fun getFontSize(): Int {
return fontSize.number
}
fun getEnterToSelect(): Boolean {
return enterToSelect.isSelected
}
fun setWidth(width: Int) {
this.width.number = width
}
fun setHeight(height: Int) {
this.height.number = height
}
fun setFontSize(fontSize: Int) {
this.fontSize.number = fontSize
}
fun setEnterToSelect(enter: Boolean) {
this.enterToSelect.isSelected = enter
}
}
|