From: Olaf Wintermann Date: Sun, 12 Oct 2025 15:32:46 +0000 (+0200) Subject: fix preview toggle button initialization X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=30d58abc54a50388bda2991465c1e73117163b5c;p=rssreader.git fix preview toggle button initialization --- 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() + } } } }