From: Olaf Wintermann Date: Wed, 3 Dec 2025 17:51:58 +0000 (+0100) Subject: remove invisible tabview from window layout and replace it with a visibility state X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=d111fe54cb3c853e3d8bb081e2bd8f19ee2286ca;p=rssreader.git remove invisible tabview from window layout and replace it with a visibility state --- 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 1943dd1..145bb10 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt @@ -17,7 +17,6 @@ class FeedList(window: MainWindow) : Document() { val link = UiLinkData(linkstr) val category = string("category") val webview = webview("webview") - val tabview = integer("tabview") val starred = integer("starred") val browser = integer("browser") @@ -148,7 +147,7 @@ class FeedList(window: MainWindow) : Document() { starred.setIntValue(0) } - tabview.setIntValue(1) // select item page + window.window.ui.setState(MainWindow.ITEM_SELETED) val browserSetting = browserSetting.intValue() if(browserSetting == 0) { 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 7d090f7..7ef0f34 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt @@ -29,6 +29,7 @@ import java.time.format.DateTimeFormatter class MainWindow() { companion object { + const val ITEM_SELETED = 900 const val ITEM_HAS_AUTHOR = 1000 const val ITEM_HAS_CATEGORY = 1001 const val ITEM_INTERNAL_BROWSER = 1002 @@ -288,49 +289,40 @@ class MainWindow() { } rightPanel { - tabview(fill = true, varname = "tabview", type = TabViewType.INVISIBLE) { - tab { - // Completely empty tab, we don't want any visible UI elements - // when no feed item is selected. - // As an alternative to using a tabview, we could use a - // visibility state for the grid container + val g = grid(fill = true, columnspacing = 8, rowspacing = 8, margin = 8, defvfill = true) { + row { + rlabel("Feed:", hfill = true) + llabel(varname = "feedname", hexpand = true) + } + row { + val w1 = rlabel("Author:", hfill = true) + val w2 = llabel(varname = "author") + w1.setVisibilityStates(ITEM_HAS_AUTHOR) + w2.setVisibilityStates(ITEM_HAS_AUTHOR) + } + row { + val w1 = rlabel("Category: ", hfill = true) + val w2 = llabel(varname = "category") + w1.setVisibilityStates(ITEM_HAS_CATEGORY) + w2.setVisibilityStates(ITEM_HAS_CATEGORY) + } + row { + rlabel("Link:", hfill = true) + linkbutton(varname = "link", styleClass = "ui-nopadding"); } - tab { - grid(fill = true, columnspacing = 8, rowspacing = 8, margin = 8, defvfill = true) { - row { - rlabel("Feed:", hfill = true) - llabel(varname = "feedname", hexpand = true) - } - row { - val w1 = rlabel("Author:", hfill = true) - val w2 = llabel(varname = "author") - w1.setVisibilityStates(ITEM_HAS_AUTHOR) - w2.setVisibilityStates(ITEM_HAS_AUTHOR) - } - row { - val w1 = rlabel("Category: ", hfill = true) - val w2 = llabel(varname = "category") - w1.setVisibilityStates(ITEM_HAS_CATEGORY) - w2.setVisibilityStates(ITEM_HAS_CATEGORY) - } - row { - rlabel("Link:", hfill = true) - linkbutton(varname = "link", styleClass = "ui-nopadding"); - } - row { - vbox(hfill = true, vfill = true, hexpand = true, vexpand = true, colspan = 2) { - hbox(spacing = 4, visibilityStates = intArrayOf(ITEM_INTERNAL_BROWSER)) { - button(icon = "go-previous") - button(icon = "go-next") - textfield(varname = "web-uri", fill = true) - } - webview(varname = "webview", fill = true, colspan = 2) - } + row { + vbox(hfill = true, vfill = true, hexpand = true, vexpand = true, colspan = 2) { + hbox(spacing = 4, visibilityStates = intArrayOf(ITEM_INTERNAL_BROWSER)) { + button(icon = "go-previous") + button(icon = "go-next") + textfield(varname = "web-uri", fill = true) } + webview(varname = "webview", fill = true, colspan = 2) } } } + g.setVisibilityStates(ITEM_SELETED) } }