Mercurial > cgi-bin > hgweb.cgi > ClipMan
changeset 34:376643a09b52
Finally fixed the alignment. Wotta PITA...
author | David Barts <n5jrn@me.com> |
---|---|
date | Thu, 30 Jan 2020 19:38:59 -0800 |
parents | 277cbb78bc5a |
children | 5f8475b37e23 |
files | src/name/blackcap/clipman/CoerceDialog.kt |
diffstat | 1 files changed, 39 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/src/name/blackcap/clipman/CoerceDialog.kt Thu Jan 30 18:27:03 2020 -0800 +++ b/src/name/blackcap/clipman/CoerceDialog.kt Thu Jan 30 19:38:59 2020 -0800 @@ -4,6 +4,8 @@ package name.blackcap.clipman import java.awt.Color +import java.awt.Container +import java.awt.Dimension import java.awt.Font import java.awt.GraphicsEnvironment import java.awt.Toolkit @@ -91,60 +93,50 @@ title = "Coerce Fonts" contentPane.apply { add(Box(BoxLayout.Y_AXIS).apply { - alignmentX = Box.CENTER_ALIGNMENT - add(JLabel("Coerce proportionally-spaced text to…").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.CENTER_ALIGNMENT + add(Box(BoxLayout.Y_AXIS).apply { border = BorderFactory.createEmptyBorder(BW2, BW2, BW, BW2) - }) - add(Box(BoxLayout.X_AXIS).apply { - border = BorderFactory.createEmptyBorder(0, BW2, BW, BW2) - add(Box.createGlue()) - add(Box(BoxLayout.Y_AXIS).apply { - add(JLabel("Family:").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.LEFT_ALIGNMENT + alignmentX = Box.CENTER_ALIGNMENT + add(leftLabel("Coerce proportionally-spaced text to…")) + add(Box.createVerticalStrut(BW)) + add(Box(BoxLayout.X_AXIS).apply { + alignmentX = Box.LEFT_ALIGNMENT + add(Box.createGlue()) + add(Box(BoxLayout.Y_AXIS).apply { + add(leftLabel("Family:")) + add(_pFamily) }) - add(_pFamily) + add(Box.createGlue()) + add(Box(BoxLayout.Y_AXIS).apply { + add(leftLabel("Size:")) + add(_pSize) + }) + add(Box.createGlue()) }) - add(Box.createGlue()) - add(Box(BoxLayout.Y_AXIS).apply { - add(JLabel("Size:").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.LEFT_ALIGNMENT - }) - add(_pSize) - }) - add(Box.createGlue()) }) add(JSeparator()) - add(JLabel("Coerce monospaced text to…").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.CENTER_ALIGNMENT + add(Box(BoxLayout.Y_AXIS).apply { + alignmentX = Box.CENTER_ALIGNMENT border = BorderFactory.createEmptyBorder(BW, BW2, BW, BW2) - }) - add(Box(BoxLayout.X_AXIS).apply { - border = BorderFactory.createEmptyBorder(0, BW2, BW, BW2) - add(Box.createGlue()) - add(Box(BoxLayout.Y_AXIS).apply { - add(JLabel("Family:").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.LEFT_ALIGNMENT + add(leftLabel("Coerce monospaced text to…")) + add(Box.createVerticalStrut(BW)) + add(Box(BoxLayout.X_AXIS).apply { + alignmentX = Box.LEFT_ALIGNMENT + add(Box.createGlue()) + add(Box(BoxLayout.Y_AXIS).apply { + add(leftLabel("Family:")) + add(_mFamily) }) - add(_mFamily) + add(Box.createGlue()) + add(Box(BoxLayout.Y_AXIS).apply { + add(leftLabel("Size:")) + add(_mSize) + }) + add(Box.createGlue()) }) - add(Box.createGlue()) - add(Box(BoxLayout.Y_AXIS).apply { - add(JLabel("Size:").apply { - horizontalAlignment = JLabel.CENTER - alignmentX = JLabel.LEFT_ALIGNMENT - }) - add(_mSize) - }) - add(Box.createGlue()) }) add(JSeparator()) add(Box(BoxLayout.X_AXIS).apply { + alignmentX = Box.CENTER_ALIGNMENT border = BorderFactory.createEmptyBorder(BW, BW2, BW, BW2) add(Box.createGlue()) add(_cancel) @@ -175,6 +167,10 @@ } } + private fun leftLabel(text: String) = JLabel(text).apply { + alignmentX = JLabel.LEFT_ALIGNMENT + } + private fun coerce() { val selected = queue.v.getSelected() if (selected == null) {