comparison src/name/blackcap/clipman/PasteboardView.kt @ 47:19d9da731c43

Recoded; cleaned up root namespace, removed race conditions.
author David Barts <n5jrn@me.com>
date Sun, 12 Apr 2020 14:31:06 -0700
parents 0c6c18a733b7
children
comparison
equal deleted inserted replaced
46:88066346f129 47:19d9da731c43
54 54
55 /** 55 /**
56 * Dynamically size or resize this view. 56 * Dynamically size or resize this view.
57 */ 57 */
58 fun resize() { 58 fun resize() {
59 autoSize(queue.v.parent.size.width - 59 autoSize(Application.queue.parent.size.width -
60 2 * (PANEL_BORDER + OUTER_BORDER + INNER_BORDER + MARGIN_BORDER)) 60 2 * (PANEL_BORDER + OUTER_BORDER + INNER_BORDER + MARGIN_BORDER))
61 } 61 }
62 } 62 }
63 63
64 64
87 * wrapped in a JPanel that we use to display both. 87 * wrapped in a JPanel that we use to display both.
88 */ 88 */
89 class PasteboardItemView(label: String, val searchable: ClipText) { 89 class PasteboardItemView(label: String, val searchable: ClipText) {
90 private val outerBorder = 90 private val outerBorder =
91 BorderFactory.createMatteBorder(OUTER_BORDER_TOP, OUTER_BORDER, OUTER_BORDER, OUTER_BORDER, 91 BorderFactory.createMatteBorder(OUTER_BORDER_TOP, OUTER_BORDER, OUTER_BORDER, OUTER_BORDER,
92 queue.v.parent.background) 92 Application.queue.parent.background)
93 93
94 val contents = JPanel().apply { 94 val contents = JPanel().apply {
95 layout = BoxLayout(this, BoxLayout.Y_AXIS) 95 layout = BoxLayout(this, BoxLayout.Y_AXIS)
96 background = queue.v.parent.background 96 background = Application.queue.parent.background
97 border = outerBorder 97 border = outerBorder
98 add(JLabel(label).apply { 98 add(JLabel(label).apply {
99 horizontalAlignment = JLabel.LEFT 99 horizontalAlignment = JLabel.LEFT
100 alignmentX = JLabel.LEFT_ALIGNMENT 100 alignmentX = JLabel.LEFT_ALIGNMENT
101 }) 101 })