]> uap-core.de Git - rssreader.git/commitdiff
make the position of the cancel button consistent across all dialogs
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 24 May 2026 08:11:29 +0000 (10:11 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 24 May 2026 08:11:29 +0000 (10:11 +0200)
rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt
rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt

index 4e19ef29ef46e272f83aa26102fe1450cd60ba4a..a0b884c820644e1c0270d9d1443b365778319e0b 100644 (file)
@@ -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()
-                    }
                 }
             }
         }
index 46160091aa7027cf240e24612fe446bfcd992ff9..673b88b4973baed8959d5b7fabc0c4a53bbde205 100644 (file)
@@ -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()