From 98bb63815e3bc810e3e06ab648f86bdb8b3d6150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ladst=C3=A4tter?= Date: Thu, 4 Apr 2024 20:50:52 +0200 Subject: [PATCH] #208: adds simple text size test --- .../app/logorrr/steps/CanCloseAllFiles.scala | 8 ++-- .../scala/app/logorrr/steps/CanOpenFile.scala | 12 ++--- .../logorrr/steps/CanStartApplication.scala | 3 +- .../MultipleFileApplicationTest.scala | 4 +- .../usecases/SingleFileApplicationTest.scala | 6 ++- .../usecases/TestFxBaseApplicationTest.scala | 8 ++-- ...CloseFileTestViaFileMenuCloseAllTest.scala | 4 +- ...ndCloseFileTestViaTabCloseButtonTest.scala | 8 ++-- ...CloseMultipleFilesViaCloseButtonTest.scala | 8 ++-- ...OpenAndCloseMultipleFilesViaMenuTest.scala | 10 ++-- .../usecases/search/SimpleSearchTest.scala | 2 +- .../textview/SimpleTextSizeTest.scala | 46 +++++++++++++++++++ .../main/scala/app/logorrr/LogoRRRApp.scala | 11 +++-- .../logorrr/services/LogoRRRServices.scala | 4 +- .../scala/app/logorrr/views/UiNodeAware.scala | 9 ++++ .../{LogoRRRNodes.scala => UiNodes.scala} | 14 +++--- .../views/autoscroll/AutoScrollCheckBox.scala | 6 +++ .../logorrr/views/logfiletab/LogFileTab.scala | 8 ++-- .../app/logorrr/views/main/MainTabPane.scala | 4 +- .../app/logorrr/views/menubar/FileMenu.scala | 8 ++-- .../logorrr/views/ops/ClearLogButton.scala | 13 +++++- .../app/logorrr/views/ops/CopyLogButton.scala | 16 ++++++- .../views/ops/DecreaseBlockSizeButton.scala | 11 ++++- .../views/ops/IncreaseBlockSizeButton.scala | 11 ++++- .../app/logorrr/views/search/OpsToolBar.scala | 25 +++++----- .../SearchActivateRegexToggleButton.scala | 16 +++++-- .../logorrr/views/search/SearchButton.scala | 4 +- .../views/search/SearchColorPicker.scala | 12 ++++- .../views/search/SearchTextField.scala | 11 +++-- .../DecreaseTextSizeButton.scala | 8 ++++ .../IncreaseTextSizeButton.scala | 10 +++- .../app/logorrr/docs/ScreenShotterApp.scala | 6 +-- 32 files changed, 235 insertions(+), 91 deletions(-) create mode 100644 app-tests/src/test/scala/app/logorrr/usecases/textview/SimpleTextSizeTest.scala create mode 100644 app/src/main/scala/app/logorrr/views/UiNodeAware.scala rename app/src/main/scala/app/logorrr/views/{LogoRRRNodes.scala => UiNodes.scala} (50%) diff --git a/app-tests/src/test/scala/app/logorrr/steps/CanCloseAllFiles.scala b/app-tests/src/test/scala/app/logorrr/steps/CanCloseAllFiles.scala index 6d362b37..9ed2c40a 100644 --- a/app-tests/src/test/scala/app/logorrr/steps/CanCloseAllFiles.scala +++ b/app-tests/src/test/scala/app/logorrr/steps/CanCloseAllFiles.scala @@ -1,7 +1,7 @@ package app.logorrr.steps import app.logorrr.usecases.TestFxBaseApplicationTest -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import org.testfx.api.FxRobotInterface /** @@ -11,9 +11,9 @@ trait CanCloseAllFiles { self: TestFxBaseApplicationTest => protected def closeAllFiles(): FxRobotInterface = { - clickOnNode(LogoRRRNodes.FileMenu) - waitForVisibility(LogoRRRNodes.FileMenuCloseAll) - clickOnNode(LogoRRRNodes.FileMenuCloseAll) + clickOn(UiNodes.FileMenu) + waitForVisibility(UiNodes.FileMenuCloseAll) + clickOn(UiNodes.FileMenuCloseAll) } } diff --git a/app-tests/src/test/scala/app/logorrr/steps/CanOpenFile.scala b/app-tests/src/test/scala/app/logorrr/steps/CanOpenFile.scala index d29b06a5..75a0bd91 100644 --- a/app-tests/src/test/scala/app/logorrr/steps/CanOpenFile.scala +++ b/app-tests/src/test/scala/app/logorrr/steps/CanOpenFile.scala @@ -2,7 +2,7 @@ package app.logorrr.steps import app.logorrr.io.FileId import app.logorrr.usecases.TestFxBaseApplicationTest -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import app.logorrr.views.logfiletab.LogFileTab import java.nio.file.Path @@ -14,11 +14,11 @@ trait CanOpenFile { self: TestFxBaseApplicationTest => protected def openFile(path: Path): Unit = { - waitForVisibility(LogoRRRNodes.FileMenu) - clickOnNode(LogoRRRNodes.FileMenu) - waitForVisibility(LogoRRRNodes.FileMenuOpenFile) - clickOnNode(LogoRRRNodes.FileMenuOpenFile) - waitForVisibility(LogFileTab.idFor(FileId(path))) + waitForVisibility(UiNodes.FileMenu) + clickOn(UiNodes.FileMenu) + waitForVisibility(UiNodes.FileMenuOpenFile) + clickOn(UiNodes.FileMenuOpenFile) + waitForVisibility(LogFileTab.uiNode(FileId(path))) } } diff --git a/app-tests/src/test/scala/app/logorrr/steps/CanStartApplication.scala b/app-tests/src/test/scala/app/logorrr/steps/CanStartApplication.scala index 082a957c..71050761 100644 --- a/app-tests/src/test/scala/app/logorrr/steps/CanStartApplication.scala +++ b/app-tests/src/test/scala/app/logorrr/steps/CanStartApplication.scala @@ -1,6 +1,5 @@ package app.logorrr.steps -import app.logorrr.conf.Settings import app.logorrr.services.LogoRRRServices import app.logorrr.LogoRRRApp import app.logorrr.usecases.TestFxBaseApplicationTest @@ -16,7 +15,7 @@ trait CanStartApplication { @throws[Exception] override def start(stage: Stage): Unit = { - LogoRRRApp.start(stage, Settings.Default, services) + LogoRRRApp.start(stage, services) stage.toFront() } } diff --git a/app-tests/src/test/scala/app/logorrr/usecases/MultipleFileApplicationTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/MultipleFileApplicationTest.scala index a59bbacc..bac6ab02 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/MultipleFileApplicationTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/MultipleFileApplicationTest.scala @@ -1,5 +1,6 @@ package app.logorrr.usecases +import app.logorrr.conf.Settings import app.logorrr.services.LogoRRRServices import app.logorrr.services.fileservices.OpenMultipleFilesService import app.logorrr.services.hostservices.MockHostServices @@ -17,7 +18,8 @@ class MultipleFileApplicationTest(val files: Seq[Path]) with CanStartApplication with CanOpenFile { - val services = LogoRRRServices(new MockHostServices + val services = LogoRRRServices(Settings.Default + ,new MockHostServices , new OpenMultipleFilesService(files) , isUnderTest = true) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/SingleFileApplicationTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/SingleFileApplicationTest.scala index 834400c3..b840a2d9 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/SingleFileApplicationTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/SingleFileApplicationTest.scala @@ -1,5 +1,6 @@ package app.logorrr.usecases +import app.logorrr.conf.Settings import app.logorrr.services.LogoRRRServices import app.logorrr.services.fileservices.OpenSingleFileService import app.logorrr.services.hostservices.MockHostServices @@ -14,9 +15,10 @@ import java.nio.file.Path class SingleFileApplicationTest(val path: Path) extends TestFxBaseApplicationTest with CanStartApplication - with CanOpenFile{ + with CanOpenFile { - val services = LogoRRRServices(new MockHostServices + val services = LogoRRRServices(Settings.Default + , new MockHostServices , new OpenSingleFileService(Option(path)) , isUnderTest = true) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/TestFxBaseApplicationTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/TestFxBaseApplicationTest.scala index 97b8b3f4..69e75077 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/TestFxBaseApplicationTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/TestFxBaseApplicationTest.scala @@ -1,6 +1,6 @@ package app.logorrr.usecases -import app.logorrr.views.LogoRRRNode +import app.logorrr.views.UiNode import javafx.scene.Node import javafx.scene.input.{KeyCode, MouseButton} import org.junit.jupiter.api.AfterEach @@ -27,9 +27,9 @@ class TestFxBaseApplicationTest extends ApplicationTest { release(Array[MouseButton](): _*) } - def clickOnNode(node: LogoRRRNode): FxRobotInterface = clickOn(node.ref) + def clickOn(node: UiNode): FxRobotInterface = clickOn(node.ref) - def waitForVisibility(id: LogoRRRNode): Unit = waitForVisibility(lookup(id.ref)) + def waitForVisibility(id: UiNode): Unit = waitForVisibility(lookup(id.ref)) def waitForVisibility(query: String): Unit = waitForVisibility(lookup(query)) @@ -39,7 +39,7 @@ class TestFxBaseApplicationTest extends ApplicationTest { }) } - def waitForPredicate[A <: Node](id: LogoRRRNode, clazz: Class[A], predicate: A => Boolean): Unit = { + def waitForPredicate[A <: Node](id: UiNode, clazz: Class[A], predicate: A => Boolean): Unit = { WaitForAsyncUtils.waitFor(2, TimeUnit.SECONDS, new Callable[java.lang.Boolean] { override def call(): java.lang.Boolean = { predicate(lookup(id.ref).queryAs(clazz)) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaFileMenuCloseAllTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaFileMenuCloseAllTest.scala index bff17cd6..03822787 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaFileMenuCloseAllTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaFileMenuCloseAllTest.scala @@ -3,7 +3,7 @@ package app.logorrr.usecases.openclose import app.logorrr.TestFiles import app.logorrr.steps.CanCloseAllFiles import app.logorrr.usecases.SingleFileApplicationTest -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import javafx.scene.control.TabPane import org.junit.jupiter.api.Test @@ -26,7 +26,7 @@ class OpenAndCloseFileTestViaFileMenuCloseAllTest extends SingleFileApplicationT // click on file menu and then close all button closeAllFiles() - waitForPredicate[TabPane](LogoRRRNodes.MainTabPane, classOf[TabPane], tabPane => { + waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { tabPane.getTabs.isEmpty }) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaTabCloseButtonTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaTabCloseButtonTest.scala index b82fcaea..d7360dc5 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaTabCloseButtonTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseFileTestViaTabCloseButtonTest.scala @@ -2,7 +2,7 @@ package app.logorrr.usecases.openclose import app.logorrr.TestFiles import app.logorrr.usecases.SingleFileApplicationTest -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import javafx.scene.control.TabPane import javafx.scene.layout.StackPane import org.junit.jupiter.api.Test @@ -22,14 +22,14 @@ class OpenAndCloseFileTestViaTabCloseButtonTest extends SingleFileApplicationTes openFile(path) // yields only one tab since there is only one loaded - val tabsQuery = LogoRRRNodes.LogFileHeaderTabs + val tabsQuery = UiNodes.LogFileHeaderTabs - val closeButtonQuery = clickOn(lookup(tabsQuery).query[StackPane]()).lookup(LogoRRRNodes.LogFileHeaderTabCloseButton) + val closeButtonQuery = clickOn(lookup(tabsQuery).query[StackPane]()).lookup(UiNodes.LogFileHeaderTabCloseButton) waitForVisibility(closeButtonQuery) clickOn(closeButtonQuery.queryAs[StackPane](classOf[StackPane])) - waitForPredicate[TabPane](LogoRRRNodes.MainTabPane, classOf[TabPane], tabPane => { + waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { tabPane.getTabs.isEmpty }) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaCloseButtonTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaCloseButtonTest.scala index 7c8985b1..9e6afb76 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaCloseButtonTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaCloseButtonTest.scala @@ -1,6 +1,6 @@ package app.logorrr.usecases.openclose -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import app.logorrr.TestFiles import app.logorrr.usecases.MultipleFileApplicationTest import javafx.scene.control.TabPane @@ -20,15 +20,15 @@ class OpenAndCloseMultipleFilesViaCloseButtonTest extends MultipleFileApplicatio p => openFile(p) } - val tabCards = lookup(LogoRRRNodes.LogFileHeaderTabs).queryAll[StackPane]().asScala + val tabCards = lookup(UiNodes.LogFileHeaderTabs).queryAll[StackPane]().asScala for (n <- tabCards) { - val nodeQuery: NodeQuery = clickOn(n).lookup(LogoRRRNodes.LogFileHeaderTabCloseButton) + val nodeQuery: NodeQuery = clickOn(n).lookup(UiNodes.LogFileHeaderTabCloseButton) waitForVisibility(nodeQuery) clickOn(nodeQuery.queryAs[StackPane](classOf[StackPane])) } - waitForPredicate[TabPane](LogoRRRNodes.MainTabPane, classOf[TabPane], tabPane => { + waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { tabPane.getTabs.isEmpty }) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaMenuTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaMenuTest.scala index f795878f..64f6ddce 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaMenuTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaMenuTest.scala @@ -1,6 +1,6 @@ package app.logorrr.usecases.openclose -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import app.logorrr.TestFiles import app.logorrr.usecases.MultipleFileApplicationTest import javafx.scene.control.TabPane @@ -17,12 +17,12 @@ class OpenAndCloseMultipleFilesViaMenuTest extends MultipleFileApplicationTest(T p => openFile(p) } // now close them all again - clickOnNode(LogoRRRNodes.FileMenu) - waitForVisibility(LogoRRRNodes.FileMenuCloseAll) + clickOn(UiNodes.FileMenu) + waitForVisibility(UiNodes.FileMenuCloseAll) - clickOnNode(LogoRRRNodes.FileMenuCloseAll) + clickOn(UiNodes.FileMenuCloseAll) - waitForPredicate[TabPane](LogoRRRNodes.MainTabPane, classOf[TabPane], tabPane => { + waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { tabPane.getTabs.isEmpty }) diff --git a/app-tests/src/test/scala/app/logorrr/usecases/search/SimpleSearchTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/search/SimpleSearchTest.scala index 2354843f..ce74c70f 100644 --- a/app-tests/src/test/scala/app/logorrr/usecases/search/SimpleSearchTest.scala +++ b/app-tests/src/test/scala/app/logorrr/usecases/search/SimpleSearchTest.scala @@ -20,7 +20,7 @@ class SimpleSearchTest extends SingleFileApplicationTest(TestFiles.simpleLog0) { } private def searchFor(needle: String) = { - clickOn(SearchTextField.id(FileId(path)).ref).write(needle) + clickOn(SearchTextField.uiNode(FileId(path)).ref).write(needle) clickOn(SearchButton.id(FileId(path)).ref) } } diff --git a/app-tests/src/test/scala/app/logorrr/usecases/textview/SimpleTextSizeTest.scala b/app-tests/src/test/scala/app/logorrr/usecases/textview/SimpleTextSizeTest.scala new file mode 100644 index 00000000..58015eb1 --- /dev/null +++ b/app-tests/src/test/scala/app/logorrr/usecases/textview/SimpleTextSizeTest.scala @@ -0,0 +1,46 @@ +package app.logorrr.usecases.textview + +import app.logorrr.TestFiles +import app.logorrr.conf.{LogoRRRGlobals, Settings, StageSettings} +import app.logorrr.io.FileId +import app.logorrr.services.LogoRRRServices +import app.logorrr.services.fileservices.OpenSingleFileService +import app.logorrr.services.hostservices.MockHostServices +import app.logorrr.usecases.SingleFileApplicationTest +import app.logorrr.views.text.toolbaractions.{DecreaseTextSizeButton, IncreaseTextSizeButton} +import org.junit.jupiter.api.Test + +class SimpleTextSizeTest extends SingleFileApplicationTest(TestFiles.simpleLog0) { + + override val services = LogoRRRServices(Settings.Default.copy(stageSettings = StageSettings(100, 100, 1200, 600)) + , new MockHostServices + , new OpenSingleFileService(Option(path)) + , isUnderTest = true) + + @Test def search(): Unit = { + openFile(path) + val fileId = FileId(path) + + val size = LogoRRRGlobals.getLogFileSettings(fileId).getFontSize + val count = 10 + + for (_ <- 1 to count) increaseTextSize(fileId) + assert(size + count == LogoRRRGlobals.getLogFileSettings(fileId).getFontSize) + + // decrease again + for (_ <- 1 to 10) decreaseTextSize(fileId) + assert(size == LogoRRRGlobals.getLogFileSettings(fileId).getFontSize) + } + + + private def increaseTextSize(fileId: FileId): Unit = { + waitForVisibility(IncreaseTextSizeButton.uiNode(fileId)) + clickOn(IncreaseTextSizeButton.uiNode(fileId)) + } + + private def decreaseTextSize(fileId: FileId): Unit = { + waitForVisibility(DecreaseTextSizeButton.uiNode(fileId)) + clickOn(DecreaseTextSizeButton.uiNode(fileId)) + } + +} diff --git a/app/src/main/scala/app/logorrr/LogoRRRApp.scala b/app/src/main/scala/app/logorrr/LogoRRRApp.scala index 25b154c4..c02b20a7 100644 --- a/app/src/main/scala/app/logorrr/LogoRRRApp.scala +++ b/app/src/main/scala/app/logorrr/LogoRRRApp.scala @@ -1,7 +1,7 @@ package app.logorrr import app.logorrr -import app.logorrr.conf.{LogoRRRGlobals, Settings, SettingsIO} +import app.logorrr.conf.{LogoRRRGlobals, SettingsIO} import app.logorrr.io.FilePaths import app.logorrr.meta.AppMeta import app.logorrr.services.LogoRRRServices @@ -28,7 +28,6 @@ object LogoRRRApp extends CanLog { } def start(stage: Stage - , settings: Settings , services: LogoRRRServices): LogoRRRMain = { System.setProperty("user.language", "en") System.setProperty("java.util.logging.SimpleFormatter.format", LogFormat) @@ -37,7 +36,7 @@ object LogoRRRApp extends CanLog { Application.setUserAgentStylesheet("/app/logorrr/LogoRRR.css") logInfo(s"Started ${AppMeta.fullAppNameWithVersion} in '${Paths.get("").toAbsolutePath.toString}'") - LogoRRRGlobals.set(settings, services.hostServices) + LogoRRRGlobals.set(services.settings, services.hostServices) val logoRRRMain = new LogoRRRMain(JfxUtils.closeStage(stage), services.fileOpenService, services.isUnderTest) LogoRRRStage.init(stage, logoRRRMain) logoRRRMain.initLogFilesFromConfig() @@ -53,11 +52,13 @@ class LogoRRRApp extends javafx.application.Application with CanLog { val hostServices = new NativeHostServices(getHostServices) - val services = logorrr.services.LogoRRRServices(hostServices + val services = logorrr.services.LogoRRRServices( + SettingsIO.fromFile(FilePaths.settingsFilePath) + , hostServices , new NativeOpenFileService(() => stage.getScene.getWindow) , isUnderTest = false) - LogoRRRApp.start(stage, SettingsIO.fromFile(FilePaths.settingsFilePath), services) + LogoRRRApp.start(stage, services) } } \ No newline at end of file diff --git a/app/src/main/scala/app/logorrr/services/LogoRRRServices.scala b/app/src/main/scala/app/logorrr/services/LogoRRRServices.scala index 60caad86..f1ed4a0c 100644 --- a/app/src/main/scala/app/logorrr/services/LogoRRRServices.scala +++ b/app/src/main/scala/app/logorrr/services/LogoRRRServices.scala @@ -1,8 +1,10 @@ package app.logorrr.services +import app.logorrr.conf.Settings import app.logorrr.services.fileservices.LogoRRRFileOpenService import app.logorrr.services.hostservices.LogoRRRHostServices -case class LogoRRRServices(hostServices: LogoRRRHostServices +case class LogoRRRServices(settings: Settings +, hostServices: LogoRRRHostServices , fileOpenService: LogoRRRFileOpenService , isUnderTest: Boolean) diff --git a/app/src/main/scala/app/logorrr/views/UiNodeAware.scala b/app/src/main/scala/app/logorrr/views/UiNodeAware.scala new file mode 100644 index 00000000..31cd2720 --- /dev/null +++ b/app/src/main/scala/app/logorrr/views/UiNodeAware.scala @@ -0,0 +1,9 @@ +package app.logorrr.views + +import app.logorrr.io.FileId + +trait UiNodeAware { + + def uiNode(id: FileId): UiNode + +} diff --git a/app/src/main/scala/app/logorrr/views/LogoRRRNodes.scala b/app/src/main/scala/app/logorrr/views/UiNodes.scala similarity index 50% rename from app/src/main/scala/app/logorrr/views/LogoRRRNodes.scala rename to app/src/main/scala/app/logorrr/views/UiNodes.scala index cefd9661..25ba4b39 100644 --- a/app/src/main/scala/app/logorrr/views/LogoRRRNodes.scala +++ b/app/src/main/scala/app/logorrr/views/UiNodes.scala @@ -1,31 +1,31 @@ package app.logorrr.views -case class LogoRRRNode(value: String) { +case class UiNode(value: String) { lazy val ref: String = "#" + value } -object LogoRRRNodes { +object UiNodes { /** id for the file menu */ - val FileMenu: LogoRRRNode = LogoRRRNode("file_menu") + val FileMenu: UiNode = UiNode("file_menu") /** ID of menu item which opens a file */ - val FileMenuOpenFile: LogoRRRNode = LogoRRRNode("file_menu_open_file") + val FileMenuOpenFile: UiNode = UiNode("file_menu_open_file") /** * close all files */ - val FileMenuCloseAll: LogoRRRNode = LogoRRRNode("file_menu_close_all") + val FileMenuCloseAll: UiNode = UiNode("file_menu_close_all") /** * ID of main tab pane where all log files are placed */ - val MainTabPane: LogoRRRNode = LogoRRRNode("main_tab_pane") + val MainTabPane: UiNode = UiNode("main_tab_pane") /** yields all tab 'cards' which are available */ - val LogFileHeaderTabs = s"${LogoRRRNodes.MainTabPane.ref} > .tab-header-area > .headers-region > .tab" + val LogFileHeaderTabs = s"${UiNodes.MainTabPane.ref} > .tab-header-area > .headers-region > .tab" /** css rule to target the close button of a LogFileHeaderTab */ val LogFileHeaderTabCloseButton = ".tab-container > .tab-close-button" diff --git a/app/src/main/scala/app/logorrr/views/autoscroll/AutoScrollCheckBox.scala b/app/src/main/scala/app/logorrr/views/autoscroll/AutoScrollCheckBox.scala index 225996fc..7f7998b3 100644 --- a/app/src/main/scala/app/logorrr/views/autoscroll/AutoScrollCheckBox.scala +++ b/app/src/main/scala/app/logorrr/views/autoscroll/AutoScrollCheckBox.scala @@ -3,10 +3,16 @@ package app.logorrr.views.autoscroll import app.logorrr.conf.LogoRRRGlobals import app.logorrr.io.FileId import app.logorrr.model.HasFileId +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.scene.control.{CheckBox, Tooltip} +object AutoScrollCheckBox extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("autoscrollcheckbox-" + id) +} class AutoScrollCheckBox(val fileId: FileId) extends CheckBox with HasFileId { + setId(AutoScrollCheckBox.uiNode(fileId).ref) setTooltip(new Tooltip("autoscroll")) selectedProperty().bindBidirectional(LogoRRRGlobals.getLogFileSettings(fileId).autoScrollActiveProperty) diff --git a/app/src/main/scala/app/logorrr/views/logfiletab/LogFileTab.scala b/app/src/main/scala/app/logorrr/views/logfiletab/LogFileTab.scala index 05a31792..11648b78 100644 --- a/app/src/main/scala/app/logorrr/views/logfiletab/LogFileTab.scala +++ b/app/src/main/scala/app/logorrr/views/logfiletab/LogFileTab.scala @@ -5,7 +5,7 @@ import app.logorrr.conf.mut.MutLogFileSettings import app.logorrr.io.FileId import app.logorrr.model.LogEntry import app.logorrr.util._ -import app.logorrr.views.{LogoRRRAccelerators, LogoRRRNode} +import app.logorrr.views.{LogoRRRAccelerators, UiNode, UiNodeAware} import app.logorrr.views.autoscroll.LogTailer import app.logorrr.views.logfiletab.actions._ import app.logorrr.views.search.Fltr @@ -19,7 +19,7 @@ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future -object LogFileTab { +object LogFileTab extends UiNodeAware { /** background for file log tabs */ private val BackgroundStyle: String = @@ -52,7 +52,7 @@ object LogFileTab { , entries) } - def idFor(fileId: FileId): LogoRRRNode = LogoRRRNode("logfiletab-" + HashUtil.md5Sum(fileId)) + def uiNode(fileId: FileId): UiNode = UiNode("logfiletab-" + HashUtil.md5Sum(fileId)) } @@ -69,7 +69,7 @@ class LogFileTab(val fileId: FileId with TimerCode with CanLog { - setId(LogFileTab.idFor(fileId).value) + setId(LogFileTab.uiNode(fileId).value) if (fileId.isZipEntry) { setStyle(LogFileTab.ZipBackgroundStyle) diff --git a/app/src/main/scala/app/logorrr/views/main/MainTabPane.scala b/app/src/main/scala/app/logorrr/views/main/MainTabPane.scala index 069303c7..1c991b0a 100644 --- a/app/src/main/scala/app/logorrr/views/main/MainTabPane.scala +++ b/app/src/main/scala/app/logorrr/views/main/MainTabPane.scala @@ -4,7 +4,7 @@ import app.logorrr.conf.LogoRRRGlobals import app.logorrr.io.{FileId, IoManager} import app.logorrr.model.{LogEntry, LogFileSettings} import app.logorrr.util.{CanLog, JfxUtils} -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import app.logorrr.views.logfiletab.LogFileTab import javafx.beans.value.ChangeListener import javafx.collections.ObservableList @@ -31,7 +31,7 @@ object MainTabPane { class MainTabPane extends TabPane with CanLog { // leave here otherwise css rendering breaks setStyle(MainTabPane.BackgroundStyle) - setId(LogoRRRNodes.MainTabPane.value) + setId(UiNodes.MainTabPane.value) val selectedTabListener: ChangeListener[Tab] = JfxUtils.onNew { case logFileTab: LogFileTab => diff --git a/app/src/main/scala/app/logorrr/views/menubar/FileMenu.scala b/app/src/main/scala/app/logorrr/views/menubar/FileMenu.scala index 3efeb4d4..9263531c 100644 --- a/app/src/main/scala/app/logorrr/views/menubar/FileMenu.scala +++ b/app/src/main/scala/app/logorrr/views/menubar/FileMenu.scala @@ -4,7 +4,7 @@ import app.logorrr.conf.LogoRRRGlobals import app.logorrr.io.FileId import app.logorrr.services.fileservices.LogoRRRFileOpenService import app.logorrr.util.{CanLog, OsUtil} -import app.logorrr.views.LogoRRRNodes +import app.logorrr.views.UiNodes import javafx.scene.control.{Menu, MenuItem} import javafx.stage.{FileChooser, Window} @@ -30,7 +30,7 @@ object FileMenu { class OpenMenuItem(fileOpenService: LogoRRRFileOpenService , openFile: FileId => Unit) extends MenuItem("Open") with CanLog { - setId(LogoRRRNodes.FileMenuOpenFile.value) + setId(UiNodes.FileMenuOpenFile.value) setOnAction(_ => { fileOpenService.openFile match { case Some(logFile) => openFile(FileId(logFile)) @@ -41,7 +41,7 @@ object FileMenu { } class CloseAllMenuItem(removeAllLogFiles: => Unit) extends MenuItem("Close All") { - setId(LogoRRRNodes.FileMenuCloseAll.value) + setId(UiNodes.FileMenuCloseAll.value) setOnAction(_ => removeAllLogFiles) } @@ -56,7 +56,7 @@ class FileMenu(fileOpenService: LogoRRRFileOpenService , closeAllLogFiles: => Unit , closeApplication: => Unit) extends Menu("File") with CanLog { - setId(LogoRRRNodes.FileMenu.value) + setId(UiNodes.FileMenu.value) lazy val openMenuItem = new FileMenu.OpenMenuItem(fileOpenService, openFile) lazy val closeAllMenuItem = new FileMenu.CloseAllMenuItem(closeAllLogFiles) diff --git a/app/src/main/scala/app/logorrr/views/ops/ClearLogButton.scala b/app/src/main/scala/app/logorrr/views/ops/ClearLogButton.scala index bd12465e..e73df0e2 100644 --- a/app/src/main/scala/app/logorrr/views/ops/ClearLogButton.scala +++ b/app/src/main/scala/app/logorrr/views/ops/ClearLogButton.scala @@ -1,13 +1,24 @@ package app.logorrr.views.ops +import app.logorrr.io.FileId import app.logorrr.model.LogEntry +import app.logorrr.util.HashUtil +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.collections.ObservableList import javafx.scene.control.{Button, Tooltip} import org.kordamp.ikonli.fontawesome5.FontAwesomeSolid import org.kordamp.ikonli.javafx.FontIcon -class ClearLogButton(logEntries: ObservableList[LogEntry]) extends Button { +object ClearLogButton extends UiNodeAware { + + def uiNode(id: FileId): UiNode = UiNode("clearlogbutton-" + HashUtil.md5Sum(id)) + +} + +class ClearLogButton(id: FileId, logEntries: ObservableList[LogEntry]) extends Button { private val icon = new FontIcon(FontAwesomeSolid.TRASH) + + setId(ClearLogButton.uiNode(id).value) setGraphic(icon) setTooltip(new Tooltip("clear log file")) setOnAction(_ => { diff --git a/app/src/main/scala/app/logorrr/views/ops/CopyLogButton.scala b/app/src/main/scala/app/logorrr/views/ops/CopyLogButton.scala index 2be5d911..786c9cff 100644 --- a/app/src/main/scala/app/logorrr/views/ops/CopyLogButton.scala +++ b/app/src/main/scala/app/logorrr/views/ops/CopyLogButton.scala @@ -1,6 +1,9 @@ package app.logorrr.views.ops +import app.logorrr.io.FileId import app.logorrr.model.LogEntry +import app.logorrr.util.HashUtil +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.animation.AnimationTimer import javafx.collections.ObservableList import javafx.scene.control.{Button, Tooltip} @@ -10,12 +13,21 @@ import org.kordamp.ikonli.javafx.FontIcon import scala.collection.mutable.ListBuffer +object CopyLogButton extends UiNodeAware { + + def uiNode(id: FileId): UiNode = UiNode("copylogbutton-" + HashUtil.md5Sum(id)) + +} + + /** * Copy current contents to clipboard. * * @param logEntries current active log entries */ -class CopyLogButton(logEntries: ObservableList[LogEntry]) extends Button { +class CopyLogButton(id: FileId, logEntries: ObservableList[LogEntry]) extends Button { + + setId(CopyLogButton.uiNode(id).value) private val icon = new FontIcon(FontAwesomeSolid.COPY) private val iconLight = new FontIcon(FontAwesomeRegular.COPY) @@ -36,7 +48,7 @@ class CopyLogButton(logEntries: ObservableList[LogEntry]) extends Button { val bounds = localToScreen(getBoundsInLocal) val x = bounds.getMinX val y = bounds.getMaxY - defaultToolTip.show(this,x,y) + defaultToolTip.show(this, x, y) mkTimer().start() // visual response to click }) diff --git a/app/src/main/scala/app/logorrr/views/ops/DecreaseBlockSizeButton.scala b/app/src/main/scala/app/logorrr/views/ops/DecreaseBlockSizeButton.scala index e8faf1cc..f2f09769 100644 --- a/app/src/main/scala/app/logorrr/views/ops/DecreaseBlockSizeButton.scala +++ b/app/src/main/scala/app/logorrr/views/ops/DecreaseBlockSizeButton.scala @@ -1,16 +1,25 @@ package app.logorrr.views.ops +import app.logorrr.io.FileId +import app.logorrr.util.HashUtil import app.logorrr.views.block.{BlockConstants, HasBlockSizeProperty} import app.logorrr.views.search.OpsToolBar +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.beans.property.SimpleIntegerProperty import javafx.scene.paint.Color -class DecreaseBlockSizeButton(val blockSizeProperty: SimpleIntegerProperty) extends +object DecreaseBlockSizeButton extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("decreaseblocksizebutton-" + HashUtil.md5Sum(id)) +} + +class DecreaseBlockSizeButton(id: FileId, val blockSizeProperty: SimpleIntegerProperty) extends RectButton(width = 8 , height = 8 , color = Color.GRAY , tooltipMessage = "decrease block size") with HasBlockSizeProperty { + setId(DecreaseBlockSizeButton.uiNode(id).value) setOnAction(_ => { if (getBlockSize() - OpsToolBar.blockSizeStep > BlockConstants.MinSize) { setBlockSize(getBlockSize() - OpsToolBar.blockSizeStep) diff --git a/app/src/main/scala/app/logorrr/views/ops/IncreaseBlockSizeButton.scala b/app/src/main/scala/app/logorrr/views/ops/IncreaseBlockSizeButton.scala index 4ad7cdf4..21110e02 100644 --- a/app/src/main/scala/app/logorrr/views/ops/IncreaseBlockSizeButton.scala +++ b/app/src/main/scala/app/logorrr/views/ops/IncreaseBlockSizeButton.scala @@ -1,16 +1,25 @@ package app.logorrr.views.ops +import app.logorrr.io.FileId +import app.logorrr.util.HashUtil import app.logorrr.views.block.HasBlockSizeProperty import app.logorrr.views.search.OpsToolBar +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.beans.property.SimpleIntegerProperty import javafx.scene.paint.Color -class IncreaseBlockSizeButton(val blockSizeProperty: SimpleIntegerProperty) extends +object IncreaseBlockSizeButton extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("increaseblocksizebutton-" + HashUtil.md5Sum(id)) +} + +class IncreaseBlockSizeButton(id: FileId, val blockSizeProperty: SimpleIntegerProperty) extends RectButton(width = 16 , height = 16 , color = Color.GRAY , tooltipMessage = "increase block size") with HasBlockSizeProperty { + setId(IncreaseBlockSizeButton.uiNode(id).value) setOnAction(_ => { if (getBlockSize() + OpsToolBar.blockSizeStep < 70 * OpsToolBar.blockSizeStep) { setBlockSize(getBlockSize() + OpsToolBar.blockSizeStep) diff --git a/app/src/main/scala/app/logorrr/views/search/OpsToolBar.scala b/app/src/main/scala/app/logorrr/views/search/OpsToolBar.scala index 841b61a2..63063f2f 100644 --- a/app/src/main/scala/app/logorrr/views/search/OpsToolBar.scala +++ b/app/src/main/scala/app/logorrr/views/search/OpsToolBar.scala @@ -41,28 +41,28 @@ class OpsToolBar(fileId: FileId //setStyle(SearchToolBar.BackgroundSelectedStyle) setStyle("""-fx-padding: 0px 0px 0px 4px;""") val w = 380 - val macWidth: Int = w - val winWidth: Int = w + 2 - val linuxWidth: Int = w + 2 + private val macWidth: Int = w + private val winWidth: Int = w + 2 + private val linuxWidth: Int = w + 2 val width: Int = OsUtil.osFun(winWidth, macWidth, linuxWidth) // different layouts (may be dependent on font size renderings?) setMinWidth(width) /** control which enables selecting color for a search tag */ - private val colorPicker = new SearchColorPicker() + private val colorPicker = new SearchColorPicker(fileId) /** toggles search behavior from case sensitive search to a regex search */ - val regexToggleButton = new SearchActivateRegexToggleButton() + val regexToggleButton = new SearchActivateRegexToggleButton(fileId) /** textfield to enter search queries */ val searchTextField = new SearchTextField(fileId, regexToggleButton) private val searchButton = new SearchButton(fileId, searchTextField, regexToggleButton, colorPicker, addFilterFn) - val autoScrollCheckBox = new AutoScrollCheckBox(fileId) + private val autoScrollCheckBox = new AutoScrollCheckBox(fileId) - val clearLogButton = new ClearLogButton(logEntries) + private val clearLogButton = new ClearLogButton(fileId, logEntries) - val copySelectionButton = new CopyLogButton(filteredList) + private val copySelectionButton = new CopyLogButton(fileId, filteredList) // val firstNEntries: ObservableList[LogEntry] = TimerSettingsLogView.mkEntriesToShow(logEntries) @@ -81,11 +81,10 @@ class OpsToolBar(fileId: FileId val searchItems: Seq[Control] = Seq[Control](searchTextField, regexToggleButton, colorPicker, searchButton) val sizeItems: Seq[Control] = { - val decreaseBlockSizeButton = new DecreaseBlockSizeButton(blockSizeProperty) - val increaseBlockSizeButton = new IncreaseBlockSizeButton(blockSizeProperty) - val decreaseTextSizeButton = new DecreaseTextSizeButton(fileId) - val increaseTextSizeButton = new IncreaseTextSizeButton(fileId) - Seq(decreaseBlockSizeButton, increaseBlockSizeButton, decreaseTextSizeButton, increaseTextSizeButton) + Seq(new DecreaseBlockSizeButton(fileId, blockSizeProperty) + , new IncreaseBlockSizeButton(fileId, blockSizeProperty) + , new DecreaseTextSizeButton(fileId) + , new IncreaseTextSizeButton(fileId)) } val otherItems: Seq[Node] = { diff --git a/app/src/main/scala/app/logorrr/views/search/SearchActivateRegexToggleButton.scala b/app/src/main/scala/app/logorrr/views/search/SearchActivateRegexToggleButton.scala index 32350549..dcfced75 100644 --- a/app/src/main/scala/app/logorrr/views/search/SearchActivateRegexToggleButton.scala +++ b/app/src/main/scala/app/logorrr/views/search/SearchActivateRegexToggleButton.scala @@ -1,11 +1,21 @@ package app.logorrr.views.search -import app.logorrr.util.{LogoRRRFonts, OsUtil} +import app.logorrr.io.FileId +import app.logorrr.util.{HashUtil, LogoRRRFonts, OsUtil} +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.scene.control.{Label, ToggleButton, Tooltip} import javafx.scene.paint.Color -class SearchActivateRegexToggleButton +object SearchActivateRegexToggleButton extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("searchactivateregextogglebutton-" + HashUtil.md5Sum(id)) + +} + +class SearchActivateRegexToggleButton(fileId: FileId) extends ToggleButton { + setId(SearchActivateRegexToggleButton.uiNode(fileId).value) + private val label = new Label("r") label.setStyle(LogoRRRFonts.jetBrainsMono(8)) label.setTextFill(Color.DARKGREY) @@ -13,6 +23,6 @@ class SearchActivateRegexToggleButton setTooltip(new Tooltip( s"""activate regular expression search | - |shortcut: ${OsUtil.osFun("CTRL-R", "COMMAND-R","CTRL-R")}""".stripMargin)) + |shortcut: ${OsUtil.osFun("CTRL-R", "COMMAND-R", "CTRL-R")}""".stripMargin)) } diff --git a/app/src/main/scala/app/logorrr/views/search/SearchButton.scala b/app/src/main/scala/app/logorrr/views/search/SearchButton.scala index 19836f84..082944cc 100644 --- a/app/src/main/scala/app/logorrr/views/search/SearchButton.scala +++ b/app/src/main/scala/app/logorrr/views/search/SearchButton.scala @@ -3,14 +3,14 @@ package app.logorrr.views.search import app.logorrr.io.FileId import app.logorrr.util.{ColorUtil, HashUtil} -import app.logorrr.views.LogoRRRNode +import app.logorrr.views.UiNode import javafx.scene.control.{Button, Tooltip} import org.kordamp.ikonli.fontawesome5.FontAwesomeSolid import org.kordamp.ikonli.javafx.FontIcon object SearchButton { - def id(id: FileId): LogoRRRNode = LogoRRRNode("searchbutton-" + HashUtil.md5Sum(id)) + def id(id: FileId): UiNode = UiNode("searchbutton-" + HashUtil.md5Sum(id)) } diff --git a/app/src/main/scala/app/logorrr/views/search/SearchColorPicker.scala b/app/src/main/scala/app/logorrr/views/search/SearchColorPicker.scala index 52d61715..3731e67e 100644 --- a/app/src/main/scala/app/logorrr/views/search/SearchColorPicker.scala +++ b/app/src/main/scala/app/logorrr/views/search/SearchColorPicker.scala @@ -1,9 +1,17 @@ package app.logorrr.views.search -import app.logorrr.util.ColorUtil +import app.logorrr.io.FileId +import app.logorrr.util.{ColorUtil, HashUtil} +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.scene.control.{ColorPicker, Tooltip} -class SearchColorPicker extends ColorPicker { +object SearchColorPicker extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("searchcolorpicker-" + HashUtil.md5Sum(id)) +} + +class SearchColorPicker(id : FileId) extends ColorPicker { + setId(SearchColorPicker.uiNode(id).value) setValue(ColorUtil.randColor) setMaxWidth(46) setTooltip(new Tooltip("choose color")) diff --git a/app/src/main/scala/app/logorrr/views/search/SearchTextField.scala b/app/src/main/scala/app/logorrr/views/search/SearchTextField.scala index 3ad1d520..827191e2 100644 --- a/app/src/main/scala/app/logorrr/views/search/SearchTextField.scala +++ b/app/src/main/scala/app/logorrr/views/search/SearchTextField.scala @@ -2,20 +2,23 @@ package app.logorrr.views.search import app.logorrr.io.FileId import app.logorrr.util.{HashUtil, OsUtil} -import app.logorrr.views.LogoRRRNode +import app.logorrr.views.{UiNode, UiNodeAware} import javafx.beans.binding.StringBinding import javafx.scene.control.{TextField, Tooltip} -object SearchTextField { - def id(id: FileId): LogoRRRNode = LogoRRRNode("searchtextfield-" + HashUtil.md5Sum(id)) + +object SearchTextField extends UiNodeAware { + + def uiNode(id: FileId): UiNode = UiNode("searchtextfield-" + HashUtil.md5Sum(id)) + } class SearchTextField(fileId: FileId , regexToggleButton: SearchActivateRegexToggleButton) extends TextField { - setId(SearchTextField.id(fileId).value) + setId(SearchTextField.uiNode(fileId).value) setPrefWidth(200) setMaxWidth(200) setTooltip(new Tooltip(s"enter search pattern\n\nshortcut: ${OsUtil.osFun("CTRL-F", "COMMAND-F", "CTRL-F")}")) diff --git a/app/src/main/scala/app/logorrr/views/text/toolbaractions/DecreaseTextSizeButton.scala b/app/src/main/scala/app/logorrr/views/text/toolbaractions/DecreaseTextSizeButton.scala index 47728262..e76362fa 100644 --- a/app/src/main/scala/app/logorrr/views/text/toolbaractions/DecreaseTextSizeButton.scala +++ b/app/src/main/scala/app/logorrr/views/text/toolbaractions/DecreaseTextSizeButton.scala @@ -1,11 +1,19 @@ package app.logorrr.views.text.toolbaractions import app.logorrr.io.FileId +import app.logorrr.util.HashUtil import app.logorrr.views.ops.TextSizeButton import app.logorrr.views.search.OpsToolBar +import app.logorrr.views.{UiNode, UiNodeAware} + +object DecreaseTextSizeButton extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("decreasetextsizebutton-" + HashUtil.md5Sum(id)) +} class DecreaseTextSizeButton(val fileId: FileId) extends TextSizeButton(9, "decrease text size") { + setId(DecreaseTextSizeButton.uiNode(fileId).value) setOnAction(_ => { if (getFontSize - OpsToolBar.fontSizeStep > 0) { setFontSize(getFontSize - OpsToolBar.fontSizeStep) diff --git a/app/src/main/scala/app/logorrr/views/text/toolbaractions/IncreaseTextSizeButton.scala b/app/src/main/scala/app/logorrr/views/text/toolbaractions/IncreaseTextSizeButton.scala index 9f5f0c72..a002c3e5 100644 --- a/app/src/main/scala/app/logorrr/views/text/toolbaractions/IncreaseTextSizeButton.scala +++ b/app/src/main/scala/app/logorrr/views/text/toolbaractions/IncreaseTextSizeButton.scala @@ -1,8 +1,16 @@ package app.logorrr.views.text.toolbaractions import app.logorrr.io.FileId +import app.logorrr.util.HashUtil import app.logorrr.views.ops.TextSizeButton import app.logorrr.views.search.OpsToolBar +import app.logorrr.views.{UiNode, UiNodeAware} + +object IncreaseTextSizeButton extends UiNodeAware { + + override def uiNode(id: FileId): UiNode = UiNode("increasetextsizebutton-" + HashUtil.md5Sum(id)) +} + /** * UI element for changing text size @@ -10,7 +18,7 @@ import app.logorrr.views.search.OpsToolBar * @param fileId to resolve current log file */ class IncreaseTextSizeButton(val fileId: FileId) extends TextSizeButton(16, "increase text size") { - + setId(IncreaseTextSizeButton.uiNode(fileId).value) setOnAction(_ => { if (getFontSize + OpsToolBar.fontSizeStep < 50 * OpsToolBar.fontSizeStep) { setFontSize(getFontSize + OpsToolBar.fontSizeStep) diff --git a/docs/src/main/scala/app/logorrr/docs/ScreenShotterApp.scala b/docs/src/main/scala/app/logorrr/docs/ScreenShotterApp.scala index e39c79be..d33da0ff 100644 --- a/docs/src/main/scala/app/logorrr/docs/ScreenShotterApp.scala +++ b/docs/src/main/scala/app/logorrr/docs/ScreenShotterApp.scala @@ -48,12 +48,12 @@ class ScreenShotterApp extends javafx.application.Application with CanLog { val settings: Settings = SettingsIO.fromFile(path) val updatedSettings = settings.copy(stageSettings = settings.stageSettings.copy(width = w, height = h + 28)) - val services = LogoRRRServices( - new NativeHostServices(getHostServices) + val services = LogoRRRServices(updatedSettings + , new NativeHostServices(getHostServices) , new NativeOpenFileService(() => stage.getScene.getWindow) , isUnderTest = false) - LogoRRRApp.start(stage, updatedSettings, services) + LogoRRRApp.start(stage, services) val bPath = Paths.get(s"docs/releases/${AppMeta.appVersion}/") Fs.createDirectories(bPath)