From fa7ce67eab38d58543ca53230ddf20427c40e8f1 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 21 May 2026 14:06:15 +0200 Subject: [PATCH] Fixed guide focus handling --- nomadnet/ui/textui/Guide.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py index dfe3e12..b82245b 100644 --- a/nomadnet/ui/textui/Guide.py +++ b/nomadnet/ui/textui/Guide.py @@ -74,17 +74,17 @@ def _rows_above(attrmaps, index, cols): class GuideColumns(urwid.Columns): def keypress(self, size, key): - if key == "up" and self.focus_position == 1: - disp = getattr(self, "guide_display", None) - if disp is not None: - scrollable = getattr(disp, "_content_scrollable", None) - if scrollable is not None: - try: - if scrollable.get_scrollpos() <= 0: - nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.frame.focus_position = "header" - return None - except Exception: - pass + # TODO: Scroll handling is currently very weird + # in the guide reader. When using page up/down + # or mouse scroll, the actual cursor position + # does not follow the scroll, as it does in the + # browser. If you scroll down, and then use the + # arrow keys, the position jumps back up to + # where you "left" the cursor. + # There's handling for this in the Browser code + # but I don't have time to port it over here at + # this point. If someone else takes that one up + # it's :) :) :) return super().keypress(size, key) @@ -98,7 +98,7 @@ class GuideLinkDelegate: pass def micron_released_focus(self): - pass + self.reader.focus_topics() def handle_link(self, target, fields=None): if not target: