From: Olaf Wintermann Date: Sun, 24 May 2026 08:11:29 +0000 (+0200) Subject: make the position of the cancel button consistent across all dialogs X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=2523b87b5771c2e95f7cdb3aad0c3713333aa308;p=rssreader.git make the position of the cancel button consistent across all dialogs --- diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt index 4e19ef2..a0b884c 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt @@ -89,6 +89,10 @@ class ConfigWindow { } row { + button("Cancel") { + window.close() + } + label(hexpand = true) button("Save") { try { save() @@ -97,10 +101,6 @@ class ConfigWindow { message.setString("Error: ${e.message}") } } - label(hexpand = true) - button("Cancel") { - window.close() - } } } } 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 4616009..673b88b 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt @@ -375,15 +375,15 @@ class MainWindow() { val w = dialogWindow( parent = window, title = "Add Feed", - defaultButton = 1, - lbutton1 = "Add", - rbutton4 = "Cancel", + defaultButton = 4, + lbutton1 = "Cancel", + rbutton4 = "Add", modal = true, showCloseButton = false, width = 600, height = 450, onClick = { ev -> - if(ev.intValue == 1) { + if(ev.intValue == 4) { feedConfig?.addFeed() } ev.`object`.close() @@ -399,13 +399,13 @@ class MainWindow() { val w = dialogWindow( parent = window, title = "Add Folder", - defaultButton = 1, - lbutton1 = "Add", - rbutton4 = "Cancel", + defaultButton = 4, + lbutton1 = "Cancel", + rbutton4 = "Add", modal = true, showCloseButton = false, onClick = { ev -> - if(ev.intValue == 1) { + if(ev.intValue == 4) { val nameStr = name.toString() if(!nameStr.isBlank()) { try { @@ -451,15 +451,15 @@ class MainWindow() { val w = dialogWindow( parent = window, title = "Edit Feed", - defaultButton = 1, - lbutton1 = "Save", - rbutton4 = "Cancel", + defaultButton = 4, + lbutton1 = "Cancel", + rbutton4 = "Save", modal = true, showCloseButton = false, width = 600, height = 450, onClick = { ev -> - if(ev.intValue == 1) { + if(ev.intValue == 4) { feedConfig?.updateFeed() } ev.`object`.close()