diff --git a/src/main/scala/app/logorrr/LogoRRRApp.scala b/src/main/scala/app/logorrr/LogoRRRApp.scala index 2bb2a5bb..6045df2d 100644 --- a/src/main/scala/app/logorrr/LogoRRRApp.scala +++ b/src/main/scala/app/logorrr/LogoRRRApp.scala @@ -4,23 +4,10 @@ import javafx.beans.value.{ChangeListener, ObservableValue} import javafx.event.EventHandler import javafx.scene.Scene import javafx.scene.image.Image -import javafx.scene.paint.Color -import javafx.scene.text.Font import javafx.stage.{Stage, WindowEvent} import java.nio.file.Paths -object LogoRRRFonts { - - // load font thanks to https://www.jetbrains.com/lp/mono/ - Font.loadFont(getClass.getResource("/app/logorrr/JetBrainsMono-Regular.ttf").toExternalForm, 12) - - def jetBrainsMono(size: Int) = - s"""|-fx-font-family: 'JetBrains Mono'; - |-fx-font-size: ${size.toString} px; - |""".stripMargin - -} object LogoRRRApp { @@ -49,7 +36,6 @@ class LogoRRRApp extends javafx.application.Application { import scala.jdk.CollectionConverters._ - /** * will be called by the java bootstrapper */ @@ -60,6 +46,7 @@ class LogoRRRApp extends javafx.application.Application { val scene = new Scene(mainBorderPane, LogoRRRApp.InitialSceneWidth, LogoRRRApp.InitialSceneHeight) scene.widthProperty().addListener(new ChangeListener[Number] { override def changed(observableValue: ObservableValue[_ <: Number], t: Number, t1: Number): Unit = { + println(s"changed: ${t1.intValue}") Option(mainBorderPane).foreach(_.setSceneWidth(t1.intValue)) } }) diff --git a/src/main/scala/app/logorrr/LogoRRRFonts.scala b/src/main/scala/app/logorrr/LogoRRRFonts.scala new file mode 100644 index 00000000..fb8d9f57 --- /dev/null +++ b/src/main/scala/app/logorrr/LogoRRRFonts.scala @@ -0,0 +1,15 @@ +package app.logorrr + +import javafx.scene.text.Font + +object LogoRRRFonts { + + // load font thanks to https://www.jetbrains.com/lp/mono/ + Font.loadFont(getClass.getResource("/app/logorrr/JetBrainsMono-Regular.ttf").toExternalForm, 12) + + def jetBrainsMono(size: Int) = + s"""|-fx-font-family: 'JetBrains Mono'; + |-fx-font-size: ${size.toString} px; + |""".stripMargin + +} diff --git a/src/main/scala/app/logorrr/views/LogView.scala b/src/main/scala/app/logorrr/views/LogView.scala index 0e8d4cc0..749718fd 100644 --- a/src/main/scala/app/logorrr/views/LogView.scala +++ b/src/main/scala/app/logorrr/views/LogView.scala @@ -45,16 +45,11 @@ class LogView(logReport: LogReport extends Tab with CanLog { /** repaint if entries or filters change */ - val repaintInvalidationListener: InvalidationListener = new InvalidationListener { - override def invalidated(observable: Observable): Unit = { - repaint() - } - } + val repaintInvalidationListener: InvalidationListener = (_: Observable) => repaint() def start(): Unit = { logReport.start() installInvalidationListener() - } /** don't monitor file anymore if tab is closed, free invalidation listeners */ diff --git a/src/main/scala/app/logorrr/views/visual/LogVisualView.scala b/src/main/scala/app/logorrr/views/visual/LogVisualView.scala index f4834e9c..d0703de9 100644 --- a/src/main/scala/app/logorrr/views/visual/LogVisualView.scala +++ b/src/main/scala/app/logorrr/views/visual/LogVisualView.scala @@ -28,7 +28,7 @@ class LogVisualView(entries: mutable.Buffer[LogEntry] def repaint(sWidth: Int, cWidth: Int): Unit = timeR({ sisp.repaint(sWidth, cWidth) - }, "Executes repaint") + }, "Repaint") }