Skip to content

Commit

Permalink
Fix TextAlignment bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Jan 28, 2025
1 parent 1904d3c commit d61669e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/PicView.Avalonia/Navigation/FileListManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PicView.Avalonia.Gallery;
using Avalonia.Media;
using Avalonia.Threading;
using PicView.Avalonia.Gallery;
using PicView.Avalonia.Interfaces;
using PicView.Avalonia.UI;
using PicView.Avalonia.ViewModels;
Expand Down Expand Up @@ -80,6 +82,14 @@ public static async Task UpdateFileList(IPlatformSpecificService? platformSpecif
}
else return;

await Dispatcher.UIThread.InvokeAsync(() =>
{
// Fixes the text alignment
// TODO: Find a better solution
UIHelper.GetEditableTitlebar.TextBlock.TextAlignment = TextAlignment.Left;
UIHelper.GetEditableTitlebar.TextBlock.TextAlignment = TextAlignment.Center;
});

await GalleryLoad.ReloadGalleryAsync(vm, vm.FileInfo.DirectoryName);
}

Expand All @@ -97,6 +107,15 @@ public static async Task UpdateFileList(IPlatformSpecificService? platformSpecif
SetTitleHelper.SetTitle(vm);
}
else return;

await Dispatcher.UIThread.InvokeAsync(() =>
{
// Fixes the text alignment
// TODO: Find a better solution
UIHelper.GetEditableTitlebar.TextBlock.TextAlignment = TextAlignment.Left;
UIHelper.GetEditableTitlebar.TextBlock.TextAlignment = TextAlignment.Center;
});


await GalleryLoad.ReloadGalleryAsync(vm, vm.FileInfo.DirectoryName);
}
Expand Down

0 comments on commit d61669e

Please sign in to comment.