From 30d58abc54a50388bda2991465c1e73117163b5c Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Sun, 12 Oct 2025 17:32:46 +0200 Subject: [PATCH] fix preview toggle button initialization --- .../src/main/kotlin/de/unixwork/rssreader/FeedList.kt | 1 + .../src/main/kotlin/de/unixwork/rssreader/MainWindow.kt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt index 7efa293..a325645 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt @@ -127,6 +127,7 @@ class FeedList(window: MainWindow) : Document() { webview.loadContent(item.link, content, mimeType, "utf-8") tabview.setIntValue(1) + preview.setIntValue(0) // reset preview toggle button // Update read status if(!item.isRead) { diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt index 152788b..7ed8106 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt @@ -173,8 +173,10 @@ class MainWindow() { row { hbox(spacing = 4, colspan = 2) { linkbutton(label = "Browser", varname = "link2", type = LinkButtonType.BUTTON) - togglebutton (label = "Preview", tooltip = "Open article in the internal webview", varname = "preview") { - feedList.togglePreview() + togglebutton (label = "Preview", tooltip = "Open article in the internal webview", varname = "preview") { event -> + if(event.set == 0) { + feedList.togglePreview() + } } } } -- 2.47.3