From 90ea9c4da4aa885faf7a74ce85c5ec9b1841db2e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 21 Jun 2024 17:58:00 +0200 Subject: Preferences dialog: Various improvements - Only show avatar remove button if one is set, fixes #1589 - Only show account picker if user has more than one account --- .../windows/preferences_window/account_preferences_subpage.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'main/src/windows/preferences_window/account_preferences_subpage.vala') diff --git a/main/src/windows/preferences_window/account_preferences_subpage.vala b/main/src/windows/preferences_window/account_preferences_subpage.vala index 01cf5584..a1966e34 100644 --- a/main/src/windows/preferences_window/account_preferences_subpage.vala +++ b/main/src/windows/preferences_window/account_preferences_subpage.vala @@ -123,8 +123,14 @@ public class Dino.Ui.AccountPreferencesSubpage : Gtk.Box { return true; }); + // Only show avatar removal button if an avatar is set + var avatar_model = model.selected_account.avatar_model.tiles.get_item(0) as ViewModel.AvatarPictureTileModel; + avatar_model.notify["image-file"].connect(() => { + remove_avatar_button.visible = avatar_model.image_file != null; + }); + remove_avatar_button.visible = avatar_model.image_file != null; + model.selected_account.notify["connection-error"].connect(() => { - // TODO doesn't work if (model.selected_account.connection_error != null) { connection_status.add_css_class("error"); } else { -- cgit v1.2.3-70-g09d2