diff src/name/blackcap/clipman/Main.kt @ 43:339e2da5bf83

Simplified the settings. Compiles, not tested.
author David Barts <n5jrn@me.com>
date Sun, 09 Feb 2020 19:23:16 -0700
parents 33fbe3a78d84
children 19d9da731c43
line wrap: on
line diff
--- a/src/name/blackcap/clipman/Main.kt	Sat Feb 08 23:05:39 2020 -0700
+++ b/src/name/blackcap/clipman/Main.kt	Sun Feb 09 19:23:16 2020 -0700
@@ -18,7 +18,6 @@
 import javax.swing.*
 import javax.swing.text.html.StyleSheet
 import kotlin.concurrent.thread
-import kotlin.math.roundToInt
 import org.jsoup.Jsoup
 import org.jsoup.nodes.*
 
@@ -76,7 +75,7 @@
                         PasteboardItemView("Plain text", ClipText(contents).apply {
                             contentType = "text/plain"
                             text = plain
-                            font = Font(settingsDialog.mFamily, Font.PLAIN, settingsDialog.mSize.roundToInt())
+                            font = Font(Font.MONOSPACED, Font.PLAIN, MONO_SIZE)
                             resize()
                         })
                     } else {
@@ -109,10 +108,8 @@
 
     private fun preproc(html: String): Pair<String, StyleSheet> {
         val sty = StyleSheet().apply {
-            addRule("body { font-family: \"%s\"; font-size: %.2f; }".format(
-                settingsDialog.pFamily, settingsDialog.pSize))
-            addRule("code, kbd, pre, samp, tt { font-family: \"%s\"; font-size: %.2f}; }".format(
-                settingsDialog.mFamily, settingsDialog.mSize))
+            addRule("body { font-family: serif; font-size: ${PROP_SIZE}; }")
+            addRule("code, kbd, pre, samp, tt { font-family: monospace; font-size: ${MONO_SIZE}; }")
         }
         val scrubbed = Jsoup.parse(html).run {
             select("style").forEach {