From 0fc91dc50edddb9e8a483fb2f0e62939b5f2d4e3 Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 3 Feb 2026 00:15:37 +0100 Subject: [PATCH] Use new update logic to construct dialog UIs --- Sources/Adwaita/View/Dialogs/AlertDialog.swift | 1 + Sources/Adwaita/View/Dialogs/Dialog.swift | 1 + Sources/Adwaita/View/NavigationView+.swift | 2 ++ 3 files changed, 4 insertions(+) diff --git a/Sources/Adwaita/View/Dialogs/AlertDialog.swift b/Sources/Adwaita/View/Dialogs/AlertDialog.swift index 3a91178..d518bba 100644 --- a/Sources/Adwaita/View/Dialogs/AlertDialog.swift +++ b/Sources/Adwaita/View/Dialogs/AlertDialog.swift @@ -215,6 +215,7 @@ public struct AlertDialog: AdwaitaWidget { storage.content[Self.dialogID + id] = [dialog] if let extraChild { let child = extraChild.storage(data: data, type: AdwaitaMainView.self) + extraChild.updateStorage(child, data: data, updateProperties: true, type: AdwaitaMainView.self) let childPointer = child.pointer as? OpaquePointer storage.content["extra-child"] = [child] adw_alert_dialog_set_extra_child(pointer?.cast(), childPointer?.cast()) diff --git a/Sources/Adwaita/View/Dialogs/Dialog.swift b/Sources/Adwaita/View/Dialogs/Dialog.swift index 083816a..99c799d 100644 --- a/Sources/Adwaita/View/Dialogs/Dialog.swift +++ b/Sources/Adwaita/View/Dialogs/Dialog.swift @@ -130,6 +130,7 @@ struct Dialog: AdwaitaWidget { let dialog = ViewStorage(pointer?.opaque()) storage.content[dialogID + id] = [dialog] let contentStorage = content.storage(data: data, type: type) + content.updateStorage(contentStorage, data: data, updateProperties: true, type: type) adw_dialog_set_child(pointer, contentStorage.opaquePointer?.cast()) storage.content[contentID + id] = [contentStorage] dialog.connectSignal(name: "closed") { diff --git a/Sources/Adwaita/View/NavigationView+.swift b/Sources/Adwaita/View/NavigationView+.swift index a2944dd..02657f1 100644 --- a/Sources/Adwaita/View/NavigationView+.swift +++ b/Sources/Adwaita/View/NavigationView+.swift @@ -111,6 +111,8 @@ extension NavigationView { } else { print("Warning: removing the initial view is not allowed.") } case let .push(component): let contentStorage = views.0(component).storage(data: data, type: AdwaitaMainView.self) + views.0(component) + .updateStorage(contentStorage, data: data, updateProperties: true, type: AdwaitaMainView.self) contentStorage.fields[Self.componentID] = component storages.append(contentStorage) adw_navigation_view_push(