From 6a252d86fd1f11f76b8e24416c6b3f52a1b79477 Mon Sep 17 00:00:00 2001 From: UnicornFreedom Date: Wed, 3 Sep 2025 11:39:43 +0200 Subject: [PATCH] Core review corrections --- src/main/scala/ocelot/desktop/ui/widget/LogWidget.scala | 2 ++ .../scala/ocelot/desktop/windows/OcelotInterfaceWindow.scala | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/ocelot/desktop/ui/widget/LogWidget.scala b/src/main/scala/ocelot/desktop/ui/widget/LogWidget.scala index fb7d637..c4f3c90 100644 --- a/src/main/scala/ocelot/desktop/ui/widget/LogWidget.scala +++ b/src/main/scala/ocelot/desktop/ui/widget/LogWidget.scala @@ -74,6 +74,8 @@ abstract class LogWidget extends Widget { entries.dropInPlace(count) } + // this is a fix for log widget not scaling down after being cleaned + // TODO: implement it nicely size = minimumSize parent.get.recalculateBoundsAndRelayout() } diff --git a/src/main/scala/ocelot/desktop/windows/OcelotInterfaceWindow.scala b/src/main/scala/ocelot/desktop/windows/OcelotInterfaceWindow.scala index acdc290..5aa19f1 100644 --- a/src/main/scala/ocelot/desktop/windows/OcelotInterfaceWindow.scala +++ b/src/main/scala/ocelot/desktop/windows/OcelotInterfaceWindow.scala @@ -30,7 +30,7 @@ class OcelotInterfaceWindow(storage: OcelotInterfaceLogStorage) extends PanelWin children :+= new TextInput() { eventHandlers += { - case event @ KeyEvent(KeyEvent.State.Press | KeyEvent.State.Repeat, Keyboard.KEY_UP | Keyboard.KEY_DOWN, _) if this.isFocused => + case event @ KeyEvent(KeyEvent.State.Press | KeyEvent.State.Repeat, Keyboard.KEY_UP | Keyboard.KEY_DOWN, _) if isFocused => val currentInput = text val index = if (event.code == Keyboard.KEY_UP) { storage.findLastTextEntry(currentInput, storage.entryCount - historyPosition)