From f17926329915fcd8f95e00ab042d1a22ea2b7371 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 6 Oct 2025 18:17:17 +0200 Subject: Use AdwDialog for conversation details and preferences --- .../preferences_window/preferences_dialog.vala | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 main/src/windows/preferences_window/preferences_dialog.vala (limited to 'main/src/windows/preferences_window/preferences_dialog.vala') diff --git a/main/src/windows/preferences_window/preferences_dialog.vala b/main/src/windows/preferences_window/preferences_dialog.vala new file mode 100644 index 00000000..7a70ca00 --- /dev/null +++ b/main/src/windows/preferences_window/preferences_dialog.vala @@ -0,0 +1,27 @@ +using Gdk; +using Dino.Entities; +using Xmpp; +using Xmpp.Xep; +using Gee; +using Gtk; + +[GtkTemplate (ui = "/im/dino/Dino/preferences_window/preferences_dialog.ui")] +public class Dino.Ui.PreferencesDialog : Adw.PreferencesDialog { + [GtkChild] public unowned Dino.Ui.PreferencesWindowAccounts accounts_page; + [GtkChild] public unowned Dino.Ui.PreferencesWindowEncryption encryption_page; + [GtkChild] public unowned Dino.Ui.GeneralPreferencesPage general_page; + public Dino.Ui.AccountPreferencesSubpage account_page = new Dino.Ui.AccountPreferencesSubpage(); + + [GtkChild] public unowned ViewModel.PreferencesDialog model { get; } + + construct { + this.bind_property("model", accounts_page, "model", BindingFlags.SYNC_CREATE); + this.bind_property("model", account_page, "model", BindingFlags.SYNC_CREATE); + this.bind_property("model", encryption_page, "model", BindingFlags.SYNC_CREATE); + + accounts_page.account_chosen.connect((account) => { + model.selected_account = model.account_details[account]; + this.push_subpage(account_page); + }); + } +} \ No newline at end of file -- cgit v1.3