aboutsummaryrefslogtreecommitdiff
path: root/main/src/windows/preferences_window
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-08-26 15:01:29 -0400
committerfrosty <gabriel@bwaaa.monster>2026-08-26 15:01:29 -0400
commit2ba1fe874070fc372c1a522c5c5b97173fbe1459 (patch)
treea7da63605cc3210bc0288600b9b42737d0f3c073 /main/src/windows/preferences_window
parent3a4aa40217276ac0d864c392f9a4b875ff8970ab (diff)
feat: add tweaks page to preferences, as well as an option for avatar roundness
Diffstat (limited to 'main/src/windows/preferences_window')
-rw-r--r--main/src/windows/preferences_window/preferences_dialog.vala3
-rw-r--r--main/src/windows/preferences_window/tweaks_preferences_page.vala27
2 files changed, 29 insertions, 1 deletions
diff --git a/main/src/windows/preferences_window/preferences_dialog.vala b/main/src/windows/preferences_window/preferences_dialog.vala
index 4baced96..a92575f0 100644
--- a/main/src/windows/preferences_window/preferences_dialog.vala
+++ b/main/src/windows/preferences_window/preferences_dialog.vala
@@ -10,6 +10,7 @@ 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;
+ [GtkChild] public unowned Dino.Ui.TweaksPreferencesPage tweaks_page;
[GtkChild] public unowned ViewModel.PreferencesDialog model { get; }
@@ -24,4 +25,4 @@ public class Dino.Ui.PreferencesDialog : Adw.PreferencesDialog {
this.push_subpage(account_page);
});
}
-} \ No newline at end of file
+}
diff --git a/main/src/windows/preferences_window/tweaks_preferences_page.vala b/main/src/windows/preferences_window/tweaks_preferences_page.vala
new file mode 100644
index 00000000..6da43348
--- /dev/null
+++ b/main/src/windows/preferences_window/tweaks_preferences_page.vala
@@ -0,0 +1,27 @@
+using Gtk;
+
+public class Dino.Ui.ViewModel.TweaksPreferencesPage : Object {
+ public int avatar_roundness { get; set; }
+}
+
+[GtkTemplate (ui = "/im/dino/Dino/preferences_window/tweaks_preferences_page.ui")]
+public class Dino.Ui.TweaksPreferencesPage : Adw.PreferencesPage {
+ [GtkChild] private unowned Adw.SpinRow avatar_roundness_row;
+
+ public ViewModel.TweaksPreferencesPage model { get; set; default = new ViewModel.TweaksPreferencesPage(); }
+ private Binding? avatar_roundness_binding;
+
+ construct {
+ this.notify["model"].connect(on_model_changed);
+ }
+
+ private void on_model_changed() {
+ if (avatar_roundness_binding != null) {
+ avatar_roundness_binding.unbind();
+ avatar_roundness_binding = null;
+ }
+ if (model != null) {
+ avatar_roundness_binding = model.bind_property("avatar-roundness", avatar_roundness_row, "value", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
+ }
+ }
+}