mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-22 05:40:43 +08:00
fix: layout horizontal not working since 2025.9 after switching away from history screen (#1108)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -12,7 +12,7 @@ namespace SourceGit.Views
|
||||
public class HistoriesLayout : Grid
|
||||
{
|
||||
public static readonly StyledProperty<bool> UseHorizontalProperty =
|
||||
AvaloniaProperty.Register<HistoriesLayout, bool>(nameof(UseHorizontal));
|
||||
AvaloniaProperty.Register<HistoriesLayout, bool>(nameof(UseHorizontal), false);
|
||||
|
||||
public bool UseHorizontal
|
||||
{
|
||||
@@ -22,19 +22,20 @@ namespace SourceGit.Views
|
||||
|
||||
protected override Type StyleKeyOverride => typeof(Grid);
|
||||
|
||||
public HistoriesLayout()
|
||||
{
|
||||
RefreshLayout();
|
||||
}
|
||||
|
||||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
|
||||
{
|
||||
base.OnPropertyChanged(change);
|
||||
|
||||
if (change.Property == UseHorizontalProperty)
|
||||
if (change.Property == UseHorizontalProperty && IsLoaded)
|
||||
RefreshLayout();
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
RefreshLayout();
|
||||
}
|
||||
|
||||
private void RefreshLayout()
|
||||
{
|
||||
if (UseHorizontal)
|
||||
|
||||
Reference in New Issue
Block a user